| Index: chrome/service/cloud_print/job_status_updater.cc
|
| diff --git a/chrome/service/cloud_print/job_status_updater.cc b/chrome/service/cloud_print/job_status_updater.cc
|
| index 3334bcfb6dc0942edd4be9287cb1ff7462a78823..674091f420ce4c1ae15da772c1f57b073e60ff4e 100644
|
| --- a/chrome/service/cloud_print/job_status_updater.cc
|
| +++ b/chrome/service/cloud_print/job_status_updater.cc
|
| @@ -16,6 +16,15 @@
|
|
|
| namespace cloud_print {
|
|
|
| +namespace {
|
| +
|
| +bool IsTerminalJobState(PrintJobStatus status) {
|
| + return status == PRINT_JOB_STATUS_ERROR ||
|
| + status == PRINT_JOB_STATUS_COMPLETED;
|
| +}
|
| +
|
| +} // namespace
|
| +
|
| JobStatusUpdater::JobStatusUpdater(const std::string& printer_name,
|
| const std::string& job_id,
|
| PlatformJobId& local_job_id,
|
| @@ -43,7 +52,7 @@ void JobStatusUpdater::UpdateStatus() {
|
| // If the job has already been completed, we just need to update the server
|
| // with that status. The *only* reason we would come back here in that case
|
| // is if our last server update attempt failed.
|
| - if (last_job_details_.status == PRINT_JOB_STATUS_COMPLETED) {
|
| + if (IsTerminalJobState(last_job_details_.status)) {
|
| need_update = true;
|
| } else {
|
| PrintJobDetails details;
|
| @@ -90,7 +99,7 @@ CloudPrintURLFetcher::ResponseAction JobStatusUpdater::HandleJSONData(
|
| const GURL& url,
|
| DictionaryValue* json_data,
|
| bool succeeded) {
|
| - if (last_job_details_.status == PRINT_JOB_STATUS_COMPLETED) {
|
| + if (IsTerminalJobState(last_job_details_.status)) {
|
| base::MessageLoop::current()->PostTask(
|
| FROM_HERE, base::Bind(&JobStatusUpdater::Stop, this));
|
| }
|
|
|