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

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

Issue 1893083002: Change scoped_ptr to std::unique_ptr in //net. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: scopedptr-net-all: iwyu Created 4 years, 8 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_http_job.h" 5 #include "net/test/url_request/url_request_mock_http_job.h"
6 6
7 #include "base/files/file_util.h" 7 #include "base/files/file_util.h"
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/strings/string_number_conversions.h" 10 #include "base/strings/string_number_conversions.h"
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 GURL URLRequestMockHTTPJob::GetMockUrl(const std::string& path) { 113 GURL URLRequestMockHTTPJob::GetMockUrl(const std::string& path) {
114 return GetMockUrlForScheme(path, "http"); 114 return GetMockUrlForScheme(path, "http");
115 } 115 }
116 116
117 // static 117 // static
118 GURL URLRequestMockHTTPJob::GetMockHttpsUrl(const std::string& path) { 118 GURL URLRequestMockHTTPJob::GetMockHttpsUrl(const std::string& path) {
119 return GetMockUrlForScheme(path, "https"); 119 return GetMockUrlForScheme(path, "https");
120 } 120 }
121 121
122 // static 122 // static
123 scoped_ptr<URLRequestInterceptor> URLRequestMockHTTPJob::CreateInterceptor( 123 std::unique_ptr<URLRequestInterceptor> URLRequestMockHTTPJob::CreateInterceptor(
124 const base::FilePath& base_path, 124 const base::FilePath& base_path,
125 const scoped_refptr<base::SequencedWorkerPool>& worker_pool) { 125 const scoped_refptr<base::SequencedWorkerPool>& worker_pool) {
126 return scoped_ptr<URLRequestInterceptor>( 126 return std::unique_ptr<URLRequestInterceptor>(
127 new MockJobInterceptor(base_path, false, worker_pool)); 127 new MockJobInterceptor(base_path, false, worker_pool));
128 } 128 }
129 129
130 // static 130 // static
131 scoped_ptr<URLRequestInterceptor> 131 std::unique_ptr<URLRequestInterceptor>
132 URLRequestMockHTTPJob::CreateInterceptorForSingleFile( 132 URLRequestMockHTTPJob::CreateInterceptorForSingleFile(
133 const base::FilePath& file, 133 const base::FilePath& file,
134 const scoped_refptr<base::SequencedWorkerPool>& worker_pool) { 134 const scoped_refptr<base::SequencedWorkerPool>& worker_pool) {
135 return scoped_ptr<URLRequestInterceptor>( 135 return std::unique_ptr<URLRequestInterceptor>(
136 new MockJobInterceptor(file, true, worker_pool)); 136 new MockJobInterceptor(file, true, worker_pool));
137 } 137 }
138 138
139 URLRequestMockHTTPJob::URLRequestMockHTTPJob( 139 URLRequestMockHTTPJob::URLRequestMockHTTPJob(
140 URLRequest* request, 140 URLRequest* request,
141 NetworkDelegate* network_delegate, 141 NetworkDelegate* network_delegate,
142 const base::FilePath& file_path, 142 const base::FilePath& file_path,
143 const scoped_refptr<base::TaskRunner>& task_runner) 143 const scoped_refptr<base::TaskRunner>& task_runner)
144 : URLRequestFileJob(request, network_delegate, file_path, task_runner), 144 : URLRequestFileJob(request, network_delegate, file_path, task_runner),
145 task_runner_(task_runner), 145 task_runner_(task_runner),
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 return URLRequestJob::GetResponseCode(); 202 return URLRequestJob::GetResponseCode();
203 } 203 }
204 204
205 bool URLRequestMockHTTPJob::GetCharset(std::string* charset) { 205 bool URLRequestMockHTTPJob::GetCharset(std::string* charset) {
206 HttpResponseInfo info; 206 HttpResponseInfo info;
207 GetResponseInfo(&info); 207 GetResponseInfo(&info);
208 return info.headers.get() && info.headers->GetCharset(charset); 208 return info.headers.get() && info.headers->GetCharset(charset);
209 } 209 }
210 210
211 } // namespace net 211 } // namespace net
OLDNEW
« no previous file with comments | « net/test/url_request/url_request_mock_http_job.h ('k') | net/test/url_request/url_request_slow_download_job.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698