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

Side by Side Diff: components/rappor/log_uploader.cc

Issue 1548203002: Convert Pass()→std::move() in //components/[n-z]* (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix bad headers Created 4 years, 12 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "components/rappor/log_uploader.h" 5 #include "components/rappor/log_uploader.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 #include <utility>
9 10
10 #include "base/metrics/histogram_macros.h" 11 #include "base/metrics/histogram_macros.h"
11 #include "base/metrics/sparse_histogram.h" 12 #include "base/metrics/sparse_histogram.h"
12 #include "components/data_use_measurement/core/data_use_user_data.h" 13 #include "components/data_use_measurement/core/data_use_user_data.h"
13 #include "net/base/load_flags.h" 14 #include "net/base/load_flags.h"
14 #include "net/base/net_errors.h" 15 #include "net/base/net_errors.h"
15 #include "net/url_request/url_fetcher.h" 16 #include "net/url_request/url_fetcher.h"
16 17
17 namespace { 18 namespace {
18 19
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 base::TimeDelta max_interval = 136 base::TimeDelta max_interval =
136 base::TimeDelta::FromSeconds(kMaxBackoffIntervalSeconds); 137 base::TimeDelta::FromSeconds(kMaxBackoffIntervalSeconds);
137 return interval > max_interval ? max_interval : interval; 138 return interval > max_interval ? max_interval : interval;
138 } 139 }
139 140
140 void LogUploader::OnURLFetchComplete(const net::URLFetcher* source) { 141 void LogUploader::OnURLFetchComplete(const net::URLFetcher* source) {
141 // We're not allowed to re-use the existing |URLFetcher|s, so free them here. 142 // We're not allowed to re-use the existing |URLFetcher|s, so free them here.
142 // Note however that |source| is aliased to the fetcher, so we should be 143 // Note however that |source| is aliased to the fetcher, so we should be
143 // careful not to delete it too early. 144 // careful not to delete it too early.
144 DCHECK_EQ(current_fetch_.get(), source); 145 DCHECK_EQ(current_fetch_.get(), source);
145 scoped_ptr<net::URLFetcher> fetch(current_fetch_.Pass()); 146 scoped_ptr<net::URLFetcher> fetch(std::move(current_fetch_));
146 147
147 const net::URLRequestStatus& request_status = source->GetStatus(); 148 const net::URLRequestStatus& request_status = source->GetStatus();
148 149
149 const int response_code = source->GetResponseCode(); 150 const int response_code = source->GetResponseCode();
150 DVLOG(2) << "Upload fetch complete response code: " << response_code; 151 DVLOG(2) << "Upload fetch complete response code: " << response_code;
151 152
152 if (request_status.status() != net::URLRequestStatus::SUCCESS) { 153 if (request_status.status() != net::URLRequestStatus::SUCCESS) {
153 UMA_HISTOGRAM_SPARSE_SLOWLY("Rappor.FailedUploadErrorCode", 154 UMA_HISTOGRAM_SPARSE_SLOWLY("Rappor.FailedUploadErrorCode",
154 -request_status.error()); 155 -request_status.error());
155 DVLOG(1) << "Rappor server upload failed with error: " 156 DVLOG(1) << "Rappor server upload failed with error: "
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 if (!server_is_healthy) 193 if (!server_is_healthy)
193 upload_interval_ = BackOffUploadInterval(upload_interval_); 194 upload_interval_ = BackOffUploadInterval(upload_interval_);
194 else 195 else
195 upload_interval_ = base::TimeDelta::FromSeconds(kUnsentLogsIntervalSeconds); 196 upload_interval_ = base::TimeDelta::FromSeconds(kUnsentLogsIntervalSeconds);
196 197
197 if (CanStartUpload()) 198 if (CanStartUpload())
198 ScheduleNextUpload(upload_interval_); 199 ScheduleNextUpload(upload_interval_);
199 } 200 }
200 201
201 } // namespace rappor 202 } // namespace rappor
OLDNEW
« no previous file with comments | « components/proximity_auth/webui/proximity_auth_webui_handler.cc ('k') | components/rappor/rappor_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698