OLD | NEW |
---|---|
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/aw_browser_context.h" | 5 #include "android_webview/browser/aw_browser_context.h" |
6 | 6 |
7 #include "android_webview/browser/aw_form_database_service.h" | 7 #include "android_webview/browser/aw_form_database_service.h" |
8 #include "android_webview/browser/aw_pref_store.h" | 8 #include "android_webview/browser/aw_pref_store.h" |
9 #include "android_webview/browser/aw_quota_manager_bridge.h" | 9 #include "android_webview/browser/aw_quota_manager_bridge.h" |
10 #include "android_webview/browser/aw_resource_context.h" | 10 #include "android_webview/browser/aw_resource_context.h" |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
44 | 44 |
45 AwBrowserContext* g_browser_context = NULL; | 45 AwBrowserContext* g_browser_context = NULL; |
46 | 46 |
47 } // namespace | 47 } // namespace |
48 | 48 |
49 // Data reduction proxy is disabled by default. | 49 // Data reduction proxy is disabled by default. |
50 bool AwBrowserContext::data_reduction_proxy_enabled_ = false; | 50 bool AwBrowserContext::data_reduction_proxy_enabled_ = false; |
51 | 51 |
52 AwBrowserContext::AwBrowserContext( | 52 AwBrowserContext::AwBrowserContext( |
53 const FilePath path, | 53 const FilePath path, |
54 JniDependencyFactory* native_factory) | 54 JniDependencyFactory* native_factory, |
55 net::NetLog* net_log) | |
55 : context_storage_path_(path), | 56 : context_storage_path_(path), |
56 native_factory_(native_factory) { | 57 native_factory_(native_factory), |
58 net_log_(net_log) { | |
57 DCHECK(!g_browser_context); | 59 DCHECK(!g_browser_context); |
58 g_browser_context = this; | 60 g_browser_context = this; |
59 | 61 |
60 // This constructor is entered during the creation of ContentBrowserClient, | 62 // This constructor is entered during the creation of ContentBrowserClient, |
61 // before browser threads are created. Therefore any checks to enforce | 63 // before browser threads are created. Therefore any checks to enforce |
62 // threading (such as BrowserThread::CurrentlyOn()) will fail here. | 64 // threading (such as BrowserThread::CurrentlyOn()) will fail here. |
63 } | 65 } |
64 | 66 |
65 AwBrowserContext::~AwBrowserContext() { | 67 AwBrowserContext::~AwBrowserContext() { |
66 DCHECK_EQ(this, g_browser_context); | 68 DCHECK_EQ(this, g_browser_context); |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
120 base::Unretained( | 122 base::Unretained( |
121 data_reduction_proxy_config_service.get())), | 123 data_reduction_proxy_config_service.get())), |
122 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO))); | 124 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO))); |
123 data_reduction_proxy_settings_->SetProxyConfigurator( | 125 data_reduction_proxy_settings_->SetProxyConfigurator( |
124 data_reduction_proxy_configurator_.get()); | 126 data_reduction_proxy_configurator_.get()); |
125 } | 127 } |
126 | 128 |
127 url_request_context_getter_ = | 129 url_request_context_getter_ = |
128 new AwURLRequestContextGetter(GetPath(), | 130 new AwURLRequestContextGetter(GetPath(), |
129 cookie_store_.get(), | 131 cookie_store_.get(), |
130 data_reduction_proxy_config_service.Pass()); | 132 data_reduction_proxy_config_service.Pass(), |
133 net_log_); | |
131 | 134 |
132 visitedlink_master_.reset( | 135 visitedlink_master_.reset( |
133 new visitedlink::VisitedLinkMaster(this, this, false)); | 136 new visitedlink::VisitedLinkMaster(this, this, false)); |
134 visitedlink_master_->Init(); | 137 visitedlink_master_->Init(); |
135 | 138 |
136 form_database_service_.reset( | 139 form_database_service_.reset( |
137 new AwFormDatabaseService(context_storage_path_)); | 140 new AwFormDatabaseService(context_storage_path_)); |
138 } | 141 } |
139 | 142 |
140 void AwBrowserContext::AddVisitedURLs(const std::vector<GURL>& urls) { | 143 void AwBrowserContext::AddVisitedURLs(const std::vector<GURL>& urls) { |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
220 base::FilePath AwBrowserContext::GetPath() const { | 223 base::FilePath AwBrowserContext::GetPath() const { |
221 return context_storage_path_; | 224 return context_storage_path_; |
222 } | 225 } |
223 | 226 |
224 bool AwBrowserContext::IsOffTheRecord() const { | 227 bool AwBrowserContext::IsOffTheRecord() const { |
225 // Android WebView does not support off the record profile yet. | 228 // Android WebView does not support off the record profile yet. |
226 return false; | 229 return false; |
227 } | 230 } |
228 | 231 |
229 net::URLRequestContextGetter* AwBrowserContext::GetRequestContext() { | 232 net::URLRequestContextGetter* AwBrowserContext::GetRequestContext() { |
230 return GetDefaultStoragePartition(this)->GetURLRequestContext(); | 233 return GetDefaultStoragePartition(this)->GetURLRequestContext(); |
benm (inactive)
2014/09/09 11:11:27
I was looking to see if we could have the BrowserC
mnaganov (inactive)
2014/09/09 13:02:28
This seems to be a pattern in Chrome of creating a
| |
231 } | 234 } |
232 | 235 |
233 net::URLRequestContextGetter* | 236 net::URLRequestContextGetter* |
234 AwBrowserContext::GetRequestContextForRenderProcess( | 237 AwBrowserContext::GetRequestContextForRenderProcess( |
235 int renderer_child_id) { | 238 int renderer_child_id) { |
236 return GetRequestContext(); | 239 return GetRequestContext(); |
237 } | 240 } |
238 | 241 |
239 net::URLRequestContextGetter* AwBrowserContext::GetMediaRequestContext() { | 242 net::URLRequestContextGetter* AwBrowserContext::GetMediaRequestContext() { |
240 return GetRequestContext(); | 243 return GetRequestContext(); |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
287 | 290 |
288 void AwBrowserContext::RebuildTable( | 291 void AwBrowserContext::RebuildTable( |
289 const scoped_refptr<URLEnumerator>& enumerator) { | 292 const scoped_refptr<URLEnumerator>& enumerator) { |
290 // Android WebView rebuilds from WebChromeClient.getVisitedHistory. The client | 293 // Android WebView rebuilds from WebChromeClient.getVisitedHistory. The client |
291 // can change in the lifetime of this WebView and may not yet be set here. | 294 // can change in the lifetime of this WebView and may not yet be set here. |
292 // Therefore this initialization path is not used. | 295 // Therefore this initialization path is not used. |
293 enumerator->OnComplete(true); | 296 enumerator->OnComplete(true); |
294 } | 297 } |
295 | 298 |
296 } // namespace android_webview | 299 } // namespace android_webview |
OLD | NEW |