Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(212)

Side by Side Diff: chrome/service/cloud_print/printer_job_handler.cc

Issue 10821014: Ensure that printer job handler is stopped and task_in_progress_ is reset in OnAuthError (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/service/cloud_print/printer_job_handler.h" 5 #include "chrome/service/cloud_print/printer_job_handler.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/json/json_reader.h" 10 #include "base/json/json_reader.h"
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 if (index->get() == updater) { 169 if (index->get() == updater) {
170 job_status_updater_list_.erase(index); 170 job_status_updater_list_.erase(index);
171 ret = true; 171 ret = true;
172 break; 172 break;
173 } 173 }
174 } 174 }
175 return ret; 175 return ret;
176 } 176 }
177 177
178 void PrinterJobHandler::OnAuthError() { 178 void PrinterJobHandler::OnAuthError() {
179 MessageLoop::current()->PostTask(
180 FROM_HERE, base::Bind(&PrinterJobHandler::Stop, this));
179 if (delegate_) 181 if (delegate_)
180 delegate_->OnAuthError(); 182 delegate_->OnAuthError();
181 } 183 }
182 184
183 void PrinterJobHandler::OnPrinterDeleted() { 185 void PrinterJobHandler::OnPrinterDeleted() {
184 if (delegate_) 186 if (delegate_)
185 delegate_->OnPrinterDeleted(printer_info_cloud_.printer_id); 187 delegate_->OnPrinterDeleted(printer_info_cloud_.printer_id);
186 } 188 }
187 189
188 void PrinterJobHandler::OnPrinterChanged() { 190 void PrinterJobHandler::OnPrinterChanged() {
(...skipping 488 matching lines...) Expand 10 before | Expand all | Expand 10 after
677 if (!job_spooler_ || !job_spooler_->Spool(job_details.print_ticket_, 679 if (!job_spooler_ || !job_spooler_->Spool(job_details.print_ticket_,
678 job_details.print_data_file_path_, 680 job_details.print_data_file_path_,
679 job_details.print_data_mime_type_, 681 job_details.print_data_mime_type_,
680 printer_name, 682 printer_name,
681 job_details.job_title_, 683 job_details.job_title_,
682 job_details.tags_, 684 job_details.tags_,
683 this)) { 685 this)) {
684 OnJobSpoolFailed(); 686 OnJobSpoolFailed();
685 } 687 }
686 } 688 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698