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

Side by Side Diff: chrome/test/chromedriver/net/url_request_context_getter.cc

Issue 1525263003: Revert of Remove ScopedVector from url_request_context_builder (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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 | « no previous file | net/url_request/url_request_context_builder.h » ('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 (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 "chrome/test/chromedriver/net/url_request_context_getter.h" 5 #include "chrome/test/chromedriver/net/url_request_context_getter.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/memory/scoped_ptr.h"
10 #include "net/proxy/proxy_config_service_fixed.h" 9 #include "net/proxy/proxy_config_service_fixed.h"
11 #include "net/url_request/url_request_context.h" 10 #include "net/url_request/url_request_context.h"
12 #include "net/url_request/url_request_context_builder.h" 11 #include "net/url_request/url_request_context_builder.h"
13 12
14 URLRequestContextGetter::URLRequestContextGetter( 13 URLRequestContextGetter::URLRequestContextGetter(
15 scoped_refptr<base::SingleThreadTaskRunner> network_task_runner) 14 scoped_refptr<base::SingleThreadTaskRunner> network_task_runner)
16 : network_task_runner_(network_task_runner) { 15 : network_task_runner_(network_task_runner) {
17 } 16 }
18 17
19 net::URLRequestContext* URLRequestContextGetter::GetURLRequestContext() { 18 net::URLRequestContext* URLRequestContextGetter::GetURLRequestContext() {
20 CHECK(network_task_runner_->BelongsToCurrentThread()); 19 CHECK(network_task_runner_->BelongsToCurrentThread());
21 if (!url_request_context_) { 20 if (!url_request_context_) {
22 net::URLRequestContextBuilder builder; 21 net::URLRequestContextBuilder builder;
23 // net::HttpServer fails to parse headers if user-agent header is blank. 22 // net::HttpServer fails to parse headers if user-agent header is blank.
24 builder.set_user_agent("chromedriver"); 23 builder.set_user_agent("chromedriver");
25 builder.DisableHttpCache(); 24 builder.DisableHttpCache();
26 builder.set_proxy_config_service(make_scoped_ptr( 25 builder.set_proxy_config_service(make_scoped_ptr(
27 new net::ProxyConfigServiceFixed(net::ProxyConfig::CreateDirect()))); 26 new net::ProxyConfigServiceFixed(net::ProxyConfig::CreateDirect())));
28 url_request_context_ = builder.Build().Pass(); 27 url_request_context_ = builder.Build().Pass();
29 } 28 }
30 return url_request_context_.get(); 29 return url_request_context_.get();
31 } 30 }
32 31
33 scoped_refptr<base::SingleThreadTaskRunner> 32 scoped_refptr<base::SingleThreadTaskRunner>
34 URLRequestContextGetter::GetNetworkTaskRunner() const { 33 URLRequestContextGetter::GetNetworkTaskRunner() const {
35 return network_task_runner_; 34 return network_task_runner_;
36 } 35 }
37 36
38 URLRequestContextGetter::~URLRequestContextGetter() {} 37 URLRequestContextGetter::~URLRequestContextGetter() {}
OLDNEW
« no previous file with comments | « no previous file | net/url_request/url_request_context_builder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698