license.bot | bf09a50 | 2008-08-24 00:55:55 | [diff] [blame] | 1 | // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 4 | |
| 5 | #include "chrome/browser/browser_process_impl.h" |
| 6 | |
| 7 | #include "base/command_line.h" |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 8 | #include "base/path_service.h" |
[email protected] | ac262c9f | 2008-10-19 17:45:21 | [diff] [blame] | 9 | #include "base/thread.h" |
[email protected] | 1c4947f | 2009-01-15 22:25:11 | [diff] [blame] | 10 | #include "base/waitable_event.h" |
[email protected] | ac262c9f | 2008-10-19 17:45:21 | [diff] [blame] | 11 | #include "chrome/browser/browser_trial.h" |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 12 | #include "chrome/browser/chrome_thread.h" |
[email protected] | 4ab4b0f | 2009-02-10 18:54:50 | [diff] [blame^] | 13 | #include "chrome/browser/debugger/debugger_wrapper.h" |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 14 | #include "chrome/browser/google_url_tracker.h" |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 15 | #include "chrome/browser/profile_manager.h" |
[email protected] | 8c8657d6 | 2009-01-16 18:31:26 | [diff] [blame] | 16 | #include "chrome/browser/renderer_host/render_process_host.h" |
[email protected] | 81218f4 | 2009-02-05 18:48:08 | [diff] [blame] | 17 | #include "chrome/browser/renderer_host/resource_dispatcher_host.h" |
| 18 | #include "chrome/browser/safe_browsing/safe_browsing_service.h" |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 19 | #include "chrome/common/chrome_paths.h" |
| 20 | #include "chrome/common/chrome_switches.h" |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 21 | #include "chrome/common/notification_service.h" |
| 22 | #include "chrome/common/pref_names.h" |
| 23 | #include "chrome/common/pref_service.h" |
[email protected] | b112a4c | 2009-02-01 20:24:01 | [diff] [blame] | 24 | |
| 25 | #if defined(OS_WIN) |
| 26 | #include "chrome/browser/automation/automation_provider_list.h" |
| 27 | #include "chrome/browser/download/download_file.h" |
| 28 | #include "chrome/browser/download/save_file_manager.h" |
| 29 | #include "chrome/browser/icon_manager.h" |
| 30 | #include "chrome/browser/metrics/metrics_service.h" |
[email protected] | 81218f4 | 2009-02-05 18:48:08 | [diff] [blame] | 31 | #include "chrome/browser/plugin_service.h" |
[email protected] | b112a4c | 2009-02-01 20:24:01 | [diff] [blame] | 32 | #include "chrome/browser/printing/print_job_manager.h" |
[email protected] | b112a4c | 2009-02-01 20:24:01 | [diff] [blame] | 33 | #include "chrome/common/clipboard_service.h" |
| 34 | #include "chrome/common/l10n_util.h" |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 35 | #include "chrome/views/accelerator_handler.h" |
| 36 | #include "chrome/views/view_storage.h" |
[email protected] | 81218f4 | 2009-02-05 18:48:08 | [diff] [blame] | 37 | #elif defined(OS_POSIX) |
| 38 | // TODO(port): Remove the temporary scaffolding as we port the above headers. |
| 39 | #include "chrome/common/temp_scaffolding_stubs.h" |
[email protected] | b112a4c | 2009-02-01 20:24:01 | [diff] [blame] | 40 | #endif |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 41 | |
| 42 | namespace { |
| 43 | |
| 44 | // ---------------------------------------------------------------------------- |
| 45 | // BrowserProcessSubThread |
| 46 | // |
| 47 | // This simple thread object is used for the specialized threads that the |
| 48 | // BrowserProcess spins up. |
| 49 | // |
| 50 | // Applications must initialize the COM library before they can call |
| 51 | // COM library functions other than CoGetMalloc and memory allocation |
| 52 | // functions, so this class initializes COM for those users. |
| 53 | class BrowserProcessSubThread : public ChromeThread { |
| 54 | public: |
| 55 | explicit BrowserProcessSubThread(ChromeThread::ID identifier) |
| 56 | : ChromeThread(identifier) { |
| 57 | } |
| 58 | |
| 59 | ~BrowserProcessSubThread() { |
| 60 | // We cannot rely on our base class to stop the thread since we want our |
| 61 | // CleanUp function to run. |
| 62 | Stop(); |
| 63 | } |
| 64 | |
| 65 | protected: |
| 66 | virtual void Init() { |
[email protected] | b112a4c | 2009-02-01 20:24:01 | [diff] [blame] | 67 | #if defined(OS_WIN) |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 68 | // Initializes the COM library on the current thread. |
| 69 | CoInitialize(NULL); |
[email protected] | b112a4c | 2009-02-01 20:24:01 | [diff] [blame] | 70 | #endif |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 71 | |
| 72 | notification_service_ = new NotificationService; |
| 73 | } |
| 74 | |
| 75 | virtual void CleanUp() { |
| 76 | delete notification_service_; |
| 77 | notification_service_ = NULL; |
| 78 | |
[email protected] | b112a4c | 2009-02-01 20:24:01 | [diff] [blame] | 79 | #if defined(OS_WIN) |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 80 | // Closes the COM library on the current thread. CoInitialize must |
| 81 | // be balanced by a corresponding call to CoUninitialize. |
| 82 | CoUninitialize(); |
[email protected] | b112a4c | 2009-02-01 20:24:01 | [diff] [blame] | 83 | #endif |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 84 | } |
| 85 | |
| 86 | private: |
| 87 | // Each specialized thread has its own notification service. |
| 88 | // Note: We don't use scoped_ptr because the destructor runs on the wrong |
| 89 | // thread. |
| 90 | NotificationService* notification_service_; |
| 91 | }; |
| 92 | |
| 93 | } // namespace |
| 94 | |
[email protected] | bb97536 | 2009-01-21 01:00:22 | [diff] [blame] | 95 | BrowserProcessImpl::BrowserProcessImpl(const CommandLine& command_line) |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 96 | : created_resource_dispatcher_host_(false), |
| 97 | created_metrics_service_(false), |
| 98 | created_io_thread_(false), |
| 99 | created_file_thread_(false), |
| 100 | created_db_thread_(false), |
| 101 | created_profile_manager_(false), |
| 102 | created_local_state_(false), |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 103 | initialized_broker_services_(false), |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 104 | broker_services_(NULL), |
[email protected] | b112a4c | 2009-02-01 20:24:01 | [diff] [blame] | 105 | created_icon_manager_(false), |
| 106 | created_debugger_wrapper_(false), |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 107 | module_ref_count_(0), |
[email protected] | 1b2db1a | 2008-08-08 17:46:13 | [diff] [blame] | 108 | memory_model_(MEDIUM_MEMORY_MODEL), |
| 109 | checked_for_new_frames_(false), |
| 110 | using_new_frames_(false) { |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 111 | g_browser_process = this; |
| 112 | clipboard_service_.reset(new ClipboardService); |
| 113 | main_notification_service_.reset(new NotificationService); |
| 114 | |
| 115 | // Must be created after the NotificationService. |
| 116 | print_job_manager_.reset(new printing::PrintJobManager); |
| 117 | |
| 118 | // Configure the browser memory model. |
| 119 | if (command_line.HasSwitch(switches::kMemoryModel)) { |
| 120 | std::wstring model = command_line.GetSwitchValue(switches::kMemoryModel); |
| 121 | if (!model.empty()) { |
| 122 | if (model == L"high") |
| 123 | memory_model_ = HIGH_MEMORY_MODEL; |
| 124 | else if (model == L"low") |
| 125 | memory_model_ = LOW_MEMORY_MODEL; |
| 126 | else if (model == L"medium") |
| 127 | memory_model_ = MEDIUM_MEMORY_MODEL; |
| 128 | } |
[email protected] | ac262c9f | 2008-10-19 17:45:21 | [diff] [blame] | 129 | } else { |
| 130 | // Randomly choose what memory model to use. |
| 131 | const double probability = 0.5; |
| 132 | FieldTrial* trial(new FieldTrial(BrowserTrial::kMemoryModelFieldTrial, |
| 133 | probability)); |
| 134 | DCHECK(FieldTrialList::Find(BrowserTrial::kMemoryModelFieldTrial) == trial); |
| 135 | if (trial->boolean_value()) |
| 136 | memory_model_ = HIGH_MEMORY_MODEL; |
| 137 | else |
| 138 | memory_model_ = MEDIUM_MEMORY_MODEL; |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 139 | } |
| 140 | |
[email protected] | b797e15 | 2009-01-23 16:06:14 | [diff] [blame] | 141 | shutdown_event_.reset(new base::WaitableEvent(true, false)); |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 142 | } |
| 143 | |
| 144 | BrowserProcessImpl::~BrowserProcessImpl() { |
| 145 | // Delete the AutomationProviderList before NotificationService, |
| 146 | // since it may try to unregister notifications |
| 147 | // Both NotificationService and AutomationProvider are singleton instances in |
| 148 | // the BrowserProcess. Since AutomationProvider may have some active |
| 149 | // notification observers, it is essential that it gets destroyed before the |
| 150 | // NotificationService. NotificationService won't be destroyed until after |
| 151 | // this destructor is run. |
| 152 | automation_provider_list_.reset(); |
| 153 | |
| 154 | // We need to destroy the MetricsService and GoogleURLTracker before the |
| 155 | // io_thread_ gets destroyed, since both destructors can call the URLFetcher |
| 156 | // destructor, which does an InvokeLater operation on the IO thread. (The IO |
| 157 | // thread will handle that URLFetcher operation before going away.) |
| 158 | metrics_service_.reset(); |
| 159 | google_url_tracker_.reset(); |
| 160 | |
| 161 | // Need to clear profiles (download managers) before the io_thread_. |
| 162 | profile_manager_.reset(); |
| 163 | |
| 164 | // Debugger must be cleaned up before IO thread and NotificationService. |
| 165 | debugger_wrapper_ = NULL; |
| 166 | |
| 167 | if (resource_dispatcher_host_.get()) { |
| 168 | // Need to tell Safe Browsing Service that the IO thread is going away |
| 169 | // since it cached a pointer to it. |
| 170 | if (resource_dispatcher_host()->safe_browsing_service()) |
| 171 | resource_dispatcher_host()->safe_browsing_service()->ShutDown(); |
| 172 | |
| 173 | // Cancel pending requests and prevent new requests. |
| 174 | resource_dispatcher_host()->Shutdown(); |
| 175 | } |
| 176 | |
| 177 | // Need to stop io_thread_ before resource_dispatcher_host_, since |
| 178 | // io_thread_ may still deref ResourceDispatcherHost and handle resource |
| 179 | // request before going away. |
| 180 | io_thread_.reset(); |
| 181 | |
| 182 | // Clean up state that lives on the file_thread_ before it goes away. |
| 183 | if (resource_dispatcher_host_.get()) { |
| 184 | resource_dispatcher_host()->download_file_manager()->Shutdown(); |
| 185 | resource_dispatcher_host()->save_file_manager()->Shutdown(); |
| 186 | } |
| 187 | |
| 188 | // Need to stop the file_thread_ here to force it to process messages in its |
| 189 | // message loop from the previous call to shutdown the DownloadFileManager, |
| 190 | // SaveFileManager and SessionService. |
| 191 | file_thread_.reset(); |
| 192 | |
| 193 | // With the file_thread_ flushed, we can release any icon resources. |
| 194 | icon_manager_.reset(); |
| 195 | |
| 196 | // Need to destroy ResourceDispatcherHost before PluginService and |
| 197 | // SafeBrowsingService, since it caches a pointer to it. |
| 198 | resource_dispatcher_host_.reset(); |
| 199 | |
| 200 | // Wait for the pending print jobs to finish. |
| 201 | print_job_manager_->OnQuit(); |
| 202 | print_job_manager_.reset(); |
| 203 | |
[email protected] | b112a4c | 2009-02-01 20:24:01 | [diff] [blame] | 204 | // TODO(port): remove this completely from BrowserProcessImpl, it has no |
| 205 | // business being here. |
| 206 | #if defined(OS_WIN) |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 207 | // The ViewStorage needs to go before the NotificationService. |
[email protected] | c2dacc9 | 2008-10-16 23:51:38 | [diff] [blame] | 208 | views::ViewStorage::DeleteSharedInstance(); |
[email protected] | b112a4c | 2009-02-01 20:24:01 | [diff] [blame] | 209 | #endif |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 210 | |
| 211 | // Now OK to destroy NotificationService. |
| 212 | main_notification_service_.reset(); |
| 213 | |
| 214 | g_browser_process = NULL; |
| 215 | } |
| 216 | |
[email protected] | 295039bd | 2008-08-15 04:32:57 | [diff] [blame] | 217 | // Send a QuitTask to the given MessageLoop. |
| 218 | static void PostQuit(MessageLoop* message_loop) { |
| 219 | message_loop->PostTask(FROM_HERE, new MessageLoop::QuitTask()); |
| 220 | } |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 221 | |
| 222 | void BrowserProcessImpl::EndSession() { |
[email protected] | b112a4c | 2009-02-01 20:24:01 | [diff] [blame] | 223 | #if defined(OS_WIN) |
[email protected] | d65cab7a | 2008-08-12 01:25:41 | [diff] [blame] | 224 | // Notify we are going away. |
[email protected] | b797e15 | 2009-01-23 16:06:14 | [diff] [blame] | 225 | ::SetEvent(shutdown_event_->handle()); |
[email protected] | b112a4c | 2009-02-01 20:24:01 | [diff] [blame] | 226 | #endif |
[email protected] | d65cab7a | 2008-08-12 01:25:41 | [diff] [blame] | 227 | |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 228 | // Mark all the profiles as clean. |
| 229 | ProfileManager* pm = profile_manager(); |
| 230 | for (ProfileManager::const_iterator i = pm->begin(); i != pm->end(); ++i) |
| 231 | (*i)->MarkAsCleanShutdown(); |
| 232 | |
| 233 | // Tell the metrics service it was cleanly shutdown. |
| 234 | MetricsService* metrics = g_browser_process->metrics_service(); |
| 235 | if (metrics && local_state()) { |
| 236 | metrics->RecordCleanShutdown(); |
| 237 | |
| 238 | metrics->RecordStartOfSessionEnd(); |
| 239 | |
| 240 | // MetricsService lazily writes to prefs, force it to write now. |
| 241 | local_state()->SavePersistentPrefs(file_thread()); |
| 242 | } |
| 243 | |
| 244 | // We must write that the profile and metrics service shutdown cleanly, |
| 245 | // otherwise on startup we'll think we crashed. So we block until done and |
| 246 | // then proceed with normal shutdown. |
| 247 | g_browser_process->file_thread()->message_loop()->PostTask(FROM_HERE, |
[email protected] | 295039bd | 2008-08-15 04:32:57 | [diff] [blame] | 248 | NewRunnableFunction(PostQuit, MessageLoop::current())); |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 249 | MessageLoop::current()->Run(); |
| 250 | } |
| 251 | |
| 252 | printing::PrintJobManager* BrowserProcessImpl::print_job_manager() { |
| 253 | // TODO(abarth): DCHECK(CalledOnValidThread()); |
| 254 | // See <http://b/1287209>. |
| 255 | // print_job_manager_ is initialized in the constructor and destroyed in the |
| 256 | // destructor, so it should always be valid. |
| 257 | DCHECK(print_job_manager_.get()); |
| 258 | return print_job_manager_.get(); |
| 259 | } |
| 260 | |
| 261 | const std::wstring& BrowserProcessImpl::GetApplicationLocale() { |
| 262 | DCHECK(CalledOnValidThread()); |
[email protected] | b112a4c | 2009-02-01 20:24:01 | [diff] [blame] | 263 | #if defined(OS_WIN) |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 264 | if (locale_.empty()) { |
| 265 | locale_ = l10n_util::GetApplicationLocale(local_state()->GetString( |
| 266 | prefs::kApplicationLocale)); |
| 267 | } |
[email protected] | b112a4c | 2009-02-01 20:24:01 | [diff] [blame] | 268 | #else |
| 269 | NOTIMPLEMENTED(); |
| 270 | // TODO(port): port l10n_util |
| 271 | #endif |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 272 | return locale_; |
| 273 | } |
| 274 | |
| 275 | void BrowserProcessImpl::CreateResourceDispatcherHost() { |
| 276 | DCHECK(!created_resource_dispatcher_host_ && |
| 277 | resource_dispatcher_host_.get() == NULL); |
| 278 | created_resource_dispatcher_host_ = true; |
| 279 | |
| 280 | resource_dispatcher_host_.reset( |
| 281 | new ResourceDispatcherHost(io_thread()->message_loop())); |
| 282 | resource_dispatcher_host_->Initialize(); |
| 283 | } |
| 284 | |
| 285 | void BrowserProcessImpl::CreateMetricsService() { |
| 286 | DCHECK(!created_metrics_service_ && metrics_service_.get() == NULL); |
| 287 | created_metrics_service_ = true; |
| 288 | |
| 289 | metrics_service_.reset(new MetricsService); |
| 290 | } |
| 291 | |
| 292 | void BrowserProcessImpl::CreateIOThread() { |
| 293 | DCHECK(!created_io_thread_ && io_thread_.get() == NULL); |
| 294 | created_io_thread_ = true; |
| 295 | |
| 296 | // Prior to starting the io thread, we create the plugin service as |
| 297 | // it is predominantly used from the io thread, but must be created |
| 298 | // on the main thread. The service ctor is inexpensive and does not |
| 299 | // invoke the io_thread() accessor. |
| 300 | PluginService::GetInstance(); |
| 301 | |
[email protected] | ab820df | 2008-08-26 05:55:10 | [diff] [blame] | 302 | scoped_ptr<base::Thread> thread( |
| 303 | new BrowserProcessSubThread(ChromeThread::IO)); |
| 304 | base::Thread::Options options; |
| 305 | options.message_loop_type = MessageLoop::TYPE_IO; |
| 306 | if (!thread->StartWithOptions(options)) |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 307 | return; |
| 308 | io_thread_.swap(thread); |
| 309 | } |
| 310 | |
| 311 | void BrowserProcessImpl::CreateFileThread() { |
| 312 | DCHECK(!created_file_thread_ && file_thread_.get() == NULL); |
| 313 | created_file_thread_ = true; |
| 314 | |
[email protected] | ab820df | 2008-08-26 05:55:10 | [diff] [blame] | 315 | scoped_ptr<base::Thread> thread( |
| 316 | new BrowserProcessSubThread(ChromeThread::FILE)); |
[email protected] | a1db384 | 2008-09-17 22:04:06 | [diff] [blame] | 317 | base::Thread::Options options; |
[email protected] | 9e549b58 | 2009-02-05 21:13:39 | [diff] [blame] | 318 | #if defined(OS_WIN) |
| 319 | // On Windows, the FILE thread needs to be have a UI message loop which pumps |
| 320 | // messages in such a way that Google Update can communicate back to us. |
[email protected] | a1db384 | 2008-09-17 22:04:06 | [diff] [blame] | 321 | options.message_loop_type = MessageLoop::TYPE_UI; |
[email protected] | 9e549b58 | 2009-02-05 21:13:39 | [diff] [blame] | 322 | #else |
| 323 | options.message_loop_type = MessageLoop::TYPE_IO; |
| 324 | #endif |
[email protected] | a1db384 | 2008-09-17 22:04:06 | [diff] [blame] | 325 | if (!thread->StartWithOptions(options)) |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 326 | return; |
| 327 | file_thread_.swap(thread); |
| 328 | } |
| 329 | |
| 330 | void BrowserProcessImpl::CreateDBThread() { |
| 331 | DCHECK(!created_db_thread_ && db_thread_.get() == NULL); |
| 332 | created_db_thread_ = true; |
| 333 | |
[email protected] | ab820df | 2008-08-26 05:55:10 | [diff] [blame] | 334 | scoped_ptr<base::Thread> thread( |
| 335 | new BrowserProcessSubThread(ChromeThread::DB)); |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 336 | if (!thread->Start()) |
| 337 | return; |
| 338 | db_thread_.swap(thread); |
| 339 | } |
| 340 | |
| 341 | void BrowserProcessImpl::CreateProfileManager() { |
| 342 | DCHECK(!created_profile_manager_ && profile_manager_.get() == NULL); |
| 343 | created_profile_manager_ = true; |
| 344 | |
| 345 | profile_manager_.reset(new ProfileManager()); |
| 346 | } |
| 347 | |
| 348 | void BrowserProcessImpl::CreateLocalState() { |
| 349 | DCHECK(!created_local_state_ && local_state_.get() == NULL); |
| 350 | created_local_state_ = true; |
| 351 | |
| 352 | std::wstring local_state_path; |
| 353 | PathService::Get(chrome::FILE_LOCAL_STATE, &local_state_path); |
| 354 | local_state_.reset(new PrefService(local_state_path)); |
| 355 | } |
| 356 | |
| 357 | void BrowserProcessImpl::InitBrokerServices( |
| 358 | sandbox::BrokerServices* broker_services) { |
| 359 | DCHECK(!initialized_broker_services_ && broker_services_ == NULL); |
| 360 | broker_services->Init(); |
| 361 | initialized_broker_services_ = true; |
| 362 | broker_services_ = broker_services; |
| 363 | } |
| 364 | |
| 365 | void BrowserProcessImpl::CreateIconManager() { |
| 366 | DCHECK(!created_icon_manager_ && icon_manager_.get() == NULL); |
| 367 | created_icon_manager_ = true; |
| 368 | icon_manager_.reset(new IconManager); |
| 369 | } |
| 370 | |
| 371 | void BrowserProcessImpl::CreateDebuggerWrapper(int port) { |
| 372 | DCHECK(debugger_wrapper_.get() == NULL); |
| 373 | created_debugger_wrapper_ = true; |
| 374 | |
| 375 | debugger_wrapper_ = new DebuggerWrapper(port); |
| 376 | } |
| 377 | |
| 378 | void BrowserProcessImpl::CreateAcceleratorHandler() { |
[email protected] | b112a4c | 2009-02-01 20:24:01 | [diff] [blame] | 379 | #if defined(OS_WIN) |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 380 | DCHECK(accelerator_handler_.get() == NULL); |
[email protected] | c2dacc9 | 2008-10-16 23:51:38 | [diff] [blame] | 381 | scoped_ptr<views::AcceleratorHandler> accelerator_handler( |
| 382 | new views::AcceleratorHandler); |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 383 | accelerator_handler_.swap(accelerator_handler); |
[email protected] | b112a4c | 2009-02-01 20:24:01 | [diff] [blame] | 384 | #else |
| 385 | // TODO(port): remove this completely, it has no business being here. |
| 386 | #endif |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 387 | } |
| 388 | |
| 389 | void BrowserProcessImpl::CreateGoogleURLTracker() { |
| 390 | DCHECK(google_url_tracker_.get() == NULL); |
| 391 | scoped_ptr<GoogleURLTracker> google_url_tracker(new GoogleURLTracker); |
| 392 | google_url_tracker_.swap(google_url_tracker); |
| 393 | } |
license.bot | bf09a50 | 2008-08-24 00:55:55 | [diff] [blame] | 394 | |