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

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

Issue 2133083002: Remove all remaining traces of MessageLoopProxy. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 <utility> 7 #include <utility>
8 #include <vector> 8 #include <vector>
9 9
10 #include "android_webview/browser/aw_browser_context.h" 10 #include "android_webview/browser/aw_browser_context.h"
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 std::unique_ptr<net::ProxyConfigService> config_service, 171 std::unique_ptr<net::ProxyConfigService> config_service,
172 PrefService* user_pref_service) 172 PrefService* user_pref_service)
173 : cache_path_(cache_path), 173 : cache_path_(cache_path),
174 net_log_(new net::NetLog()), 174 net_log_(new net::NetLog()),
175 proxy_config_service_(std::move(config_service)), 175 proxy_config_service_(std::move(config_service)),
176 http_user_agent_settings_(new AwHttpUserAgentSettings()) { 176 http_user_agent_settings_(new AwHttpUserAgentSettings()) {
177 // CreateSystemProxyConfigService for Android must be called on main thread. 177 // CreateSystemProxyConfigService for Android must be called on main thread.
178 DCHECK_CURRENTLY_ON(BrowserThread::UI); 178 DCHECK_CURRENTLY_ON(BrowserThread::UI);
179 179
180 scoped_refptr<base::SingleThreadTaskRunner> io_thread_proxy = 180 scoped_refptr<base::SingleThreadTaskRunner> io_thread_proxy =
181 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO); 181 BrowserThread::GetTaskRunnerForThread(BrowserThread::IO);
182 182
183 auth_server_whitelist_.Init( 183 auth_server_whitelist_.Init(
184 prefs::kAuthServerWhitelist, user_pref_service, 184 prefs::kAuthServerWhitelist, user_pref_service,
185 base::Bind(&AwURLRequestContextGetter::UpdateServerWhitelist, 185 base::Bind(&AwURLRequestContextGetter::UpdateServerWhitelist,
186 base::Unretained(this))); 186 base::Unretained(this)));
187 auth_server_whitelist_.MoveToThread(io_thread_proxy); 187 auth_server_whitelist_.MoveToThread(io_thread_proxy);
188 188
189 auth_android_negotiate_account_type_.Init( 189 auth_android_negotiate_account_type_.Init(
190 prefs::kAuthAndroidNegotiateAccountType, user_pref_service, 190 prefs::kAuthAndroidNegotiateAccountType, user_pref_service,
191 base::Bind( 191 base::Bind(
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 base::WrapUnique(new AwCookieStoreWrapper()), 236 base::WrapUnique(new AwCookieStoreWrapper()),
237 std::move(channel_id_service)); 237 std::move(channel_id_service));
238 238
239 net::URLRequestContextBuilder::HttpCacheParams cache_params; 239 net::URLRequestContextBuilder::HttpCacheParams cache_params;
240 cache_params.type = 240 cache_params.type =
241 net::URLRequestContextBuilder::HttpCacheParams::DISK_SIMPLE; 241 net::URLRequestContextBuilder::HttpCacheParams::DISK_SIMPLE;
242 cache_params.max_size = 20 * 1024 * 1024; // 20M 242 cache_params.max_size = 20 * 1024 * 1024; // 20M
243 cache_params.path = cache_path_; 243 cache_params.path = cache_path_;
244 builder.EnableHttpCache(cache_params); 244 builder.EnableHttpCache(cache_params);
245 builder.SetFileTaskRunner( 245 builder.SetFileTaskRunner(
246 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::CACHE)); 246 BrowserThread::GetTaskRunnerForThread(BrowserThread::CACHE));
247 247
248 net::URLRequestContextBuilder::HttpNetworkSessionParams 248 net::URLRequestContextBuilder::HttpNetworkSessionParams
249 network_session_params; 249 network_session_params;
250 ApplyCmdlineOverridesToNetworkSessionParams(&network_session_params); 250 ApplyCmdlineOverridesToNetworkSessionParams(&network_session_params);
251 builder.set_http_network_session_params(network_session_params); 251 builder.set_http_network_session_params(network_session_params);
252 builder.SetSpdyAndQuicEnabled(true, false); 252 builder.SetSpdyAndQuicEnabled(true, false);
253 253
254 std::unique_ptr<net::MappedHostResolver> host_resolver( 254 std::unique_ptr<net::MappedHostResolver> host_resolver(
255 new net::MappedHostResolver( 255 new net::MappedHostResolver(
256 net::HostResolver::CreateDefaultResolver(nullptr))); 256 net::HostResolver::CreateDefaultResolver(nullptr)));
(...skipping 14 matching lines...) Expand all
271 net::URLRequestContext* AwURLRequestContextGetter::GetURLRequestContext() { 271 net::URLRequestContext* AwURLRequestContextGetter::GetURLRequestContext() {
272 DCHECK_CURRENTLY_ON(BrowserThread::IO); 272 DCHECK_CURRENTLY_ON(BrowserThread::IO);
273 if (!url_request_context_) 273 if (!url_request_context_)
274 InitializeURLRequestContext(); 274 InitializeURLRequestContext();
275 275
276 return url_request_context_.get(); 276 return url_request_context_.get();
277 } 277 }
278 278
279 scoped_refptr<base::SingleThreadTaskRunner> 279 scoped_refptr<base::SingleThreadTaskRunner>
280 AwURLRequestContextGetter::GetNetworkTaskRunner() const { 280 AwURLRequestContextGetter::GetNetworkTaskRunner() const {
281 return BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO); 281 return BrowserThread::GetTaskRunnerForThread(BrowserThread::IO);
282 } 282 }
283 283
284 void AwURLRequestContextGetter::SetHandlersAndInterceptors( 284 void AwURLRequestContextGetter::SetHandlersAndInterceptors(
285 content::ProtocolHandlerMap* protocol_handlers, 285 content::ProtocolHandlerMap* protocol_handlers,
286 content::URLRequestInterceptorScopedVector request_interceptors) { 286 content::URLRequestInterceptorScopedVector request_interceptors) {
287 std::swap(protocol_handlers_, *protocol_handlers); 287 std::swap(protocol_handlers_, *protocol_handlers);
288 request_interceptors_.swap(request_interceptors); 288 request_interceptors_.swap(request_interceptors);
289 } 289 }
290 290
291 net::NetLog* AwURLRequestContextGetter::GetNetLog() { 291 net::NetLog* AwURLRequestContextGetter::GetNetLog() {
(...skipping 22 matching lines...) Expand all
314 http_auth_preferences_->set_server_whitelist( 314 http_auth_preferences_->set_server_whitelist(
315 auth_server_whitelist_.GetValue()); 315 auth_server_whitelist_.GetValue());
316 } 316 }
317 317
318 void AwURLRequestContextGetter::UpdateAndroidAuthNegotiateAccountType() { 318 void AwURLRequestContextGetter::UpdateAndroidAuthNegotiateAccountType() {
319 http_auth_preferences_->set_auth_android_negotiate_account_type( 319 http_auth_preferences_->set_auth_android_negotiate_account_type(
320 auth_android_negotiate_account_type_.GetValue()); 320 auth_android_negotiate_account_type_.GetValue());
321 } 321 }
322 322
323 } // namespace android_webview 323 } // namespace android_webview
OLDNEW
« no previous file with comments | « android_webview/browser/aw_form_database_service.cc ('k') | android_webview/native/aw_contents.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698