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

Side by Side Diff: chrome/browser/printing/print_job_worker.cc

Issue 8427007: Thread::Stop() must be called before any subclass's destructor completes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Latest version as trybot-ted 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 | « chrome/browser/metrics/thread_watcher.cc ('k') | chrome/browser/ui/views/shell_dialogs_win.cc » ('j') | 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/printing/print_job_worker.h" 5 #include "chrome/browser/printing/print_job_worker.h"
6 6
7 #include "base/message_loop.h" 7 #include "base/message_loop.h"
8 #include "base/values.h" 8 #include "base/values.h"
9 #include "chrome/browser/browser_process.h" 9 #include "chrome/browser/browser_process.h"
10 #include "chrome/browser/printing/print_job.h" 10 #include "chrome/browser/printing/print_job.h"
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 61
62 printing_context_.reset(PrintingContext::Create( 62 printing_context_.reset(PrintingContext::Create(
63 g_browser_process->GetApplicationLocale())); 63 g_browser_process->GetApplicationLocale()));
64 } 64 }
65 65
66 PrintJobWorker::~PrintJobWorker() { 66 PrintJobWorker::~PrintJobWorker() {
67 // The object is normally deleted in the UI thread, but when the user 67 // The object is normally deleted in the UI thread, but when the user
68 // cancels printing or in the case of print preview, the worker is destroyed 68 // cancels printing or in the case of print preview, the worker is destroyed
69 // on the I/O thread. 69 // on the I/O thread.
70 DCHECK_EQ(owner_->message_loop(), MessageLoop::current()); 70 DCHECK_EQ(owner_->message_loop(), MessageLoop::current());
71 Stop();
71 } 72 }
72 73
73 void PrintJobWorker::SetNewOwner(PrintJobWorkerOwner* new_owner) { 74 void PrintJobWorker::SetNewOwner(PrintJobWorkerOwner* new_owner) {
74 DCHECK(page_number_ == PageNumber::npos()); 75 DCHECK(page_number_ == PageNumber::npos());
75 owner_ = new_owner; 76 owner_ = new_owner;
76 } 77 }
77 78
78 void PrintJobWorker::GetSettings(bool ask_user_for_settings, 79 void PrintJobWorker::GetSettings(bool ask_user_for_settings,
79 gfx::NativeView parent_view, 80 gfx::NativeView parent_view,
80 int document_page_count, 81 int document_page_count,
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after
359 printing::PrintJobWorker* obj) { 360 printing::PrintJobWorker* obj) {
360 DCHECK(!owner_.get()); 361 DCHECK(!owner_.get());
361 owner_ = obj->owner_; 362 owner_ = obj->owner_;
362 } 363 }
363 364
364 void RunnableMethodTraits<printing::PrintJobWorker>::ReleaseCallee( 365 void RunnableMethodTraits<printing::PrintJobWorker>::ReleaseCallee(
365 printing::PrintJobWorker* obj) { 366 printing::PrintJobWorker* obj) {
366 DCHECK_EQ(owner_, obj->owner_); 367 DCHECK_EQ(owner_, obj->owner_);
367 owner_ = NULL; 368 owner_ = NULL;
368 } 369 }
OLDNEW
« no previous file with comments | « chrome/browser/metrics/thread_watcher.cc ('k') | chrome/browser/ui/views/shell_dialogs_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698