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

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

Issue 2033753002: Remove use of deprecated MessageLoop methods in chrome/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: manual change Created 4 years, 6 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
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 <memory> 7 #include <memory>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after
410 // thread is not processing messages, a deadlock occurs. 410 // thread is not processing messages, a deadlock occurs.
411 // 411 //
412 // This function ensures that the dialog box will be destroyed in a timely 412 // This function ensures that the dialog box will be destroyed in a timely
413 // manner by the mere fact that the thread will terminate. So the potential 413 // manner by the mere fact that the thread will terminate. So the potential
414 // deadlock is eliminated. 414 // deadlock is eliminated.
415 worker_->StopSoon(); 415 worker_->StopSoon();
416 416
417 // Delay shutdown until the worker terminates. We want this code path 417 // Delay shutdown until the worker terminates. We want this code path
418 // to wait on the thread to quit before continuing. 418 // to wait on the thread to quit before continuing.
419 if (worker_->IsRunning()) { 419 if (worker_->IsRunning()) {
420 base::MessageLoop::current()->PostDelayedTask( 420 base::ThreadTaskRunnerHandle::Get()->PostDelayedTask(
421 FROM_HERE, 421 FROM_HERE, base::Bind(&PrintJob::ControlledWorkerShutdown, this),
422 base::Bind(&PrintJob::ControlledWorkerShutdown, this),
423 base::TimeDelta::FromMilliseconds(100)); 422 base::TimeDelta::FromMilliseconds(100));
424 return; 423 return;
425 } 424 }
426 #endif 425 #endif
427 426
428 427
429 // Now make sure the thread object is cleaned up. Do this on a worker 428 // Now make sure the thread object is cleaned up. Do this on a worker
430 // thread because it may block. 429 // thread because it may block.
431 base::WorkerPool::PostTaskAndReply( 430 base::WorkerPool::PostTaskAndReply(
432 FROM_HERE, 431 FROM_HERE,
(...skipping 23 matching lines...) Expand all
456 } 455 }
457 456
458 JobEventDetails::~JobEventDetails() { 457 JobEventDetails::~JobEventDetails() {
459 } 458 }
460 459
461 PrintedDocument* JobEventDetails::document() const { return document_.get(); } 460 PrintedDocument* JobEventDetails::document() const { return document_.get(); }
462 461
463 PrintedPage* JobEventDetails::page() const { return page_.get(); } 462 PrintedPage* JobEventDetails::page() const { return page_.get(); }
464 463
465 } // namespace printing 464 } // namespace printing
OLDNEW
« no previous file with comments | « chrome/browser/printing/cloud_print/privet_http_unittest.cc ('k') | chrome/browser/printing/printing_layout_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698