| OLD | NEW | 
|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be | 
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. | 
| 4 | 4 | 
| 5 #include "chrome/browser/browser_process_impl.h" | 5 #include "chrome/browser/browser_process_impl.h" | 
| 6 | 6 | 
| 7 #include <map> | 7 #include <map> | 
| 8 #include <set> | 8 #include <set> | 
| 9 #include <vector> | 9 #include <vector> | 
| 10 | 10 | 
| 11 #include "base/command_line.h" | 11 #include "base/command_line.h" | 
| 12 #include "base/file_util.h" | 12 #include "base/file_util.h" | 
| 13 #include "base/path_service.h" | 13 #include "base/path_service.h" | 
| 14 #include "base/synchronization/waitable_event.h" | 14 #include "base/synchronization/waitable_event.h" | 
| 15 #include "base/task.h" | 15 #include "base/task.h" | 
| 16 #include "base/threading/thread.h" | 16 #include "base/threading/thread.h" | 
| 17 #include "base/threading/thread_restrictions.h" | 17 #include "base/threading/thread_restrictions.h" | 
| 18 #include "chrome/browser/automation/automation_provider_list.h" | 18 #include "chrome/browser/automation/automation_provider_list.h" | 
| 19 #include "chrome/browser/background/background_mode_manager.h" | 19 #include "chrome/browser/background/background_mode_manager.h" | 
| 20 #include "chrome/browser/browser_main.h" | 20 #include "chrome/browser/browser_main.h" | 
| 21 #include "chrome/browser/browser_process_sub_thread.h" | 21 #include "chrome/browser/browser_process_sub_thread.h" | 
| 22 #include "chrome/browser/browser_trial.h" | 22 #include "chrome/browser/browser_trial.h" | 
|  | 23 #include "chrome/browser/chrome_plugin_service_filter.h" | 
| 23 #include "chrome/browser/debugger/devtools_protocol_handler.h" | 24 #include "chrome/browser/debugger/devtools_protocol_handler.h" | 
| 24 #include "chrome/browser/debugger/remote_debugging_server.h" | 25 #include "chrome/browser/debugger/remote_debugging_server.h" | 
| 25 #include "chrome/browser/download/download_file_manager.h" | 26 #include "chrome/browser/download/download_file_manager.h" | 
| 26 #include "chrome/browser/extensions/extension_event_router_forwarder.h" | 27 #include "chrome/browser/extensions/extension_event_router_forwarder.h" | 
| 27 #include "chrome/browser/extensions/extension_tab_id_map.h" | 28 #include "chrome/browser/extensions/extension_tab_id_map.h" | 
| 28 #include "chrome/browser/extensions/user_script_listener.h" | 29 #include "chrome/browser/extensions/user_script_listener.h" | 
| 29 #include "chrome/browser/first_run/upgrade_util.h" | 30 #include "chrome/browser/first_run/upgrade_util.h" | 
| 30 #include "chrome/browser/google/google_url_tracker.h" | 31 #include "chrome/browser/google/google_url_tracker.h" | 
| 31 #include "chrome/browser/icon_manager.h" | 32 #include "chrome/browser/icon_manager.h" | 
| 32 #include "chrome/browser/intranet_redirect_detector.h" | 33 #include "chrome/browser/intranet_redirect_detector.h" | 
| (...skipping 675 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 708 } | 709 } | 
| 709 | 710 | 
| 710 void BrowserProcessImpl::CreateIOThread() { | 711 void BrowserProcessImpl::CreateIOThread() { | 
| 711   DCHECK(!created_io_thread_ && io_thread_.get() == NULL); | 712   DCHECK(!created_io_thread_ && io_thread_.get() == NULL); | 
| 712   created_io_thread_ = true; | 713   created_io_thread_ = true; | 
| 713 | 714 | 
| 714   // Prior to starting the io thread, we create the plugin service as | 715   // Prior to starting the io thread, we create the plugin service as | 
| 715   // it is predominantly used from the io thread, but must be created | 716   // it is predominantly used from the io thread, but must be created | 
| 716   // on the main thread. The service ctor is inexpensive and does not | 717   // on the main thread. The service ctor is inexpensive and does not | 
| 717   // invoke the io_thread() accessor. | 718   // invoke the io_thread() accessor. | 
| 718   PluginService::GetInstance(); | 719   PluginService::GetInstance()->set_filter( | 
|  | 720       ChromePluginServiceFilter::GetInstance()); | 
| 719 | 721 | 
| 720   // Add the Chrome specific plugins. | 722   // Add the Chrome specific plugins. | 
| 721   chrome::RegisterInternalDefaultPlugin(); | 723   chrome::RegisterInternalDefaultPlugin(); | 
| 722 | 724 | 
| 723   // Register the internal Flash if available. | 725   // Register the internal Flash if available. | 
| 724   FilePath path; | 726   FilePath path; | 
| 725   if (!CommandLine::ForCurrentProcess()->HasSwitch( | 727   if (!CommandLine::ForCurrentProcess()->HasSwitch( | 
| 726           switches::kDisableInternalFlash) && | 728           switches::kDisableInternalFlash) && | 
| 727       PathService::Get(chrome::FILE_FLASH_PLUGIN, &path)) { | 729       PathService::Get(chrome::FILE_FLASH_PLUGIN, &path)) { | 
| 728     webkit::npapi::PluginList::Singleton()->AddExtraPluginPath(path); | 730     webkit::npapi::PluginList::Singleton()->AddExtraPluginPath(path); | 
| (...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 1099 } | 1101 } | 
| 1100 | 1102 | 
| 1101 void BrowserProcessImpl::OnAutoupdateTimer() { | 1103 void BrowserProcessImpl::OnAutoupdateTimer() { | 
| 1102   if (CanAutorestartForUpdate()) { | 1104   if (CanAutorestartForUpdate()) { | 
| 1103     DLOG(WARNING) << "Detected update.  Restarting browser."; | 1105     DLOG(WARNING) << "Detected update.  Restarting browser."; | 
| 1104     RestartPersistentInstance(); | 1106     RestartPersistentInstance(); | 
| 1105   } | 1107   } | 
| 1106 } | 1108 } | 
| 1107 | 1109 | 
| 1108 #endif  // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) | 1110 #endif  // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) | 
| OLD | NEW | 
|---|