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

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

Issue 12387028: Fix for CookieManager init race condition (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | android_webview/browser/net/init_native_callback.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 "android_webview/browser/aw_browser_context.h" 7 #include "android_webview/browser/aw_browser_context.h"
8 #include "android_webview/browser/aw_request_interceptor.h" 8 #include "android_webview/browser/aw_request_interceptor.h"
9 #include "android_webview/browser/net/aw_network_delegate.h" 9 #include "android_webview/browser/net/aw_network_delegate.h"
10 #include "android_webview/browser/net/aw_url_request_job_factory.h" 10 #include "android_webview/browser/net/aw_url_request_job_factory.h"
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 PopulateNetworkSessionParams(&network_session_params); 65 PopulateNetworkSessionParams(&network_session_params);
66 net::HttpCache* main_cache = new net::HttpCache( 66 net::HttpCache* main_cache = new net::HttpCache(
67 network_session_params, 67 network_session_params,
68 new net::HttpCache::DefaultBackend( 68 new net::HttpCache::DefaultBackend(
69 net::DISK_CACHE, 69 net::DISK_CACHE,
70 browser_context_->GetPath().Append(FILE_PATH_LITERAL("Cache")), 70 browser_context_->GetPath().Append(FILE_PATH_LITERAL("Cache")),
71 10 * 1024 * 1024, // 10M 71 10 * 1024 * 1024, // 10M
72 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::CACHE))); 72 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::CACHE)));
73 main_http_factory_.reset(main_cache); 73 main_http_factory_.reset(main_cache);
74 url_request_context_->set_http_transaction_factory(main_cache); 74 url_request_context_->set_http_transaction_factory(main_cache);
75
76 DidCreateURLRequestContextOnIOThread(url_request_context_.get());
boliu 2013/03/01 00:19:06 This is not true...the getter is initialized but t
Kristian Monsen 2013/03/01 00:19:08 Can this safely be used before the job factory is
joth 2013/03/01 00:28:13 I think you mean the opposite? the request context
75 } 77 }
76 78
77 void AwURLRequestContextGetter::PopulateNetworkSessionParams( 79 void AwURLRequestContextGetter::PopulateNetworkSessionParams(
78 net::HttpNetworkSession::Params* params) { 80 net::HttpNetworkSession::Params* params) {
79 net::URLRequestContext* context = url_request_context_.get(); 81 net::URLRequestContext* context = url_request_context_.get();
80 params->host_resolver = context->host_resolver(); 82 params->host_resolver = context->host_resolver();
81 params->cert_verifier = context->cert_verifier(); 83 params->cert_verifier = context->cert_verifier();
82 params->server_bound_cert_service = context->server_bound_cert_service(); 84 params->server_bound_cert_service = context->server_bound_cert_service();
83 params->transport_security_state = context->transport_security_state(); 85 params->transport_security_state = context->transport_security_state();
84 params->proxy_service = context->proxy_service(); 86 params->proxy_service = context->proxy_service();
(...skipping 26 matching lines...) Expand all
111 set_protocol = job_factory->SetProtocolHandler( 113 set_protocol = job_factory->SetProtocolHandler(
112 chrome::kChromeUIScheme, chrome_protocol_handler_.release()); 114 chrome::kChromeUIScheme, chrome_protocol_handler_.release());
113 DCHECK(set_protocol); 115 DCHECK(set_protocol);
114 DCHECK(chrome_devtools_protocol_handler_); 116 DCHECK(chrome_devtools_protocol_handler_);
115 set_protocol = job_factory->SetProtocolHandler( 117 set_protocol = job_factory->SetProtocolHandler(
116 chrome::kChromeDevToolsScheme, 118 chrome::kChromeDevToolsScheme,
117 chrome_devtools_protocol_handler_.release()); 119 chrome_devtools_protocol_handler_.release());
118 DCHECK(set_protocol); 120 DCHECK(set_protocol);
119 // Create a chain of URLRequestJobFactories. Keep |job_factory_| pointed 121 // Create a chain of URLRequestJobFactories. Keep |job_factory_| pointed
120 // at the beginning of the chain. 122 // at the beginning of the chain.
121 job_factory_ = CreateAndroidJobFactoryAndCookieMonster( 123 job_factory_ = CreateAndroidJobFactory(job_factory.Pass());
122 url_request_context_.get(), job_factory.Pass());
123 job_factory_.reset(new net::ProtocolInterceptJobFactory( 124 job_factory_.reset(new net::ProtocolInterceptJobFactory(
124 job_factory_.Pass(), 125 job_factory_.Pass(),
125 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>( 126 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>(
126 new AwRequestInterceptor()))); 127 new AwRequestInterceptor())));
127 job_factory_.reset(new net::ProtocolInterceptJobFactory( 128 job_factory_.reset(new net::ProtocolInterceptJobFactory(
128 job_factory_.Pass(), 129 job_factory_.Pass(),
129 developer_protocol_handler_.Pass())); 130 developer_protocol_handler_.Pass()));
130 url_request_context_->set_job_factory(job_factory_.get()); 131 url_request_context_->set_job_factory(job_factory_.get());
131 } 132 }
132 return url_request_context_.get(); 133 return url_request_context_.get();
(...skipping 16 matching lines...) Expand all
149 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> 150 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
150 chrome_devtools_protocol_handler) { 151 chrome_devtools_protocol_handler) {
151 blob_protocol_handler_ = blob_protocol_handler.Pass(); 152 blob_protocol_handler_ = blob_protocol_handler.Pass();
152 file_system_protocol_handler_ = file_system_protocol_handler.Pass(); 153 file_system_protocol_handler_ = file_system_protocol_handler.Pass();
153 developer_protocol_handler_ = developer_protocol_handler.Pass(); 154 developer_protocol_handler_ = developer_protocol_handler.Pass();
154 chrome_protocol_handler_ = chrome_protocol_handler.Pass(); 155 chrome_protocol_handler_ = chrome_protocol_handler.Pass();
155 chrome_devtools_protocol_handler_ = chrome_devtools_protocol_handler.Pass(); 156 chrome_devtools_protocol_handler_ = chrome_devtools_protocol_handler.Pass();
156 } 157 }
157 158
158 } // namespace android_webview 159 } // namespace android_webview
OLDNEW
« no previous file with comments | « no previous file | android_webview/browser/net/init_native_callback.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698