| 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 #ifndef CONTENT_BROWSER_STORAGE_PARTITION_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_STORAGE_PARTITION_IMPL_H_ |
| 6 #define CONTENT_BROWSER_STORAGE_PARTITION_IMPL_H_ | 6 #define CONTENT_BROWSER_STORAGE_PARTITION_IMPL_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 #include "content/browser/bluetooth/bluetooth_allowed_devices_map.h" | 21 #include "content/browser/bluetooth/bluetooth_allowed_devices_map.h" |
| 22 #include "content/browser/broadcast_channel/broadcast_channel_provider.h" | 22 #include "content/browser/broadcast_channel/broadcast_channel_provider.h" |
| 23 #include "content/browser/cache_storage/cache_storage_context_impl.h" | 23 #include "content/browser/cache_storage/cache_storage_context_impl.h" |
| 24 #include "content/browser/dom_storage/dom_storage_context_wrapper.h" | 24 #include "content/browser/dom_storage/dom_storage_context_wrapper.h" |
| 25 #include "content/browser/host_zoom_level_context.h" | 25 #include "content/browser/host_zoom_level_context.h" |
| 26 #include "content/browser/indexed_db/indexed_db_context_impl.h" | 26 #include "content/browser/indexed_db/indexed_db_context_impl.h" |
| 27 #include "content/browser/notifications/platform_notification_context_impl.h" | 27 #include "content/browser/notifications/platform_notification_context_impl.h" |
| 28 #include "content/browser/payments/payment_app_context_impl.h" | 28 #include "content/browser/payments/payment_app_context_impl.h" |
| 29 #include "content/browser/push_messaging/push_messaging_context.h" | 29 #include "content/browser/push_messaging/push_messaging_context.h" |
| 30 #include "content/browser/service_worker/service_worker_context_wrapper.h" | 30 #include "content/browser/service_worker/service_worker_context_wrapper.h" |
| 31 #include "content/browser/url_loader_factory_getter.h" |
| 31 #include "content/common/content_export.h" | 32 #include "content/common/content_export.h" |
| 33 #include "content/common/network_service.mojom.h" |
| 32 #include "content/common/storage_partition_service.mojom.h" | 34 #include "content/common/storage_partition_service.mojom.h" |
| 33 #include "content/public/browser/storage_partition.h" | 35 #include "content/public/browser/storage_partition.h" |
| 34 #include "mojo/public/cpp/bindings/binding_set.h" | 36 #include "mojo/public/cpp/bindings/binding_set.h" |
| 35 #include "net/cookies/cookie_store.h" | 37 #include "net/cookies/cookie_store.h" |
| 36 #include "storage/browser/quota/special_storage_policy.h" | 38 #include "storage/browser/quota/special_storage_policy.h" |
| 37 | 39 |
| 38 namespace content { | 40 namespace content { |
| 39 | 41 |
| 40 class CONTENT_EXPORT StoragePartitionImpl | 42 class CONTENT_EXPORT StoragePartitionImpl |
| 41 : public StoragePartition, | 43 : public StoragePartition, |
| (...skipping 28 matching lines...) Expand all Loading... |
| 70 storage::FileSystemContext* GetFileSystemContext() override; | 72 storage::FileSystemContext* GetFileSystemContext() override; |
| 71 storage::DatabaseTracker* GetDatabaseTracker() override; | 73 storage::DatabaseTracker* GetDatabaseTracker() override; |
| 72 DOMStorageContextWrapper* GetDOMStorageContext() override; | 74 DOMStorageContextWrapper* GetDOMStorageContext() override; |
| 73 IndexedDBContextImpl* GetIndexedDBContext() override; | 75 IndexedDBContextImpl* GetIndexedDBContext() override; |
| 74 CacheStorageContextImpl* GetCacheStorageContext() override; | 76 CacheStorageContextImpl* GetCacheStorageContext() override; |
| 75 ServiceWorkerContextWrapper* GetServiceWorkerContext() override; | 77 ServiceWorkerContextWrapper* GetServiceWorkerContext() override; |
| 76 HostZoomMap* GetHostZoomMap() override; | 78 HostZoomMap* GetHostZoomMap() override; |
| 77 HostZoomLevelContext* GetHostZoomLevelContext() override; | 79 HostZoomLevelContext* GetHostZoomLevelContext() override; |
| 78 ZoomLevelDelegate* GetZoomLevelDelegate() override; | 80 ZoomLevelDelegate* GetZoomLevelDelegate() override; |
| 79 PlatformNotificationContextImpl* GetPlatformNotificationContext() override; | 81 PlatformNotificationContextImpl* GetPlatformNotificationContext() override; |
| 80 void ClearBluetoothAllowedDevicesMapForTesting() override; | |
| 81 | |
| 82 BackgroundFetchContext* GetBackgroundFetchContext(); | |
| 83 BackgroundSyncContext* GetBackgroundSyncContext(); | |
| 84 PaymentAppContextImpl* GetPaymentAppContext(); | |
| 85 BroadcastChannelProvider* GetBroadcastChannelProvider(); | |
| 86 BluetoothAllowedDevicesMap* GetBluetoothAllowedDevicesMap(); | |
| 87 | |
| 88 // mojom::StoragePartitionService interface. | |
| 89 void OpenLocalStorage( | |
| 90 const url::Origin& origin, | |
| 91 mojo::InterfaceRequest<mojom::LevelDBWrapper> request) override; | |
| 92 | |
| 93 void ClearDataForOrigin(uint32_t remove_mask, | 82 void ClearDataForOrigin(uint32_t remove_mask, |
| 94 uint32_t quota_storage_remove_mask, | 83 uint32_t quota_storage_remove_mask, |
| 95 const GURL& storage_origin, | 84 const GURL& storage_origin, |
| 96 net::URLRequestContextGetter* request_context_getter, | 85 net::URLRequestContextGetter* request_context_getter, |
| 97 const base::Closure& callback) override; | 86 const base::Closure& callback) override; |
| 98 void ClearData(uint32_t remove_mask, | 87 void ClearData(uint32_t remove_mask, |
| 99 uint32_t quota_storage_remove_mask, | 88 uint32_t quota_storage_remove_mask, |
| 100 const GURL& storage_origin, | 89 const GURL& storage_origin, |
| 101 const OriginMatcherFunction& origin_matcher, | 90 const OriginMatcherFunction& origin_matcher, |
| 102 const base::Time begin, | 91 const base::Time begin, |
| 103 const base::Time end, | 92 const base::Time end, |
| 104 const base::Closure& callback) override; | 93 const base::Closure& callback) override; |
| 105 | |
| 106 void ClearData(uint32_t remove_mask, | 94 void ClearData(uint32_t remove_mask, |
| 107 uint32_t quota_storage_remove_mask, | 95 uint32_t quota_storage_remove_mask, |
| 108 const OriginMatcherFunction& origin_matcher, | 96 const OriginMatcherFunction& origin_matcher, |
| 109 const CookieMatcherFunction& cookie_matcher, | 97 const CookieMatcherFunction& cookie_matcher, |
| 110 const base::Time begin, | 98 const base::Time begin, |
| 111 const base::Time end, | 99 const base::Time end, |
| 112 const base::Closure& callback) override; | 100 const base::Closure& callback) override; |
| 113 | |
| 114 void ClearHttpAndMediaCaches( | 101 void ClearHttpAndMediaCaches( |
| 115 const base::Time begin, | 102 const base::Time begin, |
| 116 const base::Time end, | 103 const base::Time end, |
| 117 const base::Callback<bool(const GURL&)>& url_matcher, | 104 const base::Callback<bool(const GURL&)>& url_matcher, |
| 118 const base::Closure& callback) override; | 105 const base::Closure& callback) override; |
| 106 void Flush() override; |
| 107 void ClearBluetoothAllowedDevicesMapForTesting() override; |
| 119 | 108 |
| 120 void Flush() override; | 109 BackgroundFetchContext* GetBackgroundFetchContext(); |
| 110 BackgroundSyncContext* GetBackgroundSyncContext(); |
| 111 PaymentAppContextImpl* GetPaymentAppContext(); |
| 112 BroadcastChannelProvider* GetBroadcastChannelProvider(); |
| 113 BluetoothAllowedDevicesMap* GetBluetoothAllowedDevicesMap(); |
| 114 |
| 115 // mojom::StoragePartitionService interface. |
| 116 void OpenLocalStorage( |
| 117 const url::Origin& origin, |
| 118 mojo::InterfaceRequest<mojom::LevelDBWrapper> request) override; |
| 119 |
| 120 // Returns the NetworkContext associated with this storage partition. Only |
| 121 // used when the network service is enabled. |
| 122 mojom::NetworkContext* network_context() { return network_context_.get(); } |
| 123 |
| 124 scoped_refptr<URLLoaderFactoryGetter> url_loader_factory_getter() { |
| 125 return url_loader_factory_getter_; |
| 126 } |
| 121 | 127 |
| 122 // Can return nullptr while |this| is being destroyed. | 128 // Can return nullptr while |this| is being destroyed. |
| 123 BrowserContext* browser_context() const; | 129 BrowserContext* browser_context() const; |
| 124 | 130 |
| 125 // Called by each renderer process once. | 131 // Called by each renderer process once. |
| 126 void Bind(mojo::InterfaceRequest<mojom::StoragePartitionService> request); | 132 void Bind(mojo::InterfaceRequest<mojom::StoragePartitionService> request); |
| 127 | 133 |
| 128 struct DataDeletionHelper; | 134 struct DataDeletionHelper; |
| 129 struct QuotaManagedDataDeletionHelper; | 135 struct QuotaManagedDataDeletionHelper; |
| 130 | 136 |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 void SetMediaURLRequestContext( | 215 void SetMediaURLRequestContext( |
| 210 net::URLRequestContextGetter* media_url_request_context); | 216 net::URLRequestContextGetter* media_url_request_context); |
| 211 | 217 |
| 212 // Function used by the quota system to ask the embedder for the | 218 // Function used by the quota system to ask the embedder for the |
| 213 // storage configuration info. | 219 // storage configuration info. |
| 214 void GetQuotaSettings(const storage::OptionalQuotaSettingsCallback& callback); | 220 void GetQuotaSettings(const storage::OptionalQuotaSettingsCallback& callback); |
| 215 | 221 |
| 216 base::FilePath partition_path_; | 222 base::FilePath partition_path_; |
| 217 scoped_refptr<net::URLRequestContextGetter> url_request_context_; | 223 scoped_refptr<net::URLRequestContextGetter> url_request_context_; |
| 218 scoped_refptr<net::URLRequestContextGetter> media_url_request_context_; | 224 scoped_refptr<net::URLRequestContextGetter> media_url_request_context_; |
| 225 scoped_refptr<URLLoaderFactoryGetter> url_loader_factory_getter_; |
| 219 scoped_refptr<storage::QuotaManager> quota_manager_; | 226 scoped_refptr<storage::QuotaManager> quota_manager_; |
| 220 scoped_refptr<ChromeAppCacheService> appcache_service_; | 227 scoped_refptr<ChromeAppCacheService> appcache_service_; |
| 221 scoped_refptr<storage::FileSystemContext> filesystem_context_; | 228 scoped_refptr<storage::FileSystemContext> filesystem_context_; |
| 222 scoped_refptr<storage::DatabaseTracker> database_tracker_; | 229 scoped_refptr<storage::DatabaseTracker> database_tracker_; |
| 223 scoped_refptr<DOMStorageContextWrapper> dom_storage_context_; | 230 scoped_refptr<DOMStorageContextWrapper> dom_storage_context_; |
| 224 scoped_refptr<IndexedDBContextImpl> indexed_db_context_; | 231 scoped_refptr<IndexedDBContextImpl> indexed_db_context_; |
| 225 scoped_refptr<CacheStorageContextImpl> cache_storage_context_; | 232 scoped_refptr<CacheStorageContextImpl> cache_storage_context_; |
| 226 scoped_refptr<ServiceWorkerContextWrapper> service_worker_context_; | 233 scoped_refptr<ServiceWorkerContextWrapper> service_worker_context_; |
| 227 scoped_refptr<PushMessagingContext> push_messaging_context_; | 234 scoped_refptr<PushMessagingContext> push_messaging_context_; |
| 228 scoped_refptr<storage::SpecialStoragePolicy> special_storage_policy_; | 235 scoped_refptr<storage::SpecialStoragePolicy> special_storage_policy_; |
| 229 scoped_refptr<HostZoomLevelContext> host_zoom_level_context_; | 236 scoped_refptr<HostZoomLevelContext> host_zoom_level_context_; |
| 230 scoped_refptr<PlatformNotificationContextImpl> platform_notification_context_; | 237 scoped_refptr<PlatformNotificationContextImpl> platform_notification_context_; |
| 231 scoped_refptr<BackgroundFetchContext> background_fetch_context_; | 238 scoped_refptr<BackgroundFetchContext> background_fetch_context_; |
| 232 scoped_refptr<BackgroundSyncContext> background_sync_context_; | 239 scoped_refptr<BackgroundSyncContext> background_sync_context_; |
| 233 scoped_refptr<PaymentAppContextImpl> payment_app_context_; | 240 scoped_refptr<PaymentAppContextImpl> payment_app_context_; |
| 234 scoped_refptr<BroadcastChannelProvider> broadcast_channel_provider_; | 241 scoped_refptr<BroadcastChannelProvider> broadcast_channel_provider_; |
| 235 scoped_refptr<BluetoothAllowedDevicesMap> bluetooth_allowed_devices_map_; | 242 scoped_refptr<BluetoothAllowedDevicesMap> bluetooth_allowed_devices_map_; |
| 236 | 243 |
| 237 mojo::BindingSet<mojom::StoragePartitionService> bindings_; | 244 mojo::BindingSet<mojom::StoragePartitionService> bindings_; |
| 245 mojom::NetworkContextPtr network_context_; |
| 238 | 246 |
| 239 // Raw pointer that should always be valid. The BrowserContext owns the | 247 // Raw pointer that should always be valid. The BrowserContext owns the |
| 240 // StoragePartitionImplMap which then owns StoragePartitionImpl. When the | 248 // StoragePartitionImplMap which then owns StoragePartitionImpl. When the |
| 241 // BrowserContext is destroyed, |this| will be destroyed too. | 249 // BrowserContext is destroyed, |this| will be destroyed too. |
| 242 BrowserContext* browser_context_; | 250 BrowserContext* browser_context_; |
| 243 | 251 |
| 244 base::WeakPtrFactory<StoragePartitionImpl> weak_factory_; | 252 base::WeakPtrFactory<StoragePartitionImpl> weak_factory_; |
| 245 | 253 |
| 246 DISALLOW_COPY_AND_ASSIGN(StoragePartitionImpl); | 254 DISALLOW_COPY_AND_ASSIGN(StoragePartitionImpl); |
| 247 }; | 255 }; |
| 248 | 256 |
| 249 } // namespace content | 257 } // namespace content |
| 250 | 258 |
| 251 #endif // CONTENT_BROWSER_STORAGE_PARTITION_IMPL_H_ | 259 #endif // CONTENT_BROWSER_STORAGE_PARTITION_IMPL_H_ |
| OLD | NEW |