| 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/component_updater/component_updater_configurator.h" | 24 #include "chrome/browser/component_updater/component_updater_configurator.h" |
| 24 #include "chrome/browser/component_updater/component_updater_service.h" | 25 #include "chrome/browser/component_updater/component_updater_service.h" |
| 25 #include "chrome/browser/debugger/devtools_protocol_handler.h" | 26 #include "chrome/browser/debugger/devtools_protocol_handler.h" |
| 26 #include "chrome/browser/debugger/remote_debugging_server.h" | 27 #include "chrome/browser/debugger/remote_debugging_server.h" |
| 27 #include "chrome/browser/download/download_request_limiter.h" | 28 #include "chrome/browser/download/download_request_limiter.h" |
| 28 #include "chrome/browser/extensions/extension_event_router_forwarder.h" | 29 #include "chrome/browser/extensions/extension_event_router_forwarder.h" |
| 29 #include "chrome/browser/extensions/extension_tab_id_map.h" | 30 #include "chrome/browser/extensions/extension_tab_id_map.h" |
| 30 #include "chrome/browser/extensions/user_script_listener.h" | 31 #include "chrome/browser/extensions/user_script_listener.h" |
| 31 #include "chrome/browser/first_run/upgrade_util.h" | 32 #include "chrome/browser/first_run/upgrade_util.h" |
| 32 #include "chrome/browser/google/google_url_tracker.h" | 33 #include "chrome/browser/google/google_url_tracker.h" |
| (...skipping 699 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 732 } | 733 } |
| 733 | 734 |
| 734 void BrowserProcessImpl::CreateIOThread() { | 735 void BrowserProcessImpl::CreateIOThread() { |
| 735 DCHECK(!created_io_thread_ && io_thread_.get() == NULL); | 736 DCHECK(!created_io_thread_ && io_thread_.get() == NULL); |
| 736 created_io_thread_ = true; | 737 created_io_thread_ = true; |
| 737 | 738 |
| 738 // Prior to starting the io thread, we create the plugin service as | 739 // Prior to starting the io thread, we create the plugin service as |
| 739 // it is predominantly used from the io thread, but must be created | 740 // it is predominantly used from the io thread, but must be created |
| 740 // on the main thread. The service ctor is inexpensive and does not | 741 // on the main thread. The service ctor is inexpensive and does not |
| 741 // invoke the io_thread() accessor. | 742 // invoke the io_thread() accessor. |
| 742 PluginService::GetInstance(); | 743 PluginService* plugin_service = PluginService::GetInstance(); |
| 744 plugin_service->set_filter(ChromePluginServiceFilter::GetInstance()); |
| 745 plugin_service->StartWatchingPlugins(); |
| 743 | 746 |
| 744 // Add the Chrome specific plugins. | 747 // Add the Chrome specific plugins. |
| 745 chrome::RegisterInternalDefaultPlugin(); | 748 chrome::RegisterInternalDefaultPlugin(); |
| 746 | 749 |
| 747 // Register the internal Flash if available. | 750 // Register the internal Flash if available. |
| 748 FilePath path; | 751 FilePath path; |
| 749 if (!CommandLine::ForCurrentProcess()->HasSwitch( | 752 if (!CommandLine::ForCurrentProcess()->HasSwitch( |
| 750 switches::kDisableInternalFlash) && | 753 switches::kDisableInternalFlash) && |
| 751 PathService::Get(chrome::FILE_FLASH_PLUGIN, &path)) { | 754 PathService::Get(chrome::FILE_FLASH_PLUGIN, &path)) { |
| 752 webkit::npapi::PluginList::Singleton()->AddExtraPluginPath(path); | 755 webkit::npapi::PluginList::Singleton()->AddExtraPluginPath(path); |
| (...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1096 } | 1099 } |
| 1097 | 1100 |
| 1098 void BrowserProcessImpl::OnAutoupdateTimer() { | 1101 void BrowserProcessImpl::OnAutoupdateTimer() { |
| 1099 if (CanAutorestartForUpdate()) { | 1102 if (CanAutorestartForUpdate()) { |
| 1100 DLOG(WARNING) << "Detected update. Restarting browser."; | 1103 DLOG(WARNING) << "Detected update. Restarting browser."; |
| 1101 RestartPersistentInstance(); | 1104 RestartPersistentInstance(); |
| 1102 } | 1105 } |
| 1103 } | 1106 } |
| 1104 | 1107 |
| 1105 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) | 1108 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) |
| OLD | NEW |