| 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 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 static bool g_end_session_file_thread_has_completed = false; | 122 static bool g_end_session_file_thread_has_completed = false; |
| 123 #endif | 123 #endif |
| 124 | 124 |
| 125 #if defined(USE_X11) | 125 #if defined(USE_X11) |
| 126 // How long to wait for the File thread to complete during EndSession, on | 126 // How long to wait for the File thread to complete during EndSession, on |
| 127 // Linux. We have a timeout here because we're unable to run the UI messageloop | 127 // Linux. We have a timeout here because we're unable to run the UI messageloop |
| 128 // and there's some deadlock risk. Our only option is to exit anyway. | 128 // and there's some deadlock risk. Our only option is to exit anyway. |
| 129 static const int kEndSessionTimeoutSeconds = 10; | 129 static const int kEndSessionTimeoutSeconds = 10; |
| 130 #endif | 130 #endif |
| 131 | 131 |
| 132 using content::BrowserThread; |
| 133 |
| 132 BrowserProcessImpl::BrowserProcessImpl(const CommandLine& command_line) | 134 BrowserProcessImpl::BrowserProcessImpl(const CommandLine& command_line) |
| 133 : created_resource_dispatcher_host_(false), | 135 : created_resource_dispatcher_host_(false), |
| 134 created_metrics_service_(false), | 136 created_metrics_service_(false), |
| 135 created_io_thread_(false), | 137 created_io_thread_(false), |
| 136 created_file_thread_(false), | 138 created_file_thread_(false), |
| 137 created_db_thread_(false), | 139 created_db_thread_(false), |
| 138 created_process_launcher_thread_(false), | 140 created_process_launcher_thread_(false), |
| 139 created_cache_thread_(false), | 141 created_cache_thread_(false), |
| 140 created_watchdog_thread_(false), | 142 created_watchdog_thread_(false), |
| 141 #if defined(OS_CHROMEOS) | 143 #if defined(OS_CHROMEOS) |
| (...skipping 744 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 886 if (!thread->Start()) | 888 if (!thread->Start()) |
| 887 return; | 889 return; |
| 888 process_launcher_thread_.swap(thread); | 890 process_launcher_thread_.swap(thread); |
| 889 } | 891 } |
| 890 | 892 |
| 891 void BrowserProcessImpl::CreateCacheThread() { | 893 void BrowserProcessImpl::CreateCacheThread() { |
| 892 DCHECK(!created_cache_thread_ && !cache_thread_.get()); | 894 DCHECK(!created_cache_thread_ && !cache_thread_.get()); |
| 893 created_cache_thread_ = true; | 895 created_cache_thread_ = true; |
| 894 | 896 |
| 895 scoped_ptr<base::Thread> thread( | 897 scoped_ptr<base::Thread> thread( |
| 896 new DeprecatedBrowserThread(BrowserThread::CACHE)); | 898 new content::DeprecatedBrowserThread(BrowserThread::CACHE)); |
| 897 base::Thread::Options options; | 899 base::Thread::Options options; |
| 898 options.message_loop_type = MessageLoop::TYPE_IO; | 900 options.message_loop_type = MessageLoop::TYPE_IO; |
| 899 if (!thread->StartWithOptions(options)) | 901 if (!thread->StartWithOptions(options)) |
| 900 return; | 902 return; |
| 901 cache_thread_.swap(thread); | 903 cache_thread_.swap(thread); |
| 902 } | 904 } |
| 903 | 905 |
| 904 void BrowserProcessImpl::CreateWatchdogThread() { | 906 void BrowserProcessImpl::CreateWatchdogThread() { |
| 905 DCHECK(!created_watchdog_thread_ && watchdog_thread_.get() == NULL); | 907 DCHECK(!created_watchdog_thread_ && watchdog_thread_.get() == NULL); |
| 906 created_watchdog_thread_ = true; | 908 created_watchdog_thread_ = true; |
| (...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1156 } | 1158 } |
| 1157 | 1159 |
| 1158 void BrowserProcessImpl::OnAutoupdateTimer() { | 1160 void BrowserProcessImpl::OnAutoupdateTimer() { |
| 1159 if (CanAutorestartForUpdate()) { | 1161 if (CanAutorestartForUpdate()) { |
| 1160 DLOG(WARNING) << "Detected update. Restarting browser."; | 1162 DLOG(WARNING) << "Detected update. Restarting browser."; |
| 1161 RestartBackgroundInstance(); | 1163 RestartBackgroundInstance(); |
| 1162 } | 1164 } |
| 1163 } | 1165 } |
| 1164 | 1166 |
| 1165 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) | 1167 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) |
| OLD | NEW |