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

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 eroman's comments 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
« no previous file with comments | « android_webview/browser/aw_browser_context.cc ('k') | net/proxy/proxy_config_service_android.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 "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 // Android provides a local HTTP proxy that handles all the proxying.
205 data_reduction_proxy_config_service_.release()); 205 // Create the proxy without a resolver since we rely on this local HTTP proxy.
206 } else { 206 // TODO(sgurun) is this behavior guaranteed through SDK?
207 builder.set_proxy_config_service( 207 builder.set_proxy_service(
208 net::ProxyService::CreateSystemProxyConfigService( 208 net::ProxyService::CreateWithoutProxyResolver(
209 GetNetworkTaskRunner(), NULL /* Ignored on Android */ )); 209 data_reduction_proxy_config_service_.release(),
210 } 210 net_log_.get()));
211 builder.set_accept_language(net::HttpUtil::GenerateAcceptLanguageHeader( 211 builder.set_accept_language(net::HttpUtil::GenerateAcceptLanguageHeader(
212 AwContentBrowserClient::GetAcceptLangsImpl())); 212 AwContentBrowserClient::GetAcceptLangsImpl()));
213 builder.set_net_log(net_log_.get()); 213 builder.set_net_log(net_log_.get());
214 builder.set_channel_id_enabled(false); 214 builder.set_channel_id_enabled(false);
215 ApplyCmdlineOverridesToURLRequestContextBuilder(&builder); 215 ApplyCmdlineOverridesToURLRequestContextBuilder(&builder);
216 216
217 url_request_context_.reset(builder.Build()); 217 url_request_context_.reset(builder.Build());
218 // TODO(mnaganov): Fix URLRequestContextBuilder to use proper threads. 218 // TODO(mnaganov): Fix URLRequestContextBuilder to use proper threads.
219 net::HttpNetworkSession::Params network_session_params; 219 net::HttpNetworkSession::Params network_session_params;
220 220
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 net::NetLog* AwURLRequestContextGetter::GetNetLog() { 291 net::NetLog* AwURLRequestContextGetter::GetNetLog() {
292 return net_log_.get(); 292 return net_log_.get();
293 } 293 }
294 294
295 void AwURLRequestContextGetter::SetKeyOnIO(const std::string& key) { 295 void AwURLRequestContextGetter::SetKeyOnIO(const std::string& key) {
296 DCHECK(data_reduction_proxy_auth_request_handler_); 296 DCHECK(data_reduction_proxy_auth_request_handler_);
297 data_reduction_proxy_auth_request_handler_->InitAuthentication(key); 297 data_reduction_proxy_auth_request_handler_->InitAuthentication(key);
298 } 298 }
299 299
300 } // namespace android_webview 300 } // namespace android_webview
OLDNEW
« no previous file with comments | « android_webview/browser/aw_browser_context.cc ('k') | net/proxy/proxy_config_service_android.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698