| 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 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 #include "ipc/ipc_logging.h" | 67 #include "ipc/ipc_logging.h" |
| 68 #include "ui/base/clipboard/clipboard.h" | 68 #include "ui/base/clipboard/clipboard.h" |
| 69 #include "ui/base/l10n/l10n_util.h" | 69 #include "ui/base/l10n/l10n_util.h" |
| 70 #include "webkit/database/database_tracker.h" | 70 #include "webkit/database/database_tracker.h" |
| 71 | 71 |
| 72 #if defined(OS_WIN) | 72 #if defined(OS_WIN) |
| 73 #include "views/focus/view_storage.h" | 73 #include "views/focus/view_storage.h" |
| 74 #endif | 74 #endif |
| 75 | 75 |
| 76 #if defined(IPC_MESSAGE_LOG_ENABLED) | 76 #if defined(IPC_MESSAGE_LOG_ENABLED) |
| 77 #include "chrome/common/plugin_messages.h" | 77 #include "content/common/child_process_messages.h" |
| 78 #include "chrome/common/render_messages.h" | |
| 79 #endif | 78 #endif |
| 80 | 79 |
| 81 #if (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) | 80 #if (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) |
| 82 // How often to check if the persistent instance of Chrome needs to restart | 81 // How often to check if the persistent instance of Chrome needs to restart |
| 83 // to install an update. | 82 // to install an update. |
| 84 static const int kUpdateCheckIntervalHours = 6; | 83 static const int kUpdateCheckIntervalHours = 6; |
| 85 #endif | 84 #endif |
| 86 | 85 |
| 87 #if defined(USE_X11) | 86 #if defined(USE_X11) |
| 88 // How long to wait for the File thread to complete during EndSession, on | 87 // How long to wait for the File thread to complete during EndSession, on |
| (...skipping 819 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 908 (FROM_HERE, | 907 (FROM_HERE, |
| 909 NewRunnableMethod( | 908 NewRunnableMethod( |
| 910 this, | 909 this, |
| 911 &BrowserProcessImpl::SetIPCLoggingEnabledForChildProcesses, | 910 &BrowserProcessImpl::SetIPCLoggingEnabledForChildProcesses, |
| 912 enable)); | 911 enable)); |
| 913 | 912 |
| 914 // Finally, tell the renderers which don't derive from ChildProcess. | 913 // Finally, tell the renderers which don't derive from ChildProcess. |
| 915 // Messages to the renderers must be done on the UI (main) thread. | 914 // Messages to the renderers must be done on the UI (main) thread. |
| 916 for (RenderProcessHost::iterator i(RenderProcessHost::AllHostsIterator()); | 915 for (RenderProcessHost::iterator i(RenderProcessHost::AllHostsIterator()); |
| 917 !i.IsAtEnd(); i.Advance()) | 916 !i.IsAtEnd(); i.Advance()) |
| 918 i.GetCurrentValue()->Send(new ViewMsg_SetIPCLoggingEnabled(enable)); | 917 i.GetCurrentValue()->Send(new ChildProcessMsg_SetIPCLoggingEnabled(enable)); |
| 919 } | 918 } |
| 920 | 919 |
| 921 // Helper for SetIPCLoggingEnabled. | 920 // Helper for SetIPCLoggingEnabled. |
| 922 void BrowserProcessImpl::SetIPCLoggingEnabledForChildProcesses(bool enabled) { | 921 void BrowserProcessImpl::SetIPCLoggingEnabledForChildProcesses(bool enabled) { |
| 923 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 922 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 924 | 923 |
| 925 BrowserChildProcessHost::Iterator i; // default constr references a singleton | 924 BrowserChildProcessHost::Iterator i; // default constr references a singleton |
| 926 while (!i.Done()) { | 925 while (!i.Done()) { |
| 927 i->Send(new PluginProcessMsg_SetIPCLoggingEnabled(enabled)); | 926 i->Send(new ChildProcessMsg_SetIPCLoggingEnabled(enabled)); |
| 928 ++i; | 927 ++i; |
| 929 } | 928 } |
| 930 } | 929 } |
| 931 | 930 |
| 932 #endif // IPC_MESSAGE_LOG_ENABLED | 931 #endif // IPC_MESSAGE_LOG_ENABLED |
| 933 | 932 |
| 934 void BrowserProcessImpl::DoInspectorFilesCheck() { | 933 void BrowserProcessImpl::DoInspectorFilesCheck() { |
| 935 // Runs on FILE thread. | 934 // Runs on FILE thread. |
| 936 DCHECK(file_thread_->message_loop() == MessageLoop::current()); | 935 DCHECK(file_thread_->message_loop() == MessageLoop::current()); |
| 937 bool result = false; | 936 bool result = false; |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 994 } | 993 } |
| 995 | 994 |
| 996 void BrowserProcessImpl::OnAutoupdateTimer() { | 995 void BrowserProcessImpl::OnAutoupdateTimer() { |
| 997 if (CanAutorestartForUpdate()) { | 996 if (CanAutorestartForUpdate()) { |
| 998 DLOG(WARNING) << "Detected update. Restarting browser."; | 997 DLOG(WARNING) << "Detected update. Restarting browser."; |
| 999 RestartPersistentInstance(); | 998 RestartPersistentInstance(); |
| 1000 } | 999 } |
| 1001 } | 1000 } |
| 1002 | 1001 |
| 1003 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) | 1002 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) |
| OLD | NEW |