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

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

Issue 141683005: Removes MessageLoop::Type checks in favor of IsCurrent on MessageLoops. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: base:: Created 6 years, 11 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/jankometer.cc ('k') | chrome/browser/printing/printer_query.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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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.h" 5 #include "chrome/browser/printing/print_job.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/threading/thread_restrictions.h" 10 #include "base/threading/thread_restrictions.h"
(...skipping 26 matching lines...) Expand all
37 settings_(), 37 settings_(),
38 is_job_pending_(false), 38 is_job_pending_(false),
39 is_canceling_(false), 39 is_canceling_(false),
40 is_stopping_(false), 40 is_stopping_(false),
41 is_stopped_(false), 41 is_stopped_(false),
42 quit_factory_(this), 42 quit_factory_(this),
43 weak_ptr_factory_(this) { 43 weak_ptr_factory_(this) {
44 DCHECK(ui_message_loop_); 44 DCHECK(ui_message_loop_);
45 // This is normally a UI message loop, but in unit tests, the message loop is 45 // This is normally a UI message loop, but in unit tests, the message loop is
46 // of the 'default' type. 46 // of the 'default' type.
47 DCHECK(ui_message_loop_->type() == base::MessageLoop::TYPE_UI || 47 DCHECK(base::MessageLoopForUI::IsCurrent() ||
48 ui_message_loop_->type() == base::MessageLoop::TYPE_DEFAULT); 48 ui_message_loop_->type() == base::MessageLoop::TYPE_DEFAULT);
49 ui_message_loop_->AddDestructionObserver(this); 49 ui_message_loop_->AddDestructionObserver(this);
50 } 50 }
51 51
52 PrintJob::~PrintJob() { 52 PrintJob::~PrintJob() {
53 ui_message_loop_->RemoveDestructionObserver(this); 53 ui_message_loop_->RemoveDestructionObserver(this);
54 // The job should be finished (or at least canceled) when it is destroyed. 54 // The job should be finished (or at least canceled) when it is destroyed.
55 DCHECK(!is_job_pending_); 55 DCHECK(!is_job_pending_);
56 DCHECK(!is_canceling_); 56 DCHECK(!is_canceling_);
57 if (worker_.get()) 57 if (worker_.get())
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after
390 } 390 }
391 391
392 JobEventDetails::~JobEventDetails() { 392 JobEventDetails::~JobEventDetails() {
393 } 393 }
394 394
395 PrintedDocument* JobEventDetails::document() const { return document_.get(); } 395 PrintedDocument* JobEventDetails::document() const { return document_.get(); }
396 396
397 PrintedPage* JobEventDetails::page() const { return page_.get(); } 397 PrintedPage* JobEventDetails::page() const { return page_.get(); }
398 398
399 } // namespace printing 399 } // namespace printing
OLDNEW
« no previous file with comments | « chrome/browser/jankometer.cc ('k') | chrome/browser/printing/printer_query.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698