| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "cloud_print/gcp20/prototype/privet_http_server.h" | 5 #include "cloud_print/gcp20/prototype/privet_http_server.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 310 delegate_->CreateJob(body, &job_id, &expires_in, | 310 delegate_->CreateJob(body, &job_id, &expires_in, |
| 311 &error_timeout, &error_description); | 311 &error_timeout, &error_description); |
| 312 | 312 |
| 313 scoped_ptr<base::DictionaryValue> response; | 313 scoped_ptr<base::DictionaryValue> response; |
| 314 *status_code = net::HTTP_OK; | 314 *status_code = net::HTTP_OK; |
| 315 switch (result) { | 315 switch (result) { |
| 316 case LocalPrintJob::CREATE_SUCCESS: | 316 case LocalPrintJob::CREATE_SUCCESS: |
| 317 response.reset(new base::DictionaryValue); | 317 response.reset(new base::DictionaryValue); |
| 318 response->SetString("job_id", job_id); | 318 response->SetString("job_id", job_id); |
| 319 response->SetInteger("expires_in", expires_in); | 319 response->SetInteger("expires_in", expires_in); |
| 320 return std::move(response); | 320 return response; |
| 321 | 321 |
| 322 case LocalPrintJob::CREATE_INVALID_TICKET: | 322 case LocalPrintJob::CREATE_INVALID_TICKET: |
| 323 return CreateError("invalid_ticket"); | 323 return CreateError("invalid_ticket"); |
| 324 case LocalPrintJob::CREATE_PRINTER_BUSY: | 324 case LocalPrintJob::CREATE_PRINTER_BUSY: |
| 325 return CreateErrorWithTimeout("printer_busy", error_timeout); | 325 return CreateErrorWithTimeout("printer_busy", error_timeout); |
| 326 case LocalPrintJob::CREATE_PRINTER_ERROR: | 326 case LocalPrintJob::CREATE_PRINTER_ERROR: |
| 327 return CreateErrorWithDescription("printer_error", error_description); | 327 return CreateErrorWithDescription("printer_error", error_description); |
| 328 } | 328 } |
| 329 return scoped_ptr<base::DictionaryValue>(); | 329 return scoped_ptr<base::DictionaryValue>(); |
| 330 } | 330 } |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 506 delegate_->GetRegistrationServerError(&description); | 506 delegate_->GetRegistrationServerError(&description); |
| 507 *current_response = CreateErrorWithDescription("server_error", | 507 *current_response = CreateErrorWithDescription("server_error", |
| 508 description); | 508 description); |
| 509 break; | 509 break; |
| 510 } | 510 } |
| 511 | 511 |
| 512 default: | 512 default: |
| 513 NOTREACHED(); | 513 NOTREACHED(); |
| 514 }; | 514 }; |
| 515 } | 515 } |
| OLD | NEW |