| 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_helper.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 667 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 700 | 701 |
| 701 void BrowserProcessImpl::CreateIOThread() { | 702 void BrowserProcessImpl::CreateIOThread() { |
| 702 DCHECK(!created_io_thread_ && io_thread_.get() == NULL); | 703 DCHECK(!created_io_thread_ && io_thread_.get() == NULL); |
| 703 created_io_thread_ = true; | 704 created_io_thread_ = true; |
| 704 | 705 |
| 705 // Prior to starting the io thread, we create the plugin service as | 706 // Prior to starting the io thread, we create the plugin service as |
| 706 // it is predominantly used from the io thread, but must be created | 707 // it is predominantly used from the io thread, but must be created |
| 707 // on the main thread. The service ctor is inexpensive and does not | 708 // on the main thread. The service ctor is inexpensive and does not |
| 708 // invoke the io_thread() accessor. | 709 // invoke the io_thread() accessor. |
| 709 PluginService::GetInstance(); | 710 PluginService::GetInstance(); |
| 711 ChromePluginServiceHelper::GetInstance(); |
| 710 | 712 |
| 711 // Add the Chrome specific plugins. | 713 // Add the Chrome specific plugins. |
| 712 chrome::RegisterInternalDefaultPlugin(); | 714 chrome::RegisterInternalDefaultPlugin(); |
| 713 | 715 |
| 714 // Register the internal Flash if available. | 716 // Register the internal Flash if available. |
| 715 FilePath path; | 717 FilePath path; |
| 716 if (!CommandLine::ForCurrentProcess()->HasSwitch( | 718 if (!CommandLine::ForCurrentProcess()->HasSwitch( |
| 717 switches::kDisableInternalFlash) && | 719 switches::kDisableInternalFlash) && |
| 718 PathService::Get(chrome::FILE_FLASH_PLUGIN, &path)) { | 720 PathService::Get(chrome::FILE_FLASH_PLUGIN, &path)) { |
| 719 webkit::npapi::PluginList::Singleton()->AddExtraPluginPath(path); | 721 webkit::npapi::PluginList::Singleton()->AddExtraPluginPath(path); |
| (...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1090 } | 1092 } |
| 1091 | 1093 |
| 1092 void BrowserProcessImpl::OnAutoupdateTimer() { | 1094 void BrowserProcessImpl::OnAutoupdateTimer() { |
| 1093 if (CanAutorestartForUpdate()) { | 1095 if (CanAutorestartForUpdate()) { |
| 1094 DLOG(WARNING) << "Detected update. Restarting browser."; | 1096 DLOG(WARNING) << "Detected update. Restarting browser."; |
| 1095 RestartPersistentInstance(); | 1097 RestartPersistentInstance(); |
| 1096 } | 1098 } |
| 1097 } | 1099 } |
| 1098 | 1100 |
| 1099 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) | 1101 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) |
| OLD | NEW |