| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 | 8 |
| 9 #include "app/clipboard/clipboard.h" | 9 #include "app/clipboard/clipboard.h" |
| 10 #include "app/l10n_util.h" | 10 #include "app/l10n_util.h" |
| 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/thread.h" | 14 #include "base/thread.h" |
| 15 #include "base/waitable_event.h" | 15 #include "base/waitable_event.h" |
| 16 #include "chrome/browser/appcache/chrome_appcache_service.h" | 16 #include "chrome/browser/appcache/chrome_appcache_service.h" |
| 17 #include "chrome/browser/browser_child_process_host.h" |
| 17 #include "chrome/browser/browser_list.h" | 18 #include "chrome/browser/browser_list.h" |
| 18 #include "chrome/browser/browser_main.h" | 19 #include "chrome/browser/browser_main.h" |
| 19 #include "chrome/browser/browser_process_sub_thread.h" | 20 #include "chrome/browser/browser_process_sub_thread.h" |
| 20 #include "chrome/browser/browser_trial.h" | 21 #include "chrome/browser/browser_trial.h" |
| 21 #include "chrome/browser/child_process_host.h" | |
| 22 #include "chrome/browser/chrome_thread.h" | 22 #include "chrome/browser/chrome_thread.h" |
| 23 #include "chrome/browser/debugger/debugger_wrapper.h" | 23 #include "chrome/browser/debugger/debugger_wrapper.h" |
| 24 #include "chrome/browser/debugger/devtools_manager.h" | 24 #include "chrome/browser/debugger/devtools_manager.h" |
| 25 #include "chrome/browser/download/download_file.h" | 25 #include "chrome/browser/download/download_file.h" |
| 26 #include "chrome/browser/download/save_file_manager.h" | 26 #include "chrome/browser/download/save_file_manager.h" |
| 27 #include "chrome/browser/first_run.h" | 27 #include "chrome/browser/first_run.h" |
| 28 #include "chrome/browser/google_url_tracker.h" | 28 #include "chrome/browser/google_url_tracker.h" |
| 29 #include "chrome/browser/icon_manager.h" | 29 #include "chrome/browser/icon_manager.h" |
| 30 #include "chrome/browser/in_process_webkit/dom_storage_context.h" | 30 #include "chrome/browser/in_process_webkit/dom_storage_context.h" |
| 31 #include "chrome/browser/intranet_redirect_detector.h" | 31 #include "chrome/browser/intranet_redirect_detector.h" |
| (...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 502 // Messages to the renderers must be done on the UI (main) thread. | 502 // Messages to the renderers must be done on the UI (main) thread. |
| 503 for (RenderProcessHost::iterator i(RenderProcessHost::AllHostsIterator()); | 503 for (RenderProcessHost::iterator i(RenderProcessHost::AllHostsIterator()); |
| 504 !i.IsAtEnd(); i.Advance()) | 504 !i.IsAtEnd(); i.Advance()) |
| 505 i.GetCurrentValue()->Send(new ViewMsg_SetIPCLoggingEnabled(enable)); | 505 i.GetCurrentValue()->Send(new ViewMsg_SetIPCLoggingEnabled(enable)); |
| 506 } | 506 } |
| 507 | 507 |
| 508 // Helper for SetIPCLoggingEnabled. | 508 // Helper for SetIPCLoggingEnabled. |
| 509 void BrowserProcessImpl::SetIPCLoggingEnabledForChildProcesses(bool enabled) { | 509 void BrowserProcessImpl::SetIPCLoggingEnabledForChildProcesses(bool enabled) { |
| 510 DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO)); | 510 DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO)); |
| 511 | 511 |
| 512 ChildProcessHost::Iterator i; // default constr references a singleton | 512 BrowserChildProcessHost::Iterator i; // default constr references a singleton |
| 513 while (!i.Done()) { | 513 while (!i.Done()) { |
| 514 i->Send(new PluginProcessMsg_SetIPCLoggingEnabled(enabled)); | 514 i->Send(new PluginProcessMsg_SetIPCLoggingEnabled(enabled)); |
| 515 ++i; | 515 ++i; |
| 516 } | 516 } |
| 517 } | 517 } |
| 518 | 518 |
| 519 #endif // IPC_MESSAGE_LOG_ENABLED | 519 #endif // IPC_MESSAGE_LOG_ENABLED |
| 520 | 520 |
| 521 void BrowserProcessImpl::DoInspectorFilesCheck() { | 521 void BrowserProcessImpl::DoInspectorFilesCheck() { |
| 522 // Runs on FILE thread. | 522 // Runs on FILE thread. |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 587 } | 587 } |
| 588 | 588 |
| 589 void BrowserProcessImpl::OnAutoupdateTimer() { | 589 void BrowserProcessImpl::OnAutoupdateTimer() { |
| 590 if (CanAutorestartForUpdate()) { | 590 if (CanAutorestartForUpdate()) { |
| 591 DLOG(WARNING) << "Detected update. Restarting browser."; | 591 DLOG(WARNING) << "Detected update. Restarting browser."; |
| 592 RestartPersistentInstance(); | 592 RestartPersistentInstance(); |
| 593 } | 593 } |
| 594 } | 594 } |
| 595 | 595 |
| 596 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) | 596 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) |
| OLD | NEW |