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: headless/lib/browser/headless_url_request_context_getter.cc

Issue 2944313003: Remove the dependence on BrowserThread::FILE for (Closed)
Patch Set: address mmenke's comments Created 3 years, 6 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "headless/lib/browser/headless_url_request_context_getter.h" 5 #include "headless/lib/browser/headless_url_request_context_getter.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <utility> 8 #include <utility>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 protocol_handlers_[pair.first] = 44 protocol_handlers_[pair.first] =
45 linked_ptr<net::URLRequestJobFactory::ProtocolHandler>( 45 linked_ptr<net::URLRequestJobFactory::ProtocolHandler>(
46 pair.second.release()); 46 pair.second.release());
47 } 47 }
48 context_protocol_handlers.clear(); 48 context_protocol_handlers.clear();
49 49
50 // We must create the proxy config service on the UI loop on Linux because it 50 // We must create the proxy config service on the UI loop on Linux because it
51 // must synchronously run on the glib message loop. This will be passed to 51 // must synchronously run on the glib message loop. This will be passed to
52 // the URLRequestContextStorage on the IO thread in GetURLRequestContext(). 52 // the URLRequestContextStorage on the IO thread in GetURLRequestContext().
53 if (proxy_server_.IsEmpty()) { 53 if (proxy_server_.IsEmpty()) {
54 proxy_config_service_ = net::ProxyService::CreateSystemProxyConfigService( 54 proxy_config_service_ =
55 io_task_runner_, file_task_runner_); 55 net::ProxyService::CreateSystemProxyConfigService(io_task_runner_);
56 } 56 }
57 } 57 }
58 58
59 HeadlessURLRequestContextGetter::~HeadlessURLRequestContextGetter() {} 59 HeadlessURLRequestContextGetter::~HeadlessURLRequestContextGetter() {}
60 60
61 net::URLRequestContext* 61 net::URLRequestContext*
62 HeadlessURLRequestContextGetter::GetURLRequestContext() { 62 HeadlessURLRequestContextGetter::GetURLRequestContext() {
63 DCHECK_CURRENTLY_ON(content::BrowserThread::IO); 63 DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
64 if (!url_request_context_) { 64 if (!url_request_context_) {
65 net::URLRequestContextBuilder builder; 65 net::URLRequestContextBuilder builder;
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 scoped_refptr<base::SingleThreadTaskRunner> 103 scoped_refptr<base::SingleThreadTaskRunner>
104 HeadlessURLRequestContextGetter::GetNetworkTaskRunner() const { 104 HeadlessURLRequestContextGetter::GetNetworkTaskRunner() const {
105 return io_task_runner_; 105 return io_task_runner_;
106 } 106 }
107 107
108 net::HostResolver* HeadlessURLRequestContextGetter::host_resolver() const { 108 net::HostResolver* HeadlessURLRequestContextGetter::host_resolver() const {
109 return url_request_context_->host_resolver(); 109 return url_request_context_->host_resolver();
110 } 110 }
111 111
112 } // namespace headless 112 } // namespace headless
OLDNEW
« no previous file with comments | « content/shell/browser/shell_url_request_context_getter.cc ('k') | ios/crnet/crnet_environment.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698