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

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

Issue 8343033: Add CHECK to catch places where BrowserProcessImpl's refcount goes to 0. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 1 month 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 | « base/message_loop.cc ('k') | no next file » | 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 #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
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
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)
OLDNEW
« no previous file with comments | « base/message_loop.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698