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

Unified Diff: chrome/browser/printing/print_job.cc

Issue 14113053: chrome: Use base::MessageLoop. (Part 3) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase again Created 7 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/printing/print_job.h ('k') | chrome/browser/printing/print_job_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/printing/print_job.cc
diff --git a/chrome/browser/printing/print_job.cc b/chrome/browser/printing/print_job.cc
index 6c912824a5d0a63faf5b0b1ebd682abab545c766..2e95728941880ccfc09ec9689a9decc1c785de56 100644
--- a/chrome/browser/printing/print_job.cc
+++ b/chrome/browser/printing/print_job.cc
@@ -31,7 +31,7 @@ void HoldRefCallback(const scoped_refptr<printing::PrintJobWorkerOwner>& owner,
namespace printing {
PrintJob::PrintJob()
- : ui_message_loop_(MessageLoop::current()),
+ : ui_message_loop_(base::MessageLoop::current()),
source_(NULL),
worker_(),
settings_(),
@@ -44,8 +44,8 @@ PrintJob::PrintJob()
DCHECK(ui_message_loop_);
// This is normally a UI message loop, but in unit tests, the message loop is
// of the 'default' type.
- DCHECK(ui_message_loop_->type() == MessageLoop::TYPE_UI ||
- ui_message_loop_->type() == MessageLoop::TYPE_DEFAULT);
+ DCHECK(ui_message_loop_->type() == base::MessageLoop::TYPE_UI ||
+ ui_message_loop_->type() == base::MessageLoop::TYPE_DEFAULT);
ui_message_loop_->AddDestructionObserver(this);
}
@@ -56,7 +56,7 @@ PrintJob::~PrintJob() {
DCHECK(!is_canceling_);
if (worker_.get())
DCHECK(worker_->message_loop() == NULL);
- DCHECK_EQ(ui_message_loop_, MessageLoop::current());
+ DCHECK_EQ(ui_message_loop_, base::MessageLoop::current());
}
void PrintJob::Initialize(PrintJobWorkerOwner* job,
@@ -84,7 +84,7 @@ void PrintJob::Initialize(PrintJobWorkerOwner* job,
void PrintJob::Observe(int type,
const content::NotificationSource& source,
const content::NotificationDetails& details) {
- DCHECK_EQ(ui_message_loop_, MessageLoop::current());
+ DCHECK_EQ(ui_message_loop_, base::MessageLoop::current());
switch (type) {
case chrome::NOTIFICATION_PRINT_JOB_EVENT: {
OnNotifyPrintJobEvent(*content::Details<JobEventDetails>(details).ptr());
@@ -126,7 +126,7 @@ void PrintJob::WillDestroyCurrentMessageLoop() {
}
void PrintJob::StartPrinting() {
- DCHECK_EQ(ui_message_loop_, MessageLoop::current());
+ DCHECK_EQ(ui_message_loop_, base::MessageLoop::current());
DCHECK(worker_->message_loop());
DCHECK(!is_job_pending_);
if (!worker_->message_loop() || is_job_pending_)
@@ -151,7 +151,7 @@ void PrintJob::StartPrinting() {
}
void PrintJob::Stop() {
- DCHECK_EQ(ui_message_loop_, MessageLoop::current());
+ DCHECK_EQ(ui_message_loop_, base::MessageLoop::current());
if (quit_factory_.HasWeakPtrs()) {
// In case we're running a nested message loop to wait for a job to finish,
@@ -163,7 +163,7 @@ void PrintJob::Stop() {
// Be sure to live long enough.
scoped_refptr<PrintJob> handle(this);
- MessageLoop* worker_loop = worker_->message_loop();
+ base::MessageLoop* worker_loop = worker_->message_loop();
if (worker_loop) {
ControlledWorkerShutdown();
@@ -183,8 +183,9 @@ void PrintJob::Cancel() {
// Be sure to live long enough.
scoped_refptr<PrintJob> handle(this);
- DCHECK_EQ(ui_message_loop_, MessageLoop::current());
- MessageLoop* worker_loop = worker_.get() ? worker_->message_loop() : NULL;
+ DCHECK_EQ(ui_message_loop_, base::MessageLoop::current());
+ base::MessageLoop* worker_loop =
+ worker_.get() ? worker_->message_loop() : NULL;
if (worker_loop) {
// Call this right now so it renders the context invalid. Do not use
// InvokeLater since it would take too much time.
@@ -205,11 +206,12 @@ bool PrintJob::FlushJob(base::TimeDelta timeout) {
// Make sure the object outlive this message loop.
scoped_refptr<PrintJob> handle(this);
- MessageLoop::current()->PostDelayedTask(FROM_HERE,
+ base::MessageLoop::current()->PostDelayedTask(FROM_HERE,
base::Bind(&PrintJob::Quit, quit_factory_.GetWeakPtr()), timeout);
- MessageLoop::ScopedNestableTaskAllower allow(MessageLoop::current());
- MessageLoop::current()->Run();
+ base::MessageLoop::ScopedNestableTaskAllower allow(
+ base::MessageLoop::current());
+ base::MessageLoop::current()->Run();
return true;
}
@@ -281,7 +283,7 @@ void PrintJob::OnNotifyPrintJobEvent(const JobEventDetails& event_details) {
}
case JobEventDetails::DOC_DONE: {
// This will call Stop() and broadcast a JOB_DONE message.
- MessageLoop::current()->PostTask(
+ base::MessageLoop::current()->PostTask(
FROM_HERE, base::Bind(&PrintJob::OnDocumentDone, this));
break;
}
@@ -309,7 +311,7 @@ void PrintJob::OnDocumentDone() {
}
void PrintJob::ControlledWorkerShutdown() {
- DCHECK_EQ(ui_message_loop_, MessageLoop::current());
+ DCHECK_EQ(ui_message_loop_, base::MessageLoop::current());
// The deadlock this code works around is specific to window messaging on
// Windows, so we aren't likely to need it on any other platforms.
@@ -375,7 +377,7 @@ void PrintJob::HoldUntilStopIsCalled(const scoped_refptr<PrintJob>&) {
}
void PrintJob::Quit() {
- MessageLoop::current()->Quit();
+ base::MessageLoop::current()->Quit();
}
// Takes settings_ ownership and will be deleted in the receiving thread.
« no previous file with comments | « chrome/browser/printing/print_job.h ('k') | chrome/browser/printing/print_job_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698