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

Unified Diff: components/rappor/log_uploader.cc

Issue 188103004: C++ Readability review for holte (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: components/rappor/log_uploader.cc
diff --git a/components/rappor/log_uploader.cc b/components/rappor/log_uploader.cc
index 4837ba192084a2bde5574df94ecf00230e05012f..37d727cdc6f9f9c819c9ca3f05f0fef617b8cae5 100644
--- a/components/rappor/log_uploader.cc
+++ b/components/rappor/log_uploader.cc
@@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+// Change for readability
+
#include "components/rappor/log_uploader.h"
#include "base/metrics/histogram.h"
@@ -102,12 +104,12 @@ void LogUploader::OnURLFetchComplete(const net::URLFetcher* source) {
DCHECK_EQ(current_fetch_.get(), source);
scoped_ptr<net::URLFetcher> fetch(current_fetch_.Pass());
- int response_code = source->GetResponseCode();
+ const int response_code = source->GetResponseCode();
// Log a histogram to track response success vs. failure rates.
UMA_HISTOGRAM_SPARSE_SLOWLY("Rappor.UploadResponseCode", response_code);
- bool upload_succeeded = response_code == 200;
+ const bool upload_succeeded = response_code == 200;
// Determine whether this log should be retransmitted.
DiscardReason reason = NUM_DISCARD_REASONS;
@@ -128,7 +130,7 @@ void LogUploader::OnURLFetchComplete(const net::URLFetcher* source) {
// Error 400 indicates a problem with the log, not with the server, so
// don't consider that a sign that the server is in trouble.
- bool server_is_healthy = upload_succeeded || response_code == 400;
+ const bool server_is_healthy = upload_succeeded || response_code == 400;
OnUploadFinished(server_is_healthy, !queued_logs_.empty());
}

Powered by Google App Engine
This is Rietveld 408576698