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

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

Issue 803813003: Make callers of CommandLine use it via the base:: namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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
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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 net::ProxyService* ShellURLRequestContextGetter::GetProxyService() { 99 net::ProxyService* ShellURLRequestContextGetter::GetProxyService() {
100 // TODO(jam): use v8 if possible, look at chrome code. 100 // TODO(jam): use v8 if possible, look at chrome code.
101 return net::ProxyService::CreateUsingSystemProxyResolver( 101 return net::ProxyService::CreateUsingSystemProxyResolver(
102 proxy_config_service_.release(), 0, url_request_context_->net_log()); 102 proxy_config_service_.release(), 0, url_request_context_->net_log());
103 } 103 }
104 104
105 net::URLRequestContext* ShellURLRequestContextGetter::GetURLRequestContext() { 105 net::URLRequestContext* ShellURLRequestContextGetter::GetURLRequestContext() {
106 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 106 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
107 107
108 if (!url_request_context_) { 108 if (!url_request_context_) {
109 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); 109 const base::CommandLine& command_line =
110 *base::CommandLine::ForCurrentProcess();
110 111
111 url_request_context_.reset(new net::URLRequestContext()); 112 url_request_context_.reset(new net::URLRequestContext());
112 url_request_context_->set_net_log(net_log_); 113 url_request_context_->set_net_log(net_log_);
113 network_delegate_.reset(CreateNetworkDelegate()); 114 network_delegate_.reset(CreateNetworkDelegate());
114 url_request_context_->set_network_delegate(network_delegate_.get()); 115 url_request_context_->set_network_delegate(network_delegate_.get());
115 storage_.reset( 116 storage_.reset(
116 new net::URLRequestContextStorage(url_request_context_.get())); 117 new net::URLRequestContextStorage(url_request_context_.get()));
117 storage_->set_cookie_store(CreateCookieStore(CookieStoreConfig())); 118 storage_->set_cookie_store(CreateCookieStore(CookieStoreConfig()));
118 storage_->set_channel_id_service(new net::ChannelIDService( 119 storage_->set_channel_id_service(new net::ChannelIDService(
119 new net::DefaultChannelIDStore(NULL), 120 new net::DefaultChannelIDStore(NULL),
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 scoped_refptr<base::SingleThreadTaskRunner> 240 scoped_refptr<base::SingleThreadTaskRunner>
240 ShellURLRequestContextGetter::GetNetworkTaskRunner() const { 241 ShellURLRequestContextGetter::GetNetworkTaskRunner() const {
241 return BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO); 242 return BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO);
242 } 243 }
243 244
244 net::HostResolver* ShellURLRequestContextGetter::host_resolver() { 245 net::HostResolver* ShellURLRequestContextGetter::host_resolver() {
245 return url_request_context_->host_resolver(); 246 return url_request_context_->host_resolver();
246 } 247 }
247 248
248 } // namespace content 249 } // namespace content
OLDNEW
« no previous file with comments | « content/shell/browser/shell_net_log.cc ('k') | content/shell/browser/shell_web_contents_view_delegate_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698