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 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
317 did_start_ = true; | 317 did_start_ = true; |
318 module_ref_count_++; | 318 module_ref_count_++; |
319 return module_ref_count_; | 319 return module_ref_count_; |
320 } | 320 } |
321 | 321 |
322 unsigned int BrowserProcessImpl::ReleaseModule() { | 322 unsigned int BrowserProcessImpl::ReleaseModule() { |
323 DCHECK(CalledOnValidThread()); | 323 DCHECK(CalledOnValidThread()); |
324 DCHECK_NE(0u, module_ref_count_); | 324 DCHECK_NE(0u, module_ref_count_); |
325 module_ref_count_--; | 325 module_ref_count_--; |
326 if (0 == module_ref_count_) { | 326 if (0 == module_ref_count_) { |
| 327 CHECK(MessageLoop::current()->is_running()); |
327 // Allow UI and IO threads to do blocking IO on shutdown, since we do a lot | 328 // Allow UI and IO threads to do blocking IO on shutdown, since we do a lot |
328 // of it on shutdown for valid reasons. | 329 // of it on shutdown for valid reasons. |
329 base::ThreadRestrictions::SetIOAllowed(true); | 330 base::ThreadRestrictions::SetIOAllowed(true); |
330 CHECK(!BrowserList::GetLastActive()); | 331 CHECK(!BrowserList::GetLastActive()); |
331 io_thread()->message_loop()->PostTask( | 332 io_thread()->message_loop()->PostTask( |
332 FROM_HERE, | 333 FROM_HERE, |
333 NewRunnableFunction(&base::ThreadRestrictions::SetIOAllowed, true)); | 334 NewRunnableFunction(&base::ThreadRestrictions::SetIOAllowed, true)); |
334 | 335 |
335 #if defined(OS_MACOSX) | 336 #if defined(OS_MACOSX) |
336 MessageLoop::current()->PostTask( | 337 MessageLoop::current()->PostTask( |
(...skipping 819 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1156 } | 1157 } |
1157 | 1158 |
1158 void BrowserProcessImpl::OnAutoupdateTimer() { | 1159 void BrowserProcessImpl::OnAutoupdateTimer() { |
1159 if (CanAutorestartForUpdate()) { | 1160 if (CanAutorestartForUpdate()) { |
1160 DLOG(WARNING) << "Detected update. Restarting browser."; | 1161 DLOG(WARNING) << "Detected update. Restarting browser."; |
1161 RestartPersistentInstance(); | 1162 RestartPersistentInstance(); |
1162 } | 1163 } |
1163 } | 1164 } |
1164 | 1165 |
1165 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) | 1166 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) |
OLD | NEW |