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

Side by Side Diff: chrome/browser/chromeos/policy/upload_job_impl.cc

Issue 2886933003: Use stricter type checking in UMA_HISTOGRAM_ENUMERATION (Closed)
Patch Set: nocompile test Created 3 years, 6 months 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 unified diff | Download patch
OLDNEW
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698