OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/service/cloud_print/printer_job_handler.h" | 5 #include "chrome/service/cloud_print/printer_job_handler.h" |
6 | 6 |
7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
8 #include "base/json/json_reader.h" | 8 #include "base/json/json_reader.h" |
9 #include "base/md5.h" | 9 #include "base/md5.h" |
10 #include "base/stringprintf.h" | 10 #include "base/stringprintf.h" |
(...skipping 29 matching lines...) Expand all Loading... |
40 printer_info_(printer_info), | 40 printer_info_(printer_info), |
41 printer_info_cloud_(printer_info_cloud), | 41 printer_info_cloud_(printer_info_cloud), |
42 cloud_print_server_url_(cloud_print_server_url), | 42 cloud_print_server_url_(cloud_print_server_url), |
43 delegate_(delegate), | 43 delegate_(delegate), |
44 local_job_id_(-1), | 44 local_job_id_(-1), |
45 next_json_data_handler_(NULL), | 45 next_json_data_handler_(NULL), |
46 next_data_handler_(NULL), | 46 next_data_handler_(NULL), |
47 server_error_count_(0), | 47 server_error_count_(0), |
48 print_thread_("Chrome_CloudPrintJobPrintThread"), | 48 print_thread_("Chrome_CloudPrintJobPrintThread"), |
49 job_handler_message_loop_proxy_( | 49 job_handler_message_loop_proxy_( |
50 base::MessageLoopProxy::CreateForCurrentThread()), | 50 base::MessageLoopProxy::current()), |
51 shutting_down_(false), | 51 shutting_down_(false), |
52 job_check_pending_(false), | 52 job_check_pending_(false), |
53 printer_update_pending_(true), | 53 printer_update_pending_(true), |
54 printer_delete_pending_(false), | 54 printer_delete_pending_(false), |
55 task_in_progress_(false) { | 55 task_in_progress_(false) { |
56 } | 56 } |
57 | 57 |
58 bool PrinterJobHandler::Initialize() { | 58 bool PrinterJobHandler::Initialize() { |
59 if (print_system_->IsValidPrinter( | 59 if (print_system_->IsValidPrinter( |
60 printer_info_.printer_name)) { | 60 printer_info_.printer_name)) { |
(...skipping 620 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
681 } | 681 } |
682 | 682 |
683 void PrinterJobHandler::OnJobSpoolFailed() { | 683 void PrinterJobHandler::OnJobSpoolFailed() { |
684 DCHECK(MessageLoop::current() == print_thread_.message_loop()); | 684 DCHECK(MessageLoop::current() == print_thread_.message_loop()); |
685 job_spooler_ = NULL; | 685 job_spooler_ = NULL; |
686 job_handler_message_loop_proxy_->PostTask(FROM_HERE, | 686 job_handler_message_loop_proxy_->PostTask(FROM_HERE, |
687 NewRunnableMethod(this, | 687 NewRunnableMethod(this, |
688 &PrinterJobHandler::JobFailed, | 688 &PrinterJobHandler::JobFailed, |
689 PRINT_FAILED)); | 689 PRINT_FAILED)); |
690 } | 690 } |
OLD | NEW |