| OLD | NEW |
| 1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2015 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/browser/chromeos/policy/upload_job_impl.h" | 5 #include "chrome/browser/chromeos/policy/upload_job_impl.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <set> | 8 #include <set> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 402 SYSLOG(ERROR) << "URLRequestStatus error " << status.error(); | 402 SYSLOG(ERROR) << "URLRequestStatus error " << status.error(); |
| 403 HandleError(NETWORK_ERROR); | 403 HandleError(NETWORK_ERROR); |
| 404 } else { | 404 } else { |
| 405 const int response_code = source->GetResponseCode(); | 405 const int response_code = source->GetResponseCode(); |
| 406 if (response_code == net::HTTP_OK) { | 406 if (response_code == net::HTTP_OK) { |
| 407 // Successful upload | 407 // Successful upload |
| 408 upload_fetcher_.reset(); | 408 upload_fetcher_.reset(); |
| 409 access_token_.clear(); | 409 access_token_.clear(); |
| 410 post_data_.reset(); | 410 post_data_.reset(); |
| 411 state_ = SUCCESS; | 411 state_ = SUCCESS; |
| 412 UMA_HISTOGRAM_ENUMERATION(kUploadJobSuccessHistogram, retry_, | 412 UMA_HISTOGRAM_EXACT_LINEAR( |
| 413 UploadJobSuccess::REQUEST_MAX); | 413 kUploadJobSuccessHistogram, retry_, |
| 414 static_cast<int>(UploadJobSuccess::REQUEST_MAX)); |
| 414 delegate_->OnSuccess(); | 415 delegate_->OnSuccess(); |
| 415 } else if (response_code == net::HTTP_UNAUTHORIZED) { | 416 } else if (response_code == net::HTTP_UNAUTHORIZED) { |
| 416 SYSLOG(ERROR) << "Unauthorized request."; | 417 SYSLOG(ERROR) << "Unauthorized request."; |
| 417 HandleError(AUTHENTICATION_ERROR); | 418 HandleError(AUTHENTICATION_ERROR); |
| 418 } else { | 419 } else { |
| 419 SYSLOG(ERROR) << "POST request failed with HTTP status code " | 420 SYSLOG(ERROR) << "POST request failed with HTTP status code " |
| 420 << response_code << "."; | 421 << response_code << "."; |
| 421 HandleError(SERVER_ERROR); | 422 HandleError(SERVER_ERROR); |
| 422 } | 423 } |
| 423 } | 424 } |
| 424 } | 425 } |
| 425 | 426 |
| 426 } // namespace policy | 427 } // namespace policy |
| OLD | NEW |