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

Side by Side Diff: android_webview/browser/net/aw_url_request_context_getter.cc

Issue 742023003: Enable using system proxy resolver for android webview. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address mnaganov's nit Created 6 years, 1 month 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 "android_webview/browser/net/aw_url_request_context_getter.h" 5 #include "android_webview/browser/net/aw_url_request_context_getter.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "android_webview/browser/aw_browser_context.h" 9 #include "android_webview/browser/aw_browser_context.h"
10 #include "android_webview/browser/aw_content_browser_client.h" 10 #include "android_webview/browser/aw_content_browser_client.h"
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 193 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
194 DCHECK(!url_request_context_); 194 DCHECK(!url_request_context_);
195 195
196 net::URLRequestContextBuilder builder; 196 net::URLRequestContextBuilder builder;
197 builder.set_user_agent(GetUserAgent()); 197 builder.set_user_agent(GetUserAgent());
198 AwNetworkDelegate* aw_network_delegate = new AwNetworkDelegate(); 198 AwNetworkDelegate* aw_network_delegate = new AwNetworkDelegate();
199 builder.set_network_delegate(aw_network_delegate); 199 builder.set_network_delegate(aw_network_delegate);
200 #if !defined(DISABLE_FTP_SUPPORT) 200 #if !defined(DISABLE_FTP_SUPPORT)
201 builder.set_ftp_enabled(false); // Android WebView does not support ftp yet. 201 builder.set_ftp_enabled(false); // Android WebView does not support ftp yet.
202 #endif 202 #endif
203 if (data_reduction_proxy_config_service_.get()) { 203 DCHECK(data_reduction_proxy_config_service_.get());
204 builder.set_proxy_config_service( 204 // Create proxy without a resolver since we rely on system proxy resolver.
eroman 2014/11/21 01:55:15 I don't follow this comment. If no ProxyResolver i
sgurun-gerrit only 2014/11/21 02:13:37 Himm, there is some background to this. Android pr
205 data_reduction_proxy_config_service_.release()); 205 builder.set_proxy_service(
206 } else { 206 net::ProxyService::CreateWithoutProxyResolver(
207 builder.set_proxy_config_service( 207 data_reduction_proxy_config_service_.release(),
208 net::ProxyService::CreateSystemProxyConfigService( 208 net_log_.get()));
209 GetNetworkTaskRunner(), NULL /* Ignored on Android */ ));
210 }
211 builder.set_accept_language(net::HttpUtil::GenerateAcceptLanguageHeader( 209 builder.set_accept_language(net::HttpUtil::GenerateAcceptLanguageHeader(
212 AwContentBrowserClient::GetAcceptLangsImpl())); 210 AwContentBrowserClient::GetAcceptLangsImpl()));
213 builder.set_net_log(net_log_.get()); 211 builder.set_net_log(net_log_.get());
214 builder.set_channel_id_enabled(false); 212 builder.set_channel_id_enabled(false);
215 ApplyCmdlineOverridesToURLRequestContextBuilder(&builder); 213 ApplyCmdlineOverridesToURLRequestContextBuilder(&builder);
216 214
217 url_request_context_.reset(builder.Build()); 215 url_request_context_.reset(builder.Build());
218 // TODO(mnaganov): Fix URLRequestContextBuilder to use proper threads. 216 // TODO(mnaganov): Fix URLRequestContextBuilder to use proper threads.
219 net::HttpNetworkSession::Params network_session_params; 217 net::HttpNetworkSession::Params network_session_params;
220 218
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 net::NetLog* AwURLRequestContextGetter::GetNetLog() { 289 net::NetLog* AwURLRequestContextGetter::GetNetLog() {
292 return net_log_.get(); 290 return net_log_.get();
293 } 291 }
294 292
295 void AwURLRequestContextGetter::SetKeyOnIO(const std::string& key) { 293 void AwURLRequestContextGetter::SetKeyOnIO(const std::string& key) {
296 DCHECK(data_reduction_proxy_auth_request_handler_); 294 DCHECK(data_reduction_proxy_auth_request_handler_);
297 data_reduction_proxy_auth_request_handler_->InitAuthentication(key); 295 data_reduction_proxy_auth_request_handler_->InitAuthentication(key);
298 } 296 }
299 297
300 } // namespace android_webview 298 } // namespace android_webview
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698