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 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 form_database_service_.reset( | 119 form_database_service_.reset( |
120 new AwFormDatabaseService(context_storage_path_)); | 120 new AwFormDatabaseService(context_storage_path_)); |
121 } | 121 } |
122 | 122 |
123 void AwBrowserContext::AddVisitedURLs(const std::vector<GURL>& urls) { | 123 void AwBrowserContext::AddVisitedURLs(const std::vector<GURL>& urls) { |
124 DCHECK(visitedlink_master_); | 124 DCHECK(visitedlink_master_); |
125 visitedlink_master_->AddURLs(urls); | 125 visitedlink_master_->AddURLs(urls); |
126 } | 126 } |
127 | 127 |
128 net::URLRequestContextGetter* AwBrowserContext::CreateRequestContext( | 128 net::URLRequestContextGetter* AwBrowserContext::CreateRequestContext( |
129 content::ProtocolHandlerMap* protocol_handlers) { | 129 content::ProtocolHandlerMap* protocol_handlers, |
| 130 content::URLRequestInterceptorScopedVector request_interceptors) { |
130 // This function cannot actually create the request context because | 131 // This function cannot actually create the request context because |
131 // there is a reentrant dependency on GetResourceContext() via | 132 // there is a reentrant dependency on GetResourceContext() via |
132 // content::StoragePartitionImplMap::Create(). This is not fixable | 133 // content::StoragePartitionImplMap::Create(). This is not fixable |
133 // until http://crbug.com/159193. Until then, assert that the context | 134 // until http://crbug.com/159193. Until then, assert that the context |
134 // has already been allocated and just handle setting the protocol_handlers. | 135 // has already been allocated and just handle setting the protocol_handlers. |
135 DCHECK(url_request_context_getter_); | 136 DCHECK(url_request_context_getter_); |
136 url_request_context_getter_->SetProtocolHandlers(protocol_handlers); | 137 url_request_context_getter_->SetHandlersAndInterceptors( |
| 138 protocol_handlers, request_interceptors.Pass()); |
137 return url_request_context_getter_; | 139 return url_request_context_getter_; |
138 } | 140 } |
139 | 141 |
140 net::URLRequestContextGetter* | 142 net::URLRequestContextGetter* |
141 AwBrowserContext::CreateRequestContextForStoragePartition( | 143 AwBrowserContext::CreateRequestContextForStoragePartition( |
142 const base::FilePath& partition_path, | 144 const base::FilePath& partition_path, |
143 bool in_memory, | 145 bool in_memory, |
144 content::ProtocolHandlerMap* protocol_handlers) { | 146 content::ProtocolHandlerMap* protocol_handlers, |
| 147 content::URLRequestInterceptorScopedVector request_interceptors) { |
145 NOTREACHED(); | 148 NOTREACHED(); |
146 return NULL; | 149 return NULL; |
147 } | 150 } |
148 | 151 |
149 AwQuotaManagerBridge* AwBrowserContext::GetQuotaManagerBridge() { | 152 AwQuotaManagerBridge* AwBrowserContext::GetQuotaManagerBridge() { |
150 if (!quota_manager_bridge_.get()) { | 153 if (!quota_manager_bridge_.get()) { |
151 quota_manager_bridge_ = native_factory_->CreateAwQuotaManagerBridge(this); | 154 quota_manager_bridge_ = native_factory_->CreateAwQuotaManagerBridge(this); |
152 } | 155 } |
153 return quota_manager_bridge_.get(); | 156 return quota_manager_bridge_.get(); |
154 } | 157 } |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
302 | 305 |
303 void AwBrowserContext::RebuildTable( | 306 void AwBrowserContext::RebuildTable( |
304 const scoped_refptr<URLEnumerator>& enumerator) { | 307 const scoped_refptr<URLEnumerator>& enumerator) { |
305 // Android WebView rebuilds from WebChromeClient.getVisitedHistory. The client | 308 // Android WebView rebuilds from WebChromeClient.getVisitedHistory. The client |
306 // can change in the lifetime of this WebView and may not yet be set here. | 309 // can change in the lifetime of this WebView and may not yet be set here. |
307 // Therefore this initialization path is not used. | 310 // Therefore this initialization path is not used. |
308 enumerator->OnComplete(true); | 311 enumerator->OnComplete(true); |
309 } | 312 } |
310 | 313 |
311 } // namespace android_webview | 314 } // namespace android_webview |
OLD | NEW |