Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(623)

Side by Side Diff: chrome/browser/browser_process_impl.cc

Issue 6835022: Broke ARM compile. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/browser_main_win.cc ('k') | chrome/browser/browser_shutdown.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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"
11 #include "base/path_service.h" 11 #include "base/path_service.h"
12 #include "base/synchronization/waitable_event.h" 12 #include "base/synchronization/waitable_event.h"
13 #include "base/task.h" 13 #include "base/task.h"
14 #include "base/threading/thread.h" 14 #include "base/threading/thread.h"
15 #include "base/threading/thread_restrictions.h" 15 #include "base/threading/thread_restrictions.h"
16 #include "chrome/browser/automation/automation_provider_list.h" 16 #include "chrome/browser/automation/automation_provider_list.h"
17 #include "chrome/browser/browser_main.h" 17 #include "chrome/browser/browser_main.h"
18 #include "chrome/browser/browser_process_sub_thread.h" 18 #include "chrome/browser/browser_process_sub_thread.h"
19 #include "chrome/browser/browser_trial.h" 19 #include "chrome/browser/browser_trial.h"
20 #include "chrome/browser/debugger/browser_list_tabcontents_provider.h" 20 #include "chrome/browser/debugger/browser_list_tabcontents_provider.h"
21 #include "chrome/browser/debugger/devtools_http_protocol_handler.h" 21 #include "chrome/browser/debugger/devtools_http_protocol_handler.h"
22 #include "chrome/browser/debugger/devtools_manager.h" 22 #include "chrome/browser/debugger/devtools_manager.h"
23 #include "chrome/browser/debugger/devtools_protocol_handler.h" 23 #include "chrome/browser/debugger/devtools_protocol_handler.h"
24 #include "chrome/browser/download/download_file_manager.h" 24 #include "chrome/browser/download/download_file_manager.h"
25 #include "chrome/browser/download/save_file_manager.h" 25 #include "chrome/browser/download/save_file_manager.h"
26 #include "chrome/browser/extensions/extension_event_router_forwarder.h" 26 #include "chrome/browser/extensions/extension_event_router_forwarder.h"
27 #include "chrome/browser/extensions/extension_tab_id_map.h" 27 #include "chrome/browser/extensions/extension_tab_id_map.h"
28 #include "chrome/browser/extensions/user_script_listener.h" 28 #include "chrome/browser/extensions/user_script_listener.h"
29 #include "chrome/browser/first_run/upgrade_util.h" 29 #include "chrome/browser/first_run/upgrade.h"
30 #include "chrome/browser/google/google_url_tracker.h" 30 #include "chrome/browser/google/google_url_tracker.h"
31 #include "chrome/browser/gpu_process_host_ui_shim.h" 31 #include "chrome/browser/gpu_process_host_ui_shim.h"
32 #include "chrome/browser/icon_manager.h" 32 #include "chrome/browser/icon_manager.h"
33 #include "chrome/browser/intranet_redirect_detector.h" 33 #include "chrome/browser/intranet_redirect_detector.h"
34 #include "chrome/browser/io_thread.h" 34 #include "chrome/browser/io_thread.h"
35 #include "chrome/browser/metrics/metrics_service.h" 35 #include "chrome/browser/metrics/metrics_service.h"
36 #include "chrome/browser/metrics/thread_watcher.h" 36 #include "chrome/browser/metrics/thread_watcher.h"
37 #include "chrome/browser/net/chrome_net_log.h" 37 #include "chrome/browser/net/chrome_net_log.h"
38 #include "chrome/browser/net/predictor_api.h" 38 #include "chrome/browser/net/predictor_api.h"
39 #include "chrome/browser/net/sdch_dictionary_fetcher.h" 39 #include "chrome/browser/net/sdch_dictionary_fetcher.h"
(...skipping 953 matching lines...) Expand 10 before | Expand all | Expand 10 after
993 993
994 #endif // IPC_MESSAGE_LOG_ENABLED 994 #endif // IPC_MESSAGE_LOG_ENABLED
995 995
996 // Mac is currently not supported. 996 // Mac is currently not supported.
997 #if (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) 997 #if (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS)
998 998
999 bool BrowserProcessImpl::CanAutorestartForUpdate() const { 999 bool BrowserProcessImpl::CanAutorestartForUpdate() const {
1000 // Check if browser is in the background and if it needs to be restarted to 1000 // Check if browser is in the background and if it needs to be restarted to
1001 // apply a pending update. 1001 // apply a pending update.
1002 return BrowserList::size() == 0 && BrowserList::WillKeepAlive() && 1002 return BrowserList::size() == 0 && BrowserList::WillKeepAlive() &&
1003 upgrade_util::IsUpdatePendingRestart(); 1003 Upgrade::IsUpdatePendingRestart();
1004 } 1004 }
1005 1005
1006 // Switches to add when auto-restarting Chrome. 1006 // Switches to add when auto-restarting Chrome.
1007 const char* const kSwitchesToAddOnAutorestart[] = { 1007 const char* const kSwitchesToAddOnAutorestart[] = {
1008 switches::kNoStartupWindow 1008 switches::kNoStartupWindow
1009 }; 1009 };
1010 1010
1011 void BrowserProcessImpl::RestartPersistentInstance() { 1011 void BrowserProcessImpl::RestartPersistentInstance() {
1012 CommandLine* old_cl = CommandLine::ForCurrentProcess(); 1012 CommandLine* old_cl = CommandLine::ForCurrentProcess();
1013 scoped_ptr<CommandLine> new_cl(new CommandLine(old_cl->GetProgram())); 1013 scoped_ptr<CommandLine> new_cl(new CommandLine(old_cl->GetProgram()));
(...skipping 18 matching lines...) Expand all
1032 // Ensure that our desired switches are set on the new process. 1032 // Ensure that our desired switches are set on the new process.
1033 for (size_t i = 0; i < arraysize(kSwitchesToAddOnAutorestart); ++i) { 1033 for (size_t i = 0; i < arraysize(kSwitchesToAddOnAutorestart); ++i) {
1034 if (!new_cl->HasSwitch(kSwitchesToAddOnAutorestart[i])) 1034 if (!new_cl->HasSwitch(kSwitchesToAddOnAutorestart[i]))
1035 new_cl->AppendSwitch(kSwitchesToAddOnAutorestart[i]); 1035 new_cl->AppendSwitch(kSwitchesToAddOnAutorestart[i]);
1036 } 1036 }
1037 1037
1038 DLOG(WARNING) << "Shutting down current instance of the browser."; 1038 DLOG(WARNING) << "Shutting down current instance of the browser.";
1039 BrowserList::CloseAllBrowsersAndExit(); 1039 BrowserList::CloseAllBrowsersAndExit();
1040 1040
1041 // Transfer ownership to Upgrade. 1041 // Transfer ownership to Upgrade.
1042 upgrade_util::SetNewCommandLine(new_cl.release()); 1042 Upgrade::SetNewCommandLine(new_cl.release());
1043 } 1043 }
1044 1044
1045 void BrowserProcessImpl::OnAutoupdateTimer() { 1045 void BrowserProcessImpl::OnAutoupdateTimer() {
1046 if (CanAutorestartForUpdate()) { 1046 if (CanAutorestartForUpdate()) {
1047 DLOG(WARNING) << "Detected update. Restarting browser."; 1047 DLOG(WARNING) << "Detected update. Restarting browser.";
1048 RestartPersistentInstance(); 1048 RestartPersistentInstance();
1049 } 1049 }
1050 } 1050 }
1051 1051
1052 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) 1052 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS)
OLDNEW
« no previous file with comments | « chrome/browser/browser_main_win.cc ('k') | chrome/browser/browser_shutdown.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698