| 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" |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 // destructors can call the URLFetcher destructor, which does a | 129 // destructors can call the URLFetcher destructor, which does a |
| 130 // PostDelayedTask operation on the IO thread. (The IO thread will handle | 130 // PostDelayedTask operation on the IO thread. (The IO thread will handle |
| 131 // that URLFetcher operation before going away.) | 131 // that URLFetcher operation before going away.) |
| 132 metrics_service_.reset(); | 132 metrics_service_.reset(); |
| 133 google_url_tracker_.reset(); | 133 google_url_tracker_.reset(); |
| 134 intranet_redirect_detector_.reset(); | 134 intranet_redirect_detector_.reset(); |
| 135 | 135 |
| 136 // Need to clear profiles (download managers) before the io_thread_. | 136 // Need to clear profiles (download managers) before the io_thread_. |
| 137 profile_manager_.reset(); | 137 profile_manager_.reset(); |
| 138 | 138 |
| 139 // Need to clear the desktop notification balloons before the io_thread_, |
| 140 // since if there are any left showing we will post tasks. |
| 141 notification_ui_manager_.reset(); |
| 142 |
| 139 // Debugger must be cleaned up before IO thread and NotificationService. | 143 // Debugger must be cleaned up before IO thread and NotificationService. |
| 140 debugger_wrapper_ = NULL; | 144 debugger_wrapper_ = NULL; |
| 141 | 145 |
| 142 if (resource_dispatcher_host_.get()) { | 146 if (resource_dispatcher_host_.get()) { |
| 143 // Need to tell Safe Browsing Service that the IO thread is going away | 147 // Need to tell Safe Browsing Service that the IO thread is going away |
| 144 // since it cached a pointer to it. | 148 // since it cached a pointer to it. |
| 145 if (resource_dispatcher_host()->safe_browsing_service()) | 149 if (resource_dispatcher_host()->safe_browsing_service()) |
| 146 resource_dispatcher_host()->safe_browsing_service()->ShutDown(); | 150 resource_dispatcher_host()->safe_browsing_service()->ShutDown(); |
| 147 | 151 |
| 148 // Cancel pending requests and prevent new requests. | 152 // Cancel pending requests and prevent new requests. |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 resource_dispatcher_host_.reset(); | 190 resource_dispatcher_host_.reset(); |
| 187 | 191 |
| 188 // Wait for the pending print jobs to finish. | 192 // Wait for the pending print jobs to finish. |
| 189 print_job_manager_->OnQuit(); | 193 print_job_manager_->OnQuit(); |
| 190 print_job_manager_.reset(); | 194 print_job_manager_.reset(); |
| 191 | 195 |
| 192 // Destroy TabCloseableStateWatcher before NotificationService since the | 196 // Destroy TabCloseableStateWatcher before NotificationService since the |
| 193 // former registers for notifications. | 197 // former registers for notifications. |
| 194 tab_closeable_state_watcher_.reset(); | 198 tab_closeable_state_watcher_.reset(); |
| 195 | 199 |
| 196 // Destroy NotificationUIManager before NotificationService is shut down. | |
| 197 notification_ui_manager_.reset(); | |
| 198 | |
| 199 // Now OK to destroy NotificationService. | 200 // Now OK to destroy NotificationService. |
| 200 main_notification_service_.reset(); | 201 main_notification_service_.reset(); |
| 201 | 202 |
| 202 // Prior to clearing local state, we want to complete tasks pending | 203 // Prior to clearing local state, we want to complete tasks pending |
| 203 // on the db thread too. | 204 // on the db thread too. |
| 204 db_thread_.reset(); | 205 db_thread_.reset(); |
| 205 | 206 |
| 206 // At this point, no render process exist and the file, io, db, and | 207 // At this point, no render process exist and the file, io, db, and |
| 207 // webkit threads in this process have all terminated, so it's safe | 208 // webkit threads in this process have all terminated, so it's safe |
| 208 // to access local state data such as cookies, database, or local storage. | 209 // to access local state data such as cookies, database, or local storage. |
| (...skipping 556 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 765 } | 766 } |
| 766 | 767 |
| 767 void BrowserProcessImpl::OnAutoupdateTimer() { | 768 void BrowserProcessImpl::OnAutoupdateTimer() { |
| 768 if (CanAutorestartForUpdate()) { | 769 if (CanAutorestartForUpdate()) { |
| 769 DLOG(WARNING) << "Detected update. Restarting browser."; | 770 DLOG(WARNING) << "Detected update. Restarting browser."; |
| 770 RestartPersistentInstance(); | 771 RestartPersistentInstance(); |
| 771 } | 772 } |
| 772 } | 773 } |
| 773 | 774 |
| 774 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) | 775 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) |
| OLD | NEW |