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

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

Issue 2341693002: Re-write many calls to WrapUnique() with MakeUnique() (Closed)
Patch Set: Change std::string() back to "" to fix compile 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 (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 <memory> 7 #include <memory>
8 #include <string> 8 #include <string>
9 9
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
11 #include "net/proxy/proxy_config_service_fixed.h" 11 #include "net/proxy/proxy_config_service_fixed.h"
12 #include "net/url_request/url_request_context.h" 12 #include "net/url_request/url_request_context.h"
13 #include "net/url_request/url_request_context_builder.h" 13 #include "net/url_request/url_request_context_builder.h"
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 : network_task_runner_(network_task_runner) { 17 : network_task_runner_(network_task_runner) {
18 } 18 }
19 19
20 net::URLRequestContext* URLRequestContextGetter::GetURLRequestContext() { 20 net::URLRequestContext* URLRequestContextGetter::GetURLRequestContext() {
21 CHECK(network_task_runner_->BelongsToCurrentThread()); 21 CHECK(network_task_runner_->BelongsToCurrentThread());
22 if (!url_request_context_) { 22 if (!url_request_context_) {
23 net::URLRequestContextBuilder builder; 23 net::URLRequestContextBuilder builder;
24 // net::HttpServer fails to parse headers if user-agent header is blank. 24 // net::HttpServer fails to parse headers if user-agent header is blank.
25 builder.set_user_agent("chromedriver"); 25 builder.set_user_agent("chromedriver");
26 builder.DisableHttpCache(); 26 builder.DisableHttpCache();
27 builder.set_proxy_config_service(base::WrapUnique( 27 builder.set_proxy_config_service(
28 new net::ProxyConfigServiceFixed(net::ProxyConfig::CreateDirect()))); 28 base::MakeUnique<net::ProxyConfigServiceFixed>(
29 net::ProxyConfig::CreateDirect()));
29 url_request_context_ = builder.Build(); 30 url_request_context_ = builder.Build();
30 } 31 }
31 return url_request_context_.get(); 32 return url_request_context_.get();
32 } 33 }
33 34
34 scoped_refptr<base::SingleThreadTaskRunner> 35 scoped_refptr<base::SingleThreadTaskRunner>
35 URLRequestContextGetter::GetNetworkTaskRunner() const { 36 URLRequestContextGetter::GetNetworkTaskRunner() const {
36 return network_task_runner_; 37 return network_task_runner_;
37 } 38 }
38 39
39 URLRequestContextGetter::~URLRequestContextGetter() {} 40 URLRequestContextGetter::~URLRequestContextGetter() {}
OLDNEW
« no previous file with comments | « chrome/test/chromedriver/commands.cc ('k') | chrome/utility/importer/edge_database_reader_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698