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

Side by Side Diff: content/shell/browser/shell_url_request_context_getter.cc

Issue 660883003: Use scoped_ptr::Pass instead of scoped_ptr::PassAs<T>. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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
« no previous file with comments | « content/public/test/browser_test_utils.cc ('k') | content/test/layouttest_support.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "content/shell/browser/shell_url_request_context_getter.h" 5 #include "content/shell/browser/shell_url_request_context_getter.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/strings/string_number_conversions.h" 9 #include "base/strings/string_number_conversions.h"
10 #include "base/strings/string_split.h" 10 #include "base/strings/string_split.h"
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 set_protocol = job_factory->SetProtocolHandler( 213 set_protocol = job_factory->SetProtocolHandler(
214 url::kFileScheme, 214 url::kFileScheme,
215 new net::FileProtocolHandler( 215 new net::FileProtocolHandler(
216 BrowserThread::GetBlockingPool()->GetTaskRunnerWithShutdownBehavior( 216 BrowserThread::GetBlockingPool()->GetTaskRunnerWithShutdownBehavior(
217 base::SequencedWorkerPool::SKIP_ON_SHUTDOWN))); 217 base::SequencedWorkerPool::SKIP_ON_SHUTDOWN)));
218 DCHECK(set_protocol); 218 DCHECK(set_protocol);
219 #endif 219 #endif
220 220
221 // Set up interceptors in the reverse order. 221 // Set up interceptors in the reverse order.
222 scoped_ptr<net::URLRequestJobFactory> top_job_factory = 222 scoped_ptr<net::URLRequestJobFactory> top_job_factory =
223 job_factory.PassAs<net::URLRequestJobFactory>(); 223 job_factory.Pass();
224 for (URLRequestInterceptorScopedVector::reverse_iterator i = 224 for (URLRequestInterceptorScopedVector::reverse_iterator i =
225 request_interceptors_.rbegin(); 225 request_interceptors_.rbegin();
226 i != request_interceptors_.rend(); 226 i != request_interceptors_.rend();
227 ++i) { 227 ++i) {
228 top_job_factory.reset(new net::URLRequestInterceptingJobFactory( 228 top_job_factory.reset(new net::URLRequestInterceptingJobFactory(
229 top_job_factory.Pass(), make_scoped_ptr(*i))); 229 top_job_factory.Pass(), make_scoped_ptr(*i)));
230 } 230 }
231 request_interceptors_.weak_clear(); 231 request_interceptors_.weak_clear();
232 232
233 storage_->set_job_factory(top_job_factory.release()); 233 storage_->set_job_factory(top_job_factory.release());
234 } 234 }
235 235
236 return url_request_context_.get(); 236 return url_request_context_.get();
237 } 237 }
238 238
239 scoped_refptr<base::SingleThreadTaskRunner> 239 scoped_refptr<base::SingleThreadTaskRunner>
240 ShellURLRequestContextGetter::GetNetworkTaskRunner() const { 240 ShellURLRequestContextGetter::GetNetworkTaskRunner() const {
241 return BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO); 241 return BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO);
242 } 242 }
243 243
244 net::HostResolver* ShellURLRequestContextGetter::host_resolver() { 244 net::HostResolver* ShellURLRequestContextGetter::host_resolver() {
245 return url_request_context_->host_resolver(); 245 return url_request_context_->host_resolver();
246 } 246 }
247 247
248 } // namespace content 248 } // namespace content
OLDNEW
« no previous file with comments | « content/public/test/browser_test_utils.cc ('k') | content/test/layouttest_support.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698