| 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 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| 11 #include "base/location.h" | 11 #include "base/location.h" |
| 12 #include "base/message_loop/message_loop.h" | 12 #include "base/message_loop/message_loop.h" |
| 13 #include "base/run_loop.h" |
| 13 #include "base/single_thread_task_runner.h" | 14 #include "base/single_thread_task_runner.h" |
| 14 #include "base/threading/thread_restrictions.h" | 15 #include "base/threading/thread_restrictions.h" |
| 15 #include "base/threading/thread_task_runner_handle.h" | 16 #include "base/threading/thread_task_runner_handle.h" |
| 16 #include "base/threading/worker_pool.h" | 17 #include "base/threading/worker_pool.h" |
| 17 #include "build/build_config.h" | 18 #include "build/build_config.h" |
| 18 #include "chrome/browser/chrome_notification_types.h" | 19 #include "chrome/browser/chrome_notification_types.h" |
| 19 #include "chrome/browser/printing/print_job_worker.h" | 20 #include "chrome/browser/printing/print_job_worker.h" |
| 20 #include "content/public/browser/browser_thread.h" | 21 #include "content/public/browser/browser_thread.h" |
| 21 #include "content/public/browser/notification_service.h" | 22 #include "content/public/browser/notification_service.h" |
| 22 #include "printing/printed_document.h" | 23 #include "printing/printed_document.h" |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 bool PrintJob::FlushJob(base::TimeDelta timeout) { | 194 bool PrintJob::FlushJob(base::TimeDelta timeout) { |
| 194 // Make sure the object outlive this message loop. | 195 // Make sure the object outlive this message loop. |
| 195 scoped_refptr<PrintJob> handle(this); | 196 scoped_refptr<PrintJob> handle(this); |
| 196 | 197 |
| 197 base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( | 198 base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( |
| 198 FROM_HERE, base::Bind(&PrintJob::Quit, quit_factory_.GetWeakPtr()), | 199 FROM_HERE, base::Bind(&PrintJob::Quit, quit_factory_.GetWeakPtr()), |
| 199 timeout); | 200 timeout); |
| 200 | 201 |
| 201 base::MessageLoop::ScopedNestableTaskAllower allow( | 202 base::MessageLoop::ScopedNestableTaskAllower allow( |
| 202 base::MessageLoop::current()); | 203 base::MessageLoop::current()); |
| 203 base::MessageLoop::current()->Run(); | 204 base::RunLoop().Run(); |
| 204 | 205 |
| 205 return true; | 206 return true; |
| 206 } | 207 } |
| 207 | 208 |
| 208 void PrintJob::DisconnectSource() { | 209 void PrintJob::DisconnectSource() { |
| 209 source_ = NULL; | 210 source_ = NULL; |
| 210 if (document_.get()) | 211 if (document_.get()) |
| 211 document_->DisconnectSource(); | 212 document_->DisconnectSource(); |
| 212 } | 213 } |
| 213 | 214 |
| (...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 449 } | 450 } |
| 450 | 451 |
| 451 JobEventDetails::~JobEventDetails() { | 452 JobEventDetails::~JobEventDetails() { |
| 452 } | 453 } |
| 453 | 454 |
| 454 PrintedDocument* JobEventDetails::document() const { return document_.get(); } | 455 PrintedDocument* JobEventDetails::document() const { return document_.get(); } |
| 455 | 456 |
| 456 PrintedPage* JobEventDetails::page() const { return page_.get(); } | 457 PrintedPage* JobEventDetails::page() const { return page_.get(); } |
| 457 | 458 |
| 458 } // namespace printing | 459 } // namespace printing |
| OLD | NEW |