OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <algorithm> | 7 #include <algorithm> |
8 #include <map> | 8 #include <map> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
279 | 279 |
280 #if defined(USE_AURA) | 280 #if defined(USE_AURA) |
281 // Delete aura after the metrics service has been deleted as it accesses | 281 // Delete aura after the metrics service has been deleted as it accesses |
282 // monitor information. | 282 // monitor information. |
283 aura::Env::DeleteInstance(); | 283 aura::Env::DeleteInstance(); |
284 #endif | 284 #endif |
285 | 285 |
286 platform_part()->StartTearDown(); | 286 platform_part()->StartTearDown(); |
287 | 287 |
288 #if defined(ENABLE_WEBRTC) | 288 #if defined(ENABLE_WEBRTC) |
289 webrtc_log_uploader_.reset(); | 289 // Cancel any uploads to release the system url request context references. |
| 290 if (webrtc_log_uploader_) |
| 291 webrtc_log_uploader_->CancelURLFetcherOperations(); |
290 #endif | 292 #endif |
291 | 293 |
292 if (local_state()) | 294 if (local_state()) |
293 local_state()->CommitPendingWrite(); | 295 local_state()->CommitPendingWrite(); |
294 } | 296 } |
295 | 297 |
296 void BrowserProcessImpl::PostDestroyThreads() { | 298 void BrowserProcessImpl::PostDestroyThreads() { |
297 // With the file_thread_ flushed, we can release any icon resources. | 299 // With the file_thread_ flushed, we can release any icon resources. |
298 icon_manager_.reset(); | 300 icon_manager_.reset(); |
299 | 301 |
| 302 #if defined(ENABLE_WEBRTC) |
| 303 // Must outlive the file thread. |
| 304 webrtc_log_uploader_.reset(); |
| 305 #endif |
| 306 |
300 // Reset associated state right after actual thread is stopped, | 307 // Reset associated state right after actual thread is stopped, |
301 // as io_thread_.global_ cleanup happens in CleanUp on the IO | 308 // as io_thread_.global_ cleanup happens in CleanUp on the IO |
302 // thread, i.e. as the thread exits its message loop. | 309 // thread, i.e. as the thread exits its message loop. |
303 // | 310 // |
304 // This is important also because in various places, the | 311 // This is important also because in various places, the |
305 // IOThread object being NULL is considered synonymous with the | 312 // IOThread object being NULL is considered synonymous with the |
306 // IO thread having stopped. | 313 // IO thread having stopped. |
307 io_thread_.reset(); | 314 io_thread_.reset(); |
308 } | 315 } |
309 | 316 |
(...skipping 774 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1084 } | 1091 } |
1085 | 1092 |
1086 void BrowserProcessImpl::OnAutoupdateTimer() { | 1093 void BrowserProcessImpl::OnAutoupdateTimer() { |
1087 if (CanAutorestartForUpdate()) { | 1094 if (CanAutorestartForUpdate()) { |
1088 DLOG(WARNING) << "Detected update. Restarting browser."; | 1095 DLOG(WARNING) << "Detected update. Restarting browser."; |
1089 RestartBackgroundInstance(); | 1096 RestartBackgroundInstance(); |
1090 } | 1097 } |
1091 } | 1098 } |
1092 | 1099 |
1093 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) | 1100 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) |
OLD | NEW |