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

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

Issue 279633003: Use non-static set_key interface on DataReductionProxySettings (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 7 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_content_browser_client.h" 10 #include "android_webview/browser/aw_content_browser_client.h"
10 #include "android_webview/browser/aw_request_interceptor.h" 11 #include "android_webview/browser/aw_request_interceptor.h"
11 #include "android_webview/browser/net/aw_network_delegate.h" 12 #include "android_webview/browser/net/aw_network_delegate.h"
12 #include "android_webview/browser/net/aw_url_request_job_factory.h" 13 #include "android_webview/browser/net/aw_url_request_job_factory.h"
13 #include "android_webview/browser/net/init_native_callback.h" 14 #include "android_webview/browser/net/init_native_callback.h"
14 #include "android_webview/common/aw_content_client.h" 15 #include "android_webview/common/aw_content_client.h"
15 #include "base/command_line.h" 16 #include "base/command_line.h"
16 #include "base/strings/string_number_conversions.h" 17 #include "base/strings/string_number_conversions.h"
17 #include "base/threading/sequenced_worker_pool.h" 18 #include "base/threading/sequenced_worker_pool.h"
18 #include "components/data_reduction_proxy/browser/data_reduction_proxy_config_se rvice.h" 19 #include "components/data_reduction_proxy/browser/data_reduction_proxy_config_se rvice.h"
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 209
209 net::HttpCache* main_cache = new net::HttpCache( 210 net::HttpCache* main_cache = new net::HttpCache(
210 network_session_params, 211 network_session_params,
211 new net::HttpCache::DefaultBackend( 212 new net::HttpCache::DefaultBackend(
212 net::DISK_CACHE, 213 net::DISK_CACHE,
213 net::CACHE_BACKEND_SIMPLE, 214 net::CACHE_BACKEND_SIMPLE,
214 partition_path_.Append(FILE_PATH_LITERAL("Cache")), 215 partition_path_.Append(FILE_PATH_LITERAL("Cache")),
215 20 * 1024 * 1024, // 20M 216 20 * 1024 * 1024, // 20M
216 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::CACHE))); 217 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::CACHE)));
217 218
219 AwBrowserContext* browser_context = AwBrowserContext::GetDefault();
220 DCHECK(browser_context);
221 DataReductionProxySettings* drp_settings =
222 browser_context->GetDataReductionProxySettings();
223 DCHECK(drp_settings);
218 DataReductionProxySettings::InitDataReductionProxySession( 224 DataReductionProxySettings::InitDataReductionProxySession(
219 main_cache->GetSession()); 225 main_cache->GetSession(), drp_settings->key());
sgurun-gerrit only 2014/05/09 00:58:28 I am not sure about this logic. The key may not be
bengr 2014/05/09 03:16:51 InitDataReductionProxySession constructs credentia
220 226
221 main_http_factory_.reset(main_cache); 227 main_http_factory_.reset(main_cache);
222 url_request_context_->set_http_transaction_factory(main_cache); 228 url_request_context_->set_http_transaction_factory(main_cache);
223 url_request_context_->set_cookie_store(cookie_store_); 229 url_request_context_->set_cookie_store(cookie_store_);
224 230
225 job_factory_ = CreateJobFactory(&protocol_handlers_); 231 job_factory_ = CreateJobFactory(&protocol_handlers_);
226 url_request_context_->set_job_factory(job_factory_.get()); 232 url_request_context_->set_job_factory(job_factory_.get());
227 233
228 // TODO(sgurun) remove once crbug.com/329681 is fixed. Should be 234 // TODO(sgurun) remove once crbug.com/329681 is fixed. Should be
229 // called only once. 235 // called only once.
(...skipping 18 matching lines...) Expand all
248 std::swap(protocol_handlers_, *protocol_handlers); 254 std::swap(protocol_handlers_, *protocol_handlers);
249 } 255 }
250 256
251 DataReductionProxyConfigService* 257 DataReductionProxyConfigService*
252 AwURLRequestContextGetter::proxy_config_service() { 258 AwURLRequestContextGetter::proxy_config_service() {
253 // TODO(bengr): return system config if data reduction proxy is disabled. 259 // TODO(bengr): return system config if data reduction proxy is disabled.
254 return proxy_config_service_.get(); 260 return proxy_config_service_.get();
255 } 261 }
256 262
257 } // namespace android_webview 263 } // namespace android_webview
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698