| 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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 form_database_service_.reset( | 81 form_database_service_.reset( |
| 82 new AwFormDatabaseService(context_storage_path_)); | 82 new AwFormDatabaseService(context_storage_path_)); |
| 83 } | 83 } |
| 84 | 84 |
| 85 void AwBrowserContext::AddVisitedURLs(const std::vector<GURL>& urls) { | 85 void AwBrowserContext::AddVisitedURLs(const std::vector<GURL>& urls) { |
| 86 DCHECK(visitedlink_master_); | 86 DCHECK(visitedlink_master_); |
| 87 visitedlink_master_->AddURLs(urls); | 87 visitedlink_master_->AddURLs(urls); |
| 88 } | 88 } |
| 89 | 89 |
| 90 net::URLRequestContextGetter* AwBrowserContext::CreateRequestContext( | 90 net::URLRequestContextGetter* AwBrowserContext::CreateRequestContext( |
| 91 content::ProtocolHandlerMap* protocol_handlers) { | 91 content::ProtocolHandlerMap* protocol_handlers, |
| 92 content::ProtocolHandlerScopedVector protocol_interceptors) { |
| 92 // This function cannot actually create the request context because | 93 // This function cannot actually create the request context because |
| 93 // there is a reentrant dependency on GetResourceContext() via | 94 // there is a reentrant dependency on GetResourceContext() via |
| 94 // content::StoragePartitionImplMap::Create(). This is not fixable | 95 // content::StoragePartitionImplMap::Create(). This is not fixable |
| 95 // until http://crbug.com/159193. Until then, assert that the context | 96 // until http://crbug.com/159193. Until then, assert that the context |
| 96 // has already been allocated and just handle setting the protocol_handlers. | 97 // has already been allocated and just handle setting the protocol_handlers. |
| 97 DCHECK(url_request_context_getter_); | 98 DCHECK(url_request_context_getter_); |
| 98 url_request_context_getter_->SetProtocolHandlers(protocol_handlers); | 99 url_request_context_getter_->SetProtocolHandlers(protocol_handlers); |
| 99 return url_request_context_getter_; | 100 return url_request_context_getter_; |
| 100 } | 101 } |
| 101 | 102 |
| 102 net::URLRequestContextGetter* | 103 net::URLRequestContextGetter* |
| 103 AwBrowserContext::CreateRequestContextForStoragePartition( | 104 AwBrowserContext::CreateRequestContextForStoragePartition( |
| 104 const base::FilePath& partition_path, | 105 const base::FilePath& partition_path, |
| 105 bool in_memory, | 106 bool in_memory, |
| 106 content::ProtocolHandlerMap* protocol_handlers) { | 107 content::ProtocolHandlerMap* protocol_handlers, |
| 108 content::ProtocolHandlerScopedVector protocol_interceptors) { |
| 107 NOTREACHED(); | 109 NOTREACHED(); |
| 108 return NULL; | 110 return NULL; |
| 109 } | 111 } |
| 110 | 112 |
| 111 AwQuotaManagerBridge* AwBrowserContext::GetQuotaManagerBridge() { | 113 AwQuotaManagerBridge* AwBrowserContext::GetQuotaManagerBridge() { |
| 112 if (!quota_manager_bridge_.get()) { | 114 if (!quota_manager_bridge_.get()) { |
| 113 quota_manager_bridge_ = native_factory_->CreateAwQuotaManagerBridge(this); | 115 quota_manager_bridge_ = native_factory_->CreateAwQuotaManagerBridge(this); |
| 114 } | 116 } |
| 115 return quota_manager_bridge_.get(); | 117 return quota_manager_bridge_.get(); |
| 116 } | 118 } |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 243 | 245 |
| 244 void AwBrowserContext::RebuildTable( | 246 void AwBrowserContext::RebuildTable( |
| 245 const scoped_refptr<URLEnumerator>& enumerator) { | 247 const scoped_refptr<URLEnumerator>& enumerator) { |
| 246 // Android WebView rebuilds from WebChromeClient.getVisitedHistory. The client | 248 // Android WebView rebuilds from WebChromeClient.getVisitedHistory. The client |
| 247 // can change in the lifetime of this WebView and may not yet be set here. | 249 // can change in the lifetime of this WebView and may not yet be set here. |
| 248 // Therefore this initialization path is not used. | 250 // Therefore this initialization path is not used. |
| 249 enumerator->OnComplete(true); | 251 enumerator->OnComplete(true); |
| 250 } | 252 } |
| 251 | 253 |
| 252 } // namespace android_webview | 254 } // namespace android_webview |
| OLD | NEW |