| 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 |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 #include "chrome/common/url_constants.h" | 68 #include "chrome/common/url_constants.h" |
| 69 #include "chrome/installer/util/google_update_constants.h" | 69 #include "chrome/installer/util/google_update_constants.h" |
| 70 #include "content/browser/browser_child_process_host.h" | 70 #include "content/browser/browser_child_process_host.h" |
| 71 #include "content/browser/child_process_security_policy.h" | 71 #include "content/browser/child_process_security_policy.h" |
| 72 #include "content/browser/download/download_file_manager.h" | 72 #include "content/browser/download/download_file_manager.h" |
| 73 #include "content/browser/download/download_status_updater.h" | 73 #include "content/browser/download/download_status_updater.h" |
| 74 #include "content/browser/download/mhtml_generation_manager.h" | 74 #include "content/browser/download/mhtml_generation_manager.h" |
| 75 #include "content/browser/download/save_file_manager.h" | 75 #include "content/browser/download/save_file_manager.h" |
| 76 #include "content/browser/gpu/gpu_process_host_ui_shim.h" | 76 #include "content/browser/gpu/gpu_process_host_ui_shim.h" |
| 77 #include "content/browser/net/browser_online_state_observer.h" | 77 #include "content/browser/net/browser_online_state_observer.h" |
| 78 #include "content/browser/plugin_service.h" | |
| 79 #include "content/browser/renderer_host/resource_dispatcher_host.h" | 78 #include "content/browser/renderer_host/resource_dispatcher_host.h" |
| 80 #include "content/public/browser/browser_thread.h" | 79 #include "content/public/browser/browser_thread.h" |
| 81 #include "content/public/browser/notification_details.h" | 80 #include "content/public/browser/notification_details.h" |
| 81 #include "content/public/browser/plugin_service.h" |
| 82 #include "content/public/browser/render_process_host.h" | 82 #include "content/public/browser/render_process_host.h" |
| 83 #include "content/public/common/url_fetcher.h" | 83 #include "content/public/common/url_fetcher.h" |
| 84 #include "media/audio/audio_manager.h" | 84 #include "media/audio/audio_manager.h" |
| 85 #include "net/socket/client_socket_pool_manager.h" | 85 #include "net/socket/client_socket_pool_manager.h" |
| 86 #include "net/url_request/url_request_context_getter.h" | 86 #include "net/url_request/url_request_context_getter.h" |
| 87 #include "ui/base/clipboard/clipboard.h" | 87 #include "ui/base/clipboard/clipboard.h" |
| 88 #include "ui/base/l10n/l10n_util.h" | 88 #include "ui/base/l10n/l10n_util.h" |
| 89 | 89 |
| 90 #if defined(OS_WIN) | 90 #if defined(OS_WIN) |
| 91 #include "ui/views/focus/view_storage.h" | 91 #include "ui/views/focus/view_storage.h" |
| (...skipping 21 matching lines...) Expand all Loading... |
| 113 #endif | 113 #endif |
| 114 | 114 |
| 115 #if defined(USE_X11) | 115 #if defined(USE_X11) |
| 116 // How long to wait for the File thread to complete during EndSession, on | 116 // How long to wait for the File thread to complete during EndSession, on |
| 117 // Linux. We have a timeout here because we're unable to run the UI messageloop | 117 // Linux. We have a timeout here because we're unable to run the UI messageloop |
| 118 // and there's some deadlock risk. Our only option is to exit anyway. | 118 // and there's some deadlock risk. Our only option is to exit anyway. |
| 119 static const int kEndSessionTimeoutSeconds = 10; | 119 static const int kEndSessionTimeoutSeconds = 10; |
| 120 #endif | 120 #endif |
| 121 | 121 |
| 122 using content::BrowserThread; | 122 using content::BrowserThread; |
| 123 using content::PluginService; |
| 123 | 124 |
| 124 BrowserProcessImpl::BrowserProcessImpl(const CommandLine& command_line) | 125 BrowserProcessImpl::BrowserProcessImpl(const CommandLine& command_line) |
| 125 : created_resource_dispatcher_host_(false), | 126 : created_resource_dispatcher_host_(false), |
| 126 created_metrics_service_(false), | 127 created_metrics_service_(false), |
| 127 created_watchdog_thread_(false), | 128 created_watchdog_thread_(false), |
| 128 created_profile_manager_(false), | 129 created_profile_manager_(false), |
| 129 created_local_state_(false), | 130 created_local_state_(false), |
| 130 created_icon_manager_(false), | 131 created_icon_manager_(false), |
| 131 created_sidebar_manager_(false), | 132 created_sidebar_manager_(false), |
| 132 created_browser_policy_connector_(false), | 133 created_browser_policy_connector_(false), |
| (...skipping 609 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 742 metrics_service_.reset(new MetricsService); | 743 metrics_service_.reset(new MetricsService); |
| 743 } | 744 } |
| 744 | 745 |
| 745 void BrowserProcessImpl::CreateIOThreadState() { | 746 void BrowserProcessImpl::CreateIOThreadState() { |
| 746 // Prior to any processing happening on the io thread, we create the | 747 // Prior to any processing happening on the io thread, we create the |
| 747 // plugin service as it is predominantly used from the io thread, | 748 // plugin service as it is predominantly used from the io thread, |
| 748 // but must be created on the main thread. The service ctor is | 749 // but must be created on the main thread. The service ctor is |
| 749 // inexpensive and does not invoke the io_thread() accessor. | 750 // inexpensive and does not invoke the io_thread() accessor. |
| 750 PluginService* plugin_service = PluginService::GetInstance(); | 751 PluginService* plugin_service = PluginService::GetInstance(); |
| 751 plugin_service->Init(); | 752 plugin_service->Init(); |
| 752 plugin_service->set_filter(ChromePluginServiceFilter::GetInstance()); | 753 plugin_service->SetFilter(ChromePluginServiceFilter::GetInstance()); |
| 753 plugin_service->StartWatchingPlugins(); | 754 plugin_service->StartWatchingPlugins(); |
| 754 | 755 |
| 755 // Register the internal Flash if available. | 756 // Register the internal Flash if available. |
| 756 FilePath path; | 757 FilePath path; |
| 757 if (!CommandLine::ForCurrentProcess()->HasSwitch( | 758 if (!CommandLine::ForCurrentProcess()->HasSwitch( |
| 758 switches::kDisableInternalFlash) && | 759 switches::kDisableInternalFlash) && |
| 759 PathService::Get(chrome::FILE_FLASH_PLUGIN, &path)) { | 760 PathService::Get(chrome::FILE_FLASH_PLUGIN, &path)) { |
| 760 plugin_service->AddExtraPluginPath(path); | 761 plugin_service->AddExtraPluginPath(path); |
| 761 } | 762 } |
| 762 | 763 |
| (...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 989 } | 990 } |
| 990 | 991 |
| 991 void BrowserProcessImpl::OnAutoupdateTimer() { | 992 void BrowserProcessImpl::OnAutoupdateTimer() { |
| 992 if (CanAutorestartForUpdate()) { | 993 if (CanAutorestartForUpdate()) { |
| 993 DLOG(WARNING) << "Detected update. Restarting browser."; | 994 DLOG(WARNING) << "Detected update. Restarting browser."; |
| 994 RestartBackgroundInstance(); | 995 RestartBackgroundInstance(); |
| 995 } | 996 } |
| 996 } | 997 } |
| 997 | 998 |
| 998 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) | 999 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) |
| OLD | NEW |