| 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 #ifndef CHROME_BROWSER_PRINTING_PRINT_JOB_WORKER_H_ | 5 #ifndef CHROME_BROWSER_PRINTING_PRINT_JOB_WORKER_H_ |
| 6 #define CHROME_BROWSER_PRINTING_PRINT_JOB_WORKER_H_ | 6 #define CHROME_BROWSER_PRINTING_PRINT_JOB_WORKER_H_ |
| 7 | 7 |
| 8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
| 11 #include "base/threading/thread.h" | 11 #include "base/threading/thread.h" |
| 12 #include "printing/page_number.h" | 12 #include "printing/page_number.h" |
| 13 #include "printing/print_destination_interface.h" | 13 #include "printing/print_destination_interface.h" |
| 14 #include "printing/printing_context.h" | 14 #include "printing/printing_context.h" |
| 15 #include "printing/print_job_constants.h" | 15 #include "printing/print_job_constants.h" |
| 16 | 16 |
| 17 class PrintingUIWebContentsObserver; | 17 class PrintingUIWebContentsObserver; |
| 18 | 18 |
| 19 namespace base { | 19 namespace base { |
| 20 class DictionaryValue; | 20 class DictionaryValue; |
| 21 } | 21 } |
| 22 | 22 |
| 23 namespace printing { | 23 namespace printing { |
| 24 | 24 |
| 25 class PrintedDocument; | 25 class PrintedDocument; |
| 26 class PrintedPage; | 26 class PrintedPage; |
| 27 class PrintJob; | 27 class PrintJob; |
| 28 class PrintJobWorkerOwner; | 28 class PrintJobWorkerOwner; |
| 29 | 29 |
| 30 // Worker thread code. All this code, except for the constructor, is executed in | 30 // Worker thread code. It manages the PrintingContext, which can be blocking |
| 31 // the worker thread. It manages the PrintingContext, which can be blocking | |
| 32 // and/or run a message loop. This is the object that generates most | 31 // and/or run a message loop. This is the object that generates most |
| 33 // NOTIFY_PRINT_JOB_EVENT notifications, but they are generated through a | 32 // NOTIFY_PRINT_JOB_EVENT notifications, but they are generated through a |
| 34 // NotificationTask task to be executed from the right thread, the UI thread. | 33 // NotificationTask task to be executed from the right thread, the UI thread. |
| 35 // PrintJob always outlives its worker instance. | 34 // PrintJob always outlives its worker instance. |
| 36 class PrintJobWorker : public base::Thread { | 35 class PrintJobWorker : public base::Thread { |
| 37 public: | 36 public: |
| 38 explicit PrintJobWorker(PrintJobWorkerOwner* owner); | 37 explicit PrintJobWorker(PrintJobWorkerOwner* owner); |
| 39 virtual ~PrintJobWorker(); | 38 virtual ~PrintJobWorker(); |
| 40 | 39 |
| 41 void SetNewOwner(PrintJobWorkerOwner* new_owner); | 40 void SetNewOwner(PrintJobWorkerOwner* new_owner); |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 | 136 |
| 138 // Used to generate a WeakPtr for callbacks. | 137 // Used to generate a WeakPtr for callbacks. |
| 139 base::WeakPtrFactory<PrintJobWorker> weak_factory_; | 138 base::WeakPtrFactory<PrintJobWorker> weak_factory_; |
| 140 | 139 |
| 141 DISALLOW_COPY_AND_ASSIGN(PrintJobWorker); | 140 DISALLOW_COPY_AND_ASSIGN(PrintJobWorker); |
| 142 }; | 141 }; |
| 143 | 142 |
| 144 } // namespace printing | 143 } // namespace printing |
| 145 | 144 |
| 146 #endif // CHROME_BROWSER_PRINTING_PRINT_JOB_WORKER_H_ | 145 #endif // CHROME_BROWSER_PRINTING_PRINT_JOB_WORKER_H_ |
| OLD | NEW |