| OLD | NEW |
| 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 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 443 return; | 443 return; |
| 444 } | 444 } |
| 445 #endif | 445 #endif |
| 446 | 446 |
| 447 // Now make sure the thread object is cleaned up. Do this on a worker | 447 // Now make sure the thread object is cleaned up. Do this on a worker |
| 448 // thread because it may block. | 448 // thread because it may block. |
| 449 // TODO(fdoray): Remove MayBlock() once base::Thread::Stop() passes | 449 // TODO(fdoray): Remove MayBlock() once base::Thread::Stop() passes |
| 450 // base::ThreadRestrictions::AssertWaitAllowed(). | 450 // base::ThreadRestrictions::AssertWaitAllowed(). |
| 451 base::PostTaskWithTraitsAndReply( | 451 base::PostTaskWithTraitsAndReply( |
| 452 FROM_HERE, | 452 FROM_HERE, |
| 453 base::TaskTraits() | 453 {base::MayBlock(), base::WithBaseSyncPrimitives(), |
| 454 .MayBlock() | 454 base::TaskPriority::BACKGROUND, |
| 455 .WithBaseSyncPrimitives() | 455 base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN}, |
| 456 .WithPriority(base::TaskPriority::BACKGROUND) | |
| 457 .WithShutdownBehavior( | |
| 458 base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN), | |
| 459 base::BindOnce(&PrintJobWorker::Stop, base::Unretained(worker_.get())), | 456 base::BindOnce(&PrintJobWorker::Stop, base::Unretained(worker_.get())), |
| 460 base::BindOnce(&PrintJob::HoldUntilStopIsCalled, this)); | 457 base::BindOnce(&PrintJob::HoldUntilStopIsCalled, this)); |
| 461 | 458 |
| 462 is_job_pending_ = false; | 459 is_job_pending_ = false; |
| 463 registrar_.RemoveAll(); | 460 registrar_.RemoveAll(); |
| 464 UpdatePrintedDocument(nullptr); | 461 UpdatePrintedDocument(nullptr); |
| 465 } | 462 } |
| 466 | 463 |
| 467 void PrintJob::HoldUntilStopIsCalled() { | 464 void PrintJob::HoldUntilStopIsCalled() { |
| 468 } | 465 } |
| (...skipping 10 matching lines...) Expand all Loading... |
| 479 : document_(document), page_(page), type_(type), job_id_(job_id) {} | 476 : document_(document), page_(page), type_(type), job_id_(job_id) {} |
| 480 | 477 |
| 481 JobEventDetails::~JobEventDetails() { | 478 JobEventDetails::~JobEventDetails() { |
| 482 } | 479 } |
| 483 | 480 |
| 484 PrintedDocument* JobEventDetails::document() const { return document_.get(); } | 481 PrintedDocument* JobEventDetails::document() const { return document_.get(); } |
| 485 | 482 |
| 486 PrintedPage* JobEventDetails::page() const { return page_.get(); } | 483 PrintedPage* JobEventDetails::page() const { return page_.get(); } |
| 487 | 484 |
| 488 } // namespace printing | 485 } // namespace printing |
| OLD | NEW |