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

Unified Diff: chrome/browser/browser_process_impl.cc

Issue 10383254: At browser exit, wait for pending print jobs before starting shutdown. This is to avoid a nested me… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 7 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/app_controller_mac.mm ('k') | chrome/browser/printing/print_job.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/browser_process_impl.cc
===================================================================
--- chrome/browser/browser_process_impl.cc (revision 137865)
+++ chrome/browser/browser_process_impl.cc (working copy)
@@ -156,12 +156,6 @@
}
BrowserProcessImpl::~BrowserProcessImpl() {
-#if !defined(OS_ANDROID)
- // Wait for the pending print jobs to finish.
- print_job_manager_->OnQuit();
- print_job_manager_.reset();
-#endif
-
tracked_objects::ThreadData::EnsureCleanupWasCalled(4);
g_browser_process = NULL;
@@ -281,6 +275,14 @@
if (0 == module_ref_count_) {
release_last_reference_callstack_ = base::debug::StackTrace();
+#if !defined(OS_ANDROID)
+ // Wait for the pending print jobs to finish. Don't do this later, since
+ // this might cause a nested message loop to run, and we don't want pending
+ // tasks to run once teardown has started.
+ print_job_manager_->OnQuit();
+ print_job_manager_.reset();
+#endif
+
CHECK(MessageLoop::current()->is_running());
// Allow UI and IO threads to do blocking IO on shutdown, since we do a lot
// of it on shutdown for valid reasons.
« no previous file with comments | « chrome/browser/app_controller_mac.mm ('k') | chrome/browser/printing/print_job.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698