| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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_queue_handler.h" | 5 #include "chrome/service/cloud_print/printer_job_queue_handler.h" |
| 6 | 6 |
| 7 #include <math.h> | 7 #include <math.h> |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| 11 #include <algorithm> | 11 #include <algorithm> |
| 12 | 12 |
| 13 #include "base/values.h" | 13 #include "base/values.h" |
| 14 | 14 |
| 15 namespace cloud_print { | 15 namespace cloud_print { |
| 16 | 16 |
| 17 class TimeProviderImpl : public PrinterJobQueueHandler::TimeProvider { | 17 class TimeProviderImpl : public PrinterJobQueueHandler::TimeProvider { |
| 18 public: | 18 public: |
| 19 base::Time GetNow() override; | 19 base::Time GetNow() override; |
| 20 }; | 20 }; |
| 21 | 21 |
| 22 base::Time TimeProviderImpl::GetNow() { | 22 base::Time TimeProviderImpl::GetNow() { |
| 23 return base::Time::Now(); | 23 return base::Time::Now(); |
| 24 } | 24 } |
| 25 | 25 |
| 26 JobDetails::JobDetails() {} | 26 JobDetails::JobDetails() {} |
| 27 | 27 |
| 28 JobDetails::JobDetails(const JobDetails& other) = default; |
| 29 |
| 28 JobDetails::~JobDetails() {} | 30 JobDetails::~JobDetails() {} |
| 29 | 31 |
| 30 void JobDetails::Clear() { | 32 void JobDetails::Clear() { |
| 31 job_id_.clear(); | 33 job_id_.clear(); |
| 32 job_title_.clear(); | 34 job_title_.clear(); |
| 33 job_owner_.clear(); | 35 job_owner_.clear(); |
| 34 print_ticket_.clear(); | 36 print_ticket_.clear(); |
| 35 print_ticket_mime_type_.clear(); | 37 print_ticket_mime_type_.clear(); |
| 36 print_data_mime_type_.clear(); | 38 print_data_mime_type_.clear(); |
| 37 print_data_file_path_ = base::FilePath(); | 39 print_data_file_path_ = base::FilePath(); |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 | 165 |
| 164 job_found.first->second.retries_ += 1; | 166 job_found.first->second.retries_ += 1; |
| 165 job_found.first->second.last_retry_ = time_provider_->GetNow(); | 167 job_found.first->second.last_retry_ = time_provider_->GetNow(); |
| 166 } | 168 } |
| 167 | 169 |
| 168 return true; | 170 return true; |
| 169 } | 171 } |
| 170 | 172 |
| 171 } // namespace cloud_print | 173 } // namespace cloud_print |
| 172 | 174 |
| OLD | NEW |