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

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: simplify type checking Created 3 years, 5 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 393 matching lines...) Expand 10 before | Expand all | Expand 10 after
404 SYSLOG(ERROR) << "URLRequestStatus error " << status.error(); 404 SYSLOG(ERROR) << "URLRequestStatus error " << status.error();
405 HandleError(NETWORK_ERROR); 405 HandleError(NETWORK_ERROR);
406 } else { 406 } else {
407 const int response_code = source->GetResponseCode(); 407 const int response_code = source->GetResponseCode();
408 if (response_code == net::HTTP_OK) { 408 if (response_code == net::HTTP_OK) {
409 // Successful upload 409 // Successful upload
410 upload_fetcher_.reset(); 410 upload_fetcher_.reset();
411 access_token_.clear(); 411 access_token_.clear();
412 post_data_.reset(); 412 post_data_.reset();
413 state_ = SUCCESS; 413 state_ = SUCCESS;
414 UMA_HISTOGRAM_ENUMERATION(kUploadJobSuccessHistogram, retry_, 414 UMA_HISTOGRAM_EXACT_LINEAR(
415 UploadJobSuccess::REQUEST_MAX); 415 kUploadJobSuccessHistogram, retry_,
416 static_cast<int>(UploadJobSuccess::REQUEST_MAX));
416 delegate_->OnSuccess(); 417 delegate_->OnSuccess();
417 } else if (response_code == net::HTTP_UNAUTHORIZED) { 418 } else if (response_code == net::HTTP_UNAUTHORIZED) {
418 SYSLOG(ERROR) << "Unauthorized request."; 419 SYSLOG(ERROR) << "Unauthorized request.";
419 HandleError(AUTHENTICATION_ERROR); 420 HandleError(AUTHENTICATION_ERROR);
420 } else { 421 } else {
421 SYSLOG(ERROR) << "POST request failed with HTTP status code " 422 SYSLOG(ERROR) << "POST request failed with HTTP status code "
422 << response_code << "."; 423 << response_code << ".";
423 HandleError(SERVER_ERROR); 424 HandleError(SERVER_ERROR);
424 } 425 }
425 } 426 }
426 } 427 }
427 428
428 } // namespace policy 429 } // namespace policy
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/login/screens/reset_screen.cc ('k') | chrome/browser/diagnostics/diagnostics_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698