| 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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 #include "content/browser/browser_process_sub_thread.h" | 72 #include "content/browser/browser_process_sub_thread.h" |
| 73 #include "content/browser/child_process_security_policy.h" | 73 #include "content/browser/child_process_security_policy.h" |
| 74 #include "content/browser/debugger/devtools_manager.h" | 74 #include "content/browser/debugger/devtools_manager.h" |
| 75 #include "content/browser/download/download_file_manager.h" | 75 #include "content/browser/download/download_file_manager.h" |
| 76 #include "content/browser/download/download_status_updater.h" | 76 #include "content/browser/download/download_status_updater.h" |
| 77 #include "content/browser/download/mhtml_generation_manager.h" | 77 #include "content/browser/download/mhtml_generation_manager.h" |
| 78 #include "content/browser/download/save_file_manager.h" | 78 #include "content/browser/download/save_file_manager.h" |
| 79 #include "content/browser/gpu/gpu_process_host_ui_shim.h" | 79 #include "content/browser/gpu/gpu_process_host_ui_shim.h" |
| 80 #include "content/browser/net/browser_online_state_observer.h" | 80 #include "content/browser/net/browser_online_state_observer.h" |
| 81 #include "content/browser/plugin_service.h" | 81 #include "content/browser/plugin_service.h" |
| 82 #include "content/browser/renderer_host/render_process_host.h" | |
| 83 #include "content/browser/renderer_host/resource_dispatcher_host.h" | 82 #include "content/browser/renderer_host/resource_dispatcher_host.h" |
| 84 #include "content/public/browser/browser_thread.h" | 83 #include "content/public/browser/browser_thread.h" |
| 85 #include "content/public/browser/notification_details.h" | 84 #include "content/public/browser/notification_details.h" |
| 85 #include "content/public/browser/render_process_host.h" |
| 86 #include "content/public/common/url_fetcher.h" | 86 #include "content/public/common/url_fetcher.h" |
| 87 #include "ipc/ipc_logging.h" | 87 #include "ipc/ipc_logging.h" |
| 88 #include "net/socket/client_socket_pool_manager.h" | 88 #include "net/socket/client_socket_pool_manager.h" |
| 89 #include "net/url_request/url_request_context_getter.h" | 89 #include "net/url_request/url_request_context_getter.h" |
| 90 #include "ui/base/clipboard/clipboard.h" | 90 #include "ui/base/clipboard/clipboard.h" |
| 91 #include "ui/base/l10n/l10n_util.h" | 91 #include "ui/base/l10n/l10n_util.h" |
| 92 | 92 |
| 93 #if defined(OS_WIN) | 93 #if defined(OS_WIN) |
| 94 #include "views/focus/view_storage.h" | 94 #include "views/focus/view_storage.h" |
| 95 #elif defined(OS_MACOSX) | 95 #elif defined(OS_MACOSX) |
| (...skipping 979 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1075 // processes must be done on the IO thread. | 1075 // processes must be done on the IO thread. |
| 1076 io_thread()->message_loop()->PostTask | 1076 io_thread()->message_loop()->PostTask |
| 1077 (FROM_HERE, | 1077 (FROM_HERE, |
| 1078 NewRunnableMethod( | 1078 NewRunnableMethod( |
| 1079 this, | 1079 this, |
| 1080 &BrowserProcessImpl::SetIPCLoggingEnabledForChildProcesses, | 1080 &BrowserProcessImpl::SetIPCLoggingEnabledForChildProcesses, |
| 1081 enable)); | 1081 enable)); |
| 1082 | 1082 |
| 1083 // Finally, tell the renderers which don't derive from ChildProcess. | 1083 // Finally, tell the renderers which don't derive from ChildProcess. |
| 1084 // Messages to the renderers must be done on the UI (main) thread. | 1084 // Messages to the renderers must be done on the UI (main) thread. |
| 1085 for (RenderProcessHost::iterator i(RenderProcessHost::AllHostsIterator()); | 1085 for (content::RenderProcessHost::iterator i( |
| 1086 content::RenderProcessHost::AllHostsIterator()); |
| 1086 !i.IsAtEnd(); i.Advance()) | 1087 !i.IsAtEnd(); i.Advance()) |
| 1087 i.GetCurrentValue()->Send(new ChildProcessMsg_SetIPCLoggingEnabled(enable)); | 1088 i.GetCurrentValue()->Send(new ChildProcessMsg_SetIPCLoggingEnabled(enable)); |
| 1088 } | 1089 } |
| 1089 | 1090 |
| 1090 // Helper for SetIPCLoggingEnabled. | 1091 // Helper for SetIPCLoggingEnabled. |
| 1091 void BrowserProcessImpl::SetIPCLoggingEnabledForChildProcesses(bool enabled) { | 1092 void BrowserProcessImpl::SetIPCLoggingEnabledForChildProcesses(bool enabled) { |
| 1092 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 1093 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 1093 | 1094 |
| 1094 BrowserChildProcessHost::Iterator i; // default constr references a singleton | 1095 BrowserChildProcessHost::Iterator i; // default constr references a singleton |
| 1095 while (!i.Done()) { | 1096 while (!i.Done()) { |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1150 } | 1151 } |
| 1151 | 1152 |
| 1152 void BrowserProcessImpl::OnAutoupdateTimer() { | 1153 void BrowserProcessImpl::OnAutoupdateTimer() { |
| 1153 if (CanAutorestartForUpdate()) { | 1154 if (CanAutorestartForUpdate()) { |
| 1154 DLOG(WARNING) << "Detected update. Restarting browser."; | 1155 DLOG(WARNING) << "Detected update. Restarting browser."; |
| 1155 RestartBackgroundInstance(); | 1156 RestartBackgroundInstance(); |
| 1156 } | 1157 } |
| 1157 } | 1158 } |
| 1158 | 1159 |
| 1159 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) | 1160 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) |
| OLD | NEW |