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

Side by Side Diff: remoting/base/url_request_context_getter.cc

Issue 1303493002: Make UrlRequestContextBuilder take scoped_ptr's (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: sync and fix tiny resulting build failure Created 5 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
« no previous file with comments | « remoting/base/url_request_context_getter.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "remoting/base/url_request_context_getter.h" 5 #include "remoting/base/url_request_context_getter.h"
6 6
7 #include "base/single_thread_task_runner.h" 7 #include "base/single_thread_task_runner.h"
8 #include "net/proxy/proxy_config_service.h" 8 #include "net/proxy/proxy_config_service.h"
9 #include "net/url_request/url_request_context.h" 9 #include "net/url_request/url_request_context.h"
10 #include "net/url_request/url_request_context_builder.h" 10 #include "net/url_request/url_request_context_builder.h"
11 #include "remoting/base/vlog_net_log.h" 11 #include "remoting/base/vlog_net_log.h"
12 12
13 namespace remoting { 13 namespace remoting {
14 14
15 URLRequestContextGetter::URLRequestContextGetter( 15 URLRequestContextGetter::URLRequestContextGetter(
16 scoped_refptr<base::SingleThreadTaskRunner> network_task_runner, 16 scoped_refptr<base::SingleThreadTaskRunner> network_task_runner,
17 scoped_refptr<base::SingleThreadTaskRunner> file_task_runner) 17 scoped_refptr<base::SingleThreadTaskRunner> file_task_runner)
18 : network_task_runner_(network_task_runner), 18 : network_task_runner_(network_task_runner),
19 file_task_runner_(file_task_runner) { 19 file_task_runner_(file_task_runner) {
20 proxy_config_service_.reset(net::ProxyService::CreateSystemProxyConfigService( 20 proxy_config_service_.reset(net::ProxyService::CreateSystemProxyConfigService(
21 network_task_runner_, file_task_runner)); 21 network_task_runner_, file_task_runner));
22 } 22 }
23 23
24 net::URLRequestContext* URLRequestContextGetter::GetURLRequestContext() { 24 net::URLRequestContext* URLRequestContextGetter::GetURLRequestContext() {
25 if (!url_request_context_.get()) { 25 if (!url_request_context_.get()) {
26 net::URLRequestContextBuilder builder; 26 net::URLRequestContextBuilder builder;
27 builder.SetFileTaskRunner(file_task_runner_); 27 builder.SetFileTaskRunner(file_task_runner_);
28 builder.set_net_log(new VlogNetLog()); 28 net_log_.reset(new VlogNetLog());
29 builder.set_net_log(net_log_.get());
29 builder.DisableHttpCache(); 30 builder.DisableHttpCache();
30 builder.set_proxy_config_service(proxy_config_service_.release()); 31 builder.set_proxy_config_service(proxy_config_service_.Pass());
31 url_request_context_.reset(builder.Build()); 32 url_request_context_ = builder.Build().Pass();
32 } 33 }
33 return url_request_context_.get(); 34 return url_request_context_.get();
34 } 35 }
35 36
36 scoped_refptr<base::SingleThreadTaskRunner> 37 scoped_refptr<base::SingleThreadTaskRunner>
37 URLRequestContextGetter::GetNetworkTaskRunner() const { 38 URLRequestContextGetter::GetNetworkTaskRunner() const {
38 return network_task_runner_; 39 return network_task_runner_;
39 } 40 }
40 41
41 URLRequestContextGetter::~URLRequestContextGetter() { 42 URLRequestContextGetter::~URLRequestContextGetter() {
42 } 43 }
43 44
44 } // namespace remoting 45 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/base/url_request_context_getter.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698