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

Side by Side Diff: net/test/url_request/url_request_mock_data_job.cc

Issue 2259823002: Re-write many calls to WrapUnique() with MakeUnique() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 3 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 "net/test/url_request/url_request_mock_data_job.h" 5 #include "net/test/url_request/url_request_mock_data_job.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/location.h" 8 #include "base/location.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 void URLRequestMockDataJob::AddUrlHandler() { 176 void URLRequestMockDataJob::AddUrlHandler() {
177 return AddUrlHandlerForHostname(kMockHostname); 177 return AddUrlHandlerForHostname(kMockHostname);
178 } 178 }
179 179
180 // static 180 // static
181 void URLRequestMockDataJob::AddUrlHandlerForHostname( 181 void URLRequestMockDataJob::AddUrlHandlerForHostname(
182 const std::string& hostname) { 182 const std::string& hostname) {
183 // Add |hostname| to URLRequestFilter for HTTP and HTTPS. 183 // Add |hostname| to URLRequestFilter for HTTP and HTTPS.
184 URLRequestFilter* filter = URLRequestFilter::GetInstance(); 184 URLRequestFilter* filter = URLRequestFilter::GetInstance();
185 filter->AddHostnameInterceptor("http", hostname, 185 filter->AddHostnameInterceptor("http", hostname,
186 base::WrapUnique(new MockJobInterceptor())); 186 base::MakeUnique<MockJobInterceptor>());
187 filter->AddHostnameInterceptor("https", hostname, 187 filter->AddHostnameInterceptor("https", hostname,
188 base::WrapUnique(new MockJobInterceptor())); 188 base::MakeUnique<MockJobInterceptor>());
189 } 189 }
190 190
191 // static 191 // static
192 GURL URLRequestMockDataJob::GetMockHttpUrl(const std::string& data, 192 GURL URLRequestMockDataJob::GetMockHttpUrl(const std::string& data,
193 int repeat_count) { 193 int repeat_count) {
194 return GetMockHttpUrlForHostname(kMockHostname, data, repeat_count); 194 return GetMockHttpUrlForHostname(kMockHostname, data, repeat_count);
195 } 195 }
196 196
197 // static 197 // static
198 GURL URLRequestMockDataJob::GetMockHttpsUrl(const std::string& data, 198 GURL URLRequestMockDataJob::GetMockHttpsUrl(const std::string& data,
(...skipping 15 matching lines...) Expand all
214 214
215 // static 215 // static
216 GURL URLRequestMockDataJob::GetMockHttpsUrlForHostname( 216 GURL URLRequestMockDataJob::GetMockHttpsUrlForHostname(
217 const std::string& hostname, 217 const std::string& hostname,
218 const std::string& data, 218 const std::string& data,
219 int repeat_count) { 219 int repeat_count) {
220 return GetMockUrl("https", hostname, data, repeat_count, false); 220 return GetMockUrl("https", hostname, data, repeat_count, false);
221 } 221 }
222 222
223 } // namespace net 223 } // namespace net
OLDNEW
« no previous file with comments | « net/test/url_request/url_request_hanging_read_job.cc ('k') | net/tools/cert_verify_tool/verify_using_path_builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698