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_SERVICE_CLOUD_PRINT_PRINTER_JOB_HANDLER_H_ | 5 #ifndef CHROME_SERVICE_CLOUD_PRINT_PRINTER_JOB_HANDLER_H_ |
6 #define CHROME_SERVICE_CLOUD_PRINT_PRINTER_JOB_HANDLER_H_ | 6 #define CHROME_SERVICE_CLOUD_PRINT_PRINTER_JOB_HANDLER_H_ |
7 | 7 |
8 #include <list> | 8 #include <list> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "base/files/file_path.h" | 12 #include "base/files/file_path.h" |
13 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
14 #include "base/memory/weak_ptr.h" | 14 #include "base/memory/weak_ptr.h" |
15 #include "base/message_loop/message_loop_proxy.h" | 15 #include "base/single_thread_task_runner.h" |
16 #include "base/threading/thread.h" | 16 #include "base/threading/thread.h" |
17 #include "base/time/time.h" | 17 #include "base/time/time.h" |
18 #include "chrome/service/cloud_print/cloud_print_url_fetcher.h" | 18 #include "chrome/service/cloud_print/cloud_print_url_fetcher.h" |
19 #include "chrome/service/cloud_print/job_status_updater.h" | 19 #include "chrome/service/cloud_print/job_status_updater.h" |
20 #include "chrome/service/cloud_print/printer_job_queue_handler.h" | 20 #include "chrome/service/cloud_print/printer_job_queue_handler.h" |
21 #include "net/url_request/url_request_status.h" | 21 #include "net/url_request/url_request_status.h" |
22 #include "printing/backend/print_backend.h" | 22 #include "printing/backend/print_backend.h" |
23 #include "url/gurl.h" | 23 #include "url/gurl.h" |
24 | 24 |
25 class URLFetcher; | 25 class URLFetcher; |
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
268 // DataHandler (depending on the current request being made). | 268 // DataHandler (depending on the current request being made). |
269 JSONDataHandler next_json_data_handler_; | 269 JSONDataHandler next_json_data_handler_; |
270 DataHandler next_data_handler_; | 270 DataHandler next_data_handler_; |
271 // The thread on which the actual print operation happens | 271 // The thread on which the actual print operation happens |
272 base::Thread print_thread_; | 272 base::Thread print_thread_; |
273 // The Job spooler object. This is only non-NULL during a print operation. | 273 // The Job spooler object. This is only non-NULL during a print operation. |
274 // It lives and dies on |print_thread_| | 274 // It lives and dies on |print_thread_| |
275 scoped_refptr<PrintSystem::JobSpooler> job_spooler_; | 275 scoped_refptr<PrintSystem::JobSpooler> job_spooler_; |
276 // The message loop proxy representing the thread on which this object | 276 // The message loop proxy representing the thread on which this object |
277 // was created. Used by the print thread. | 277 // was created. Used by the print thread. |
278 scoped_refptr<base::MessageLoopProxy> job_handler_message_loop_proxy_; | 278 scoped_refptr<base::SingleThreadTaskRunner> job_handler_task_runner_; |
279 | 279 |
280 // There may be pending tasks in the message queue when Shutdown is called. | 280 // There may be pending tasks in the message queue when Shutdown is called. |
281 // We set this flag so as to do nothing in those tasks. | 281 // We set this flag so as to do nothing in those tasks. |
282 bool shutting_down_; | 282 bool shutting_down_; |
283 | 283 |
284 // A string indicating the reason we are fetching jobs from the server | 284 // A string indicating the reason we are fetching jobs from the server |
285 // (used to specify the reason in the fetch URL). | 285 // (used to specify the reason in the fetch URL). |
286 std::string job_fetch_reason_; | 286 std::string job_fetch_reason_; |
287 // Flags that specify various pending server updates | 287 // Flags that specify various pending server updates |
288 bool job_check_pending_; | 288 bool job_check_pending_; |
(...skipping 21 matching lines...) Expand all Loading... |
310 | 310 |
311 // This typedef is to workaround the issue with certain versions of | 311 // This typedef is to workaround the issue with certain versions of |
312 // Visual Studio where it gets confused between multiple Delegate | 312 // Visual Studio where it gets confused between multiple Delegate |
313 // classes and gives a C2500 error. (I saw this error on the try bots - | 313 // classes and gives a C2500 error. (I saw this error on the try bots - |
314 // the workaround was not needed for my machine). | 314 // the workaround was not needed for my machine). |
315 typedef PrinterJobHandler::Delegate PrinterJobHandlerDelegate; | 315 typedef PrinterJobHandler::Delegate PrinterJobHandlerDelegate; |
316 | 316 |
317 } // namespace cloud_print | 317 } // namespace cloud_print |
318 | 318 |
319 #endif // CHROME_SERVICE_CLOUD_PRINT_PRINTER_JOB_HANDLER_H_ | 319 #endif // CHROME_SERVICE_CLOUD_PRINT_PRINTER_JOB_HANDLER_H_ |
OLD | NEW |