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

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

Issue 382313003: Add data reduction functionality to all platforms. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove incorrect DCHECK from drp_statistics_prefs.cc Created 6 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 "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 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 219
220 net::HttpCache* main_cache = new net::HttpCache( 220 net::HttpCache* main_cache = new net::HttpCache(
221 network_session_params, 221 network_session_params,
222 new net::HttpCache::DefaultBackend( 222 new net::HttpCache::DefaultBackend(
223 net::DISK_CACHE, 223 net::DISK_CACHE,
224 net::CACHE_BACKEND_SIMPLE, 224 net::CACHE_BACKEND_SIMPLE,
225 partition_path_.Append(FILE_PATH_LITERAL("Cache")), 225 partition_path_.Append(FILE_PATH_LITERAL("Cache")),
226 20 * 1024 * 1024, // 20M 226 20 * 1024 * 1024, // 20M
227 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::CACHE))); 227 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::CACHE)));
228 228
229 #if defined(SPDY_PROXY_AUTH_ORIGIN)
230 AwBrowserContext* browser_context = AwBrowserContext::GetDefault(); 229 AwBrowserContext* browser_context = AwBrowserContext::GetDefault();
231 DCHECK(browser_context); 230 DCHECK(browser_context);
232 DataReductionProxySettings* data_reduction_proxy_settings = 231 DataReductionProxySettings* data_reduction_proxy_settings =
233 browser_context->GetDataReductionProxySettings(); 232 browser_context->GetDataReductionProxySettings();
234 DCHECK(data_reduction_proxy_settings); 233 DCHECK(data_reduction_proxy_settings);
235 data_reduction_proxy_auth_request_handler_.reset( 234 data_reduction_proxy_auth_request_handler_.reset(
236 new data_reduction_proxy::DataReductionProxyAuthRequestHandler( 235 new data_reduction_proxy::DataReductionProxyAuthRequestHandler(
237 data_reduction_proxy::kClientAndroidWebview, 236 data_reduction_proxy::kClientAndroidWebview,
238 data_reduction_proxy_settings->params(), 237 data_reduction_proxy_settings->params(),
239 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO))); 238 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO)));
240 239
241 // Compression statistics are not gathered for WebView, so 240 // Compression statistics are not gathered for WebView, so
242 // DataReductionProxyStatisticsPrefs is not instantiated and passed to the 241 // DataReductionProxyStatisticsPrefs is not instantiated and passed to the
243 // network delegate. 242 // network delegate.
244 aw_network_delegate->set_data_reduction_proxy_params( 243 aw_network_delegate->set_data_reduction_proxy_params(
245 data_reduction_proxy_settings->params()); 244 data_reduction_proxy_settings->params());
246 aw_network_delegate->set_data_reduction_proxy_auth_request_handler( 245 aw_network_delegate->set_data_reduction_proxy_auth_request_handler(
247 data_reduction_proxy_auth_request_handler_.get()); 246 data_reduction_proxy_auth_request_handler_.get());
248 #endif
249 247
250 main_http_factory_.reset(main_cache); 248 main_http_factory_.reset(main_cache);
251 url_request_context_->set_http_transaction_factory(main_cache); 249 url_request_context_->set_http_transaction_factory(main_cache);
252 url_request_context_->set_cookie_store(cookie_store_); 250 url_request_context_->set_cookie_store(cookie_store_);
253 251
254 job_factory_ = CreateJobFactory(&protocol_handlers_, 252 job_factory_ = CreateJobFactory(&protocol_handlers_,
255 request_interceptors_.Pass()); 253 request_interceptors_.Pass());
256 url_request_context_->set_job_factory(job_factory_.get()); 254 url_request_context_->set_job_factory(job_factory_.get());
257 } 255 }
258 256
(...skipping 20 matching lines...) Expand all
279 data_reduction_proxy::DataReductionProxyAuthRequestHandler* 277 data_reduction_proxy::DataReductionProxyAuthRequestHandler*
280 AwURLRequestContextGetter::GetDataReductionProxyAuthRequestHandler() const { 278 AwURLRequestContextGetter::GetDataReductionProxyAuthRequestHandler() const {
281 return data_reduction_proxy_auth_request_handler_.get(); 279 return data_reduction_proxy_auth_request_handler_.get();
282 } 280 }
283 281
284 net::NetLog* AwURLRequestContextGetter::GetNetLog() { 282 net::NetLog* AwURLRequestContextGetter::GetNetLog() {
285 return net_log_.get(); 283 return net_log_.get();
286 } 284 }
287 285
288 } // namespace android_webview 286 } // namespace android_webview
OLDNEW
« no previous file with comments | « android_webview/browser/aw_browser_context.cc ('k') | chrome/browser/android/intercept_download_resource_throttle.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698