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

Unified Diff: chrome/browser/local_discovery/privet_http_impl.cc

Issue 61643021: If a job fails when sending a PDF, retry with a PWG raster (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/local_discovery/privet_http_impl.cc
diff --git a/chrome/browser/local_discovery/privet_http_impl.cc b/chrome/browser/local_discovery/privet_http_impl.cc
index af5fba17835d658058bab6d3dab4a711c6bacf6b..f9ba59e56d543194c40f977e4b6301cf2dc4ff50 100644
--- a/chrome/browser/local_discovery/privet_http_impl.cc
+++ b/chrome/browser/local_discovery/privet_http_impl.cc
@@ -548,9 +548,8 @@ void PrivetLocalPrintOperationImpl::OnSubmitdocResponse(
// This error is only relevant in the case of extended workflow:
// If the print job ID is invalid, retry createjob and submitdoc,
// rather than simply retrying the current request.
- if (has_error) {
+ if (has_error && value->GetString(kPrivetKeyError, &error)) {
if (has_extended_workflow_ &&
- value->GetString(kPrivetKeyError, &error) &&
error == kPrivetErrorInvalidPrintJob &&
invalid_job_retries_ < kPrivetLocalPrintMaxRetries) {
invalid_job_retries_++;
@@ -569,6 +568,9 @@ void PrivetLocalPrintOperationImpl::OnSubmitdocResponse(
FROM_HERE, base::Bind(&PrivetLocalPrintOperationImpl::DoCreatejob,
weak_factory_.GetWeakPtr()),
base::TimeDelta::FromSeconds(timeout));
+ } else if (use_pdf_ && error == kPrivetErrorInvalidDocumentType) {
+ use_pdf_ = false;
+ delegate_->OnPrivetPrintingRequestPWGRaster(this);
} else {
delegate_->OnPrivetPrintingError(this, 200);
}
@@ -576,7 +578,6 @@ void PrivetLocalPrintOperationImpl::OnSubmitdocResponse(
return;
}
-
// If we've gotten this far, there are no errors, so we've effectively
// succeeded.
delegate_->OnPrivetPrintingDone(this);
@@ -659,7 +660,7 @@ void PrivetLocalPrintOperationImpl::SetOffline(bool offline) {
}
void PrivetLocalPrintOperationImpl::SendDataInternal() {
- if (has_extended_workflow_ && !ticket_.empty()) {
+ if (has_extended_workflow_ && !ticket_.empty() && jobid_.empty()) {
DoCreatejob();
} else {
DoSubmitdoc();
« no previous file with comments | « chrome/browser/local_discovery/privet_constants.cc ('k') | chrome/browser/local_discovery/privet_http_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698