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

Side by Side Diff: components/domain_reliability/uploader.cc

Issue 1117703002: Adjust URLFetcher::Create API so that object is returned as scoped_ptr. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove unneeded Pass() calls Created 5 years, 7 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/domain_reliability/uploader.h" 5 #include "components/domain_reliability/uploader.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/memory/scoped_vector.h" 9 #include "base/memory/scoped_vector.h"
10 #include "base/metrics/sparse_histogram.h" 10 #include "base/metrics/sparse_histogram.h"
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 69
70 if (discard_uploads_) { 70 if (discard_uploads_) {
71 VLOG(1) << "Discarding report instead of uploading."; 71 VLOG(1) << "Discarding report instead of uploading.";
72 UploadResult result; 72 UploadResult result;
73 result.status = UploadResult::SUCCESS; 73 result.status = UploadResult::SUCCESS;
74 callback.Run(result); 74 callback.Run(result);
75 return; 75 return;
76 } 76 }
77 77
78 net::URLFetcher* fetcher = 78 net::URLFetcher* fetcher =
79 net::URLFetcher::Create(0, upload_url, net::URLFetcher::POST, this); 79 net::URLFetcher::Create(0, upload_url, net::URLFetcher::POST, this)
80 .release();
80 fetcher->SetRequestContext(url_request_context_getter_.get()); 81 fetcher->SetRequestContext(url_request_context_getter_.get());
81 fetcher->SetLoadFlags(net::LOAD_DO_NOT_SEND_COOKIES | 82 fetcher->SetLoadFlags(net::LOAD_DO_NOT_SEND_COOKIES |
82 net::LOAD_DO_NOT_SAVE_COOKIES); 83 net::LOAD_DO_NOT_SAVE_COOKIES);
83 fetcher->SetUploadData(kJsonMimeType, report_json); 84 fetcher->SetUploadData(kJsonMimeType, report_json);
84 fetcher->SetAutomaticallyRetryOn5xx(false); 85 fetcher->SetAutomaticallyRetryOn5xx(false);
85 fetcher->SetURLRequestUserData( 86 fetcher->SetURLRequestUserData(
86 UploadUserData::kUserDataKey, 87 UploadUserData::kUserDataKey,
87 UploadUserData::CreateCreateDataCallback()); 88 UploadUserData::CreateCreateDataCallback());
88 fetcher->Start(); 89 fetcher->Start();
89 90
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 new DomainReliabilityUploaderImpl(time, url_request_context_getter)); 162 new DomainReliabilityUploaderImpl(time, url_request_context_getter));
162 } 163 }
163 164
164 // static 165 // static
165 bool DomainReliabilityUploader::URLRequestIsUpload( 166 bool DomainReliabilityUploader::URLRequestIsUpload(
166 const net::URLRequest& request) { 167 const net::URLRequest& request) {
167 return request.GetUserData(UploadUserData::kUserDataKey) != nullptr; 168 return request.GetUserData(UploadUserData::kUserDataKey) != nullptr;
168 } 169 }
169 170
170 } // namespace domain_reliability 171 } // namespace domain_reliability
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698