| Index: chrome/browser/printing/print_job.cc
|
| ===================================================================
|
| --- chrome/browser/printing/print_job.cc (revision 5751)
|
| +++ chrome/browser/printing/print_job.cc (working copy)
|
| @@ -24,6 +24,8 @@
|
| is_job_pending_(false),
|
| is_print_dialog_box_shown_(false),
|
| is_canceling_(false) {
|
| + DCHECK(ui_message_loop_);
|
| + ui_message_loop_->AddDestructionObserver(this);
|
| }
|
|
|
| PrintJob::PrintJob()
|
| @@ -34,14 +36,18 @@
|
| is_job_pending_(false),
|
| is_print_dialog_box_shown_(false),
|
| is_canceling_(false) {
|
| + DCHECK(ui_message_loop_);
|
| + ui_message_loop_->AddDestructionObserver(this);
|
| }
|
|
|
| PrintJob::~PrintJob() {
|
| + ui_message_loop_->RemoveDestructionObserver(this);
|
| // The job should be finished (or at least canceled) when it is destroyed.
|
| DCHECK(!is_job_pending_);
|
| DCHECK(!is_print_dialog_box_shown_);
|
| DCHECK(!is_canceling_);
|
| - DCHECK(worker_->message_loop() == NULL);
|
| + if (worker_.get())
|
| + DCHECK(worker_->message_loop() == NULL);
|
| DCHECK_EQ(ui_message_loop_, MessageLoop::current());
|
| }
|
|
|
| @@ -142,6 +148,10 @@
|
| return document_->cookie();
|
| }
|
|
|
| +void PrintJob::WillDestroyCurrentMessageLoop() {
|
| + NOTREACHED();
|
| +}
|
| +
|
| void PrintJob::GetSettings(GetSettingsAskParam ask_user_for_settings,
|
| HWND parent_window) {
|
| DCHECK_EQ(ui_message_loop_, MessageLoop::current());
|
|
|