| 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 11 matching lines...) Expand all Loading... |
| 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/common/content_export.h" | 31 #include "content/common/content_export.h" |
| 32 #include "content/common/network_service.mojom.h" |
| 32 #include "content/common/storage_partition_service.mojom.h" | 33 #include "content/common/storage_partition_service.mojom.h" |
| 33 #include "content/public/browser/storage_partition.h" | 34 #include "content/public/browser/storage_partition.h" |
| 34 #include "mojo/public/cpp/bindings/binding_set.h" | 35 #include "mojo/public/cpp/bindings/binding_set.h" |
| 35 #include "net/cookies/cookie_store.h" | 36 #include "net/cookies/cookie_store.h" |
| 36 #include "storage/browser/quota/special_storage_policy.h" | 37 #include "storage/browser/quota/special_storage_policy.h" |
| 37 | 38 |
| 38 namespace content { | 39 namespace content { |
| 39 | 40 |
| 40 class CONTENT_EXPORT StoragePartitionImpl | 41 class CONTENT_EXPORT StoragePartitionImpl |
| 41 : public StoragePartition, | 42 : public StoragePartition, |
| (...skipping 28 matching lines...) Expand all Loading... |
| 70 storage::FileSystemContext* GetFileSystemContext() override; | 71 storage::FileSystemContext* GetFileSystemContext() override; |
| 71 storage::DatabaseTracker* GetDatabaseTracker() override; | 72 storage::DatabaseTracker* GetDatabaseTracker() override; |
| 72 DOMStorageContextWrapper* GetDOMStorageContext() override; | 73 DOMStorageContextWrapper* GetDOMStorageContext() override; |
| 73 IndexedDBContextImpl* GetIndexedDBContext() override; | 74 IndexedDBContextImpl* GetIndexedDBContext() override; |
| 74 CacheStorageContextImpl* GetCacheStorageContext() override; | 75 CacheStorageContextImpl* GetCacheStorageContext() override; |
| 75 ServiceWorkerContextWrapper* GetServiceWorkerContext() override; | 76 ServiceWorkerContextWrapper* GetServiceWorkerContext() override; |
| 76 HostZoomMap* GetHostZoomMap() override; | 77 HostZoomMap* GetHostZoomMap() override; |
| 77 HostZoomLevelContext* GetHostZoomLevelContext() override; | 78 HostZoomLevelContext* GetHostZoomLevelContext() override; |
| 78 ZoomLevelDelegate* GetZoomLevelDelegate() override; | 79 ZoomLevelDelegate* GetZoomLevelDelegate() override; |
| 79 PlatformNotificationContextImpl* GetPlatformNotificationContext() override; | 80 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, | 81 void ClearDataForOrigin(uint32_t remove_mask, |
| 94 uint32_t quota_storage_remove_mask, | 82 uint32_t quota_storage_remove_mask, |
| 95 const GURL& storage_origin, | 83 const GURL& storage_origin, |
| 96 net::URLRequestContextGetter* request_context_getter, | 84 net::URLRequestContextGetter* request_context_getter, |
| 97 const base::Closure& callback) override; | 85 const base::Closure& callback) override; |
| 98 void ClearData(uint32_t remove_mask, | 86 void ClearData(uint32_t remove_mask, |
| 99 uint32_t quota_storage_remove_mask, | 87 uint32_t quota_storage_remove_mask, |
| 100 const GURL& storage_origin, | 88 const GURL& storage_origin, |
| 101 const OriginMatcherFunction& origin_matcher, | 89 const OriginMatcherFunction& origin_matcher, |
| 102 const base::Time begin, | 90 const base::Time begin, |
| 103 const base::Time end, | 91 const base::Time end, |
| 104 const base::Closure& callback) override; | 92 const base::Closure& callback) override; |
| 105 | |
| 106 void ClearData(uint32_t remove_mask, | 93 void ClearData(uint32_t remove_mask, |
| 107 uint32_t quota_storage_remove_mask, | 94 uint32_t quota_storage_remove_mask, |
| 108 const OriginMatcherFunction& origin_matcher, | 95 const OriginMatcherFunction& origin_matcher, |
| 109 const CookieMatcherFunction& cookie_matcher, | 96 const CookieMatcherFunction& cookie_matcher, |
| 110 const base::Time begin, | 97 const base::Time begin, |
| 111 const base::Time end, | 98 const base::Time end, |
| 112 const base::Closure& callback) override; | 99 const base::Closure& callback) override; |
| 113 | |
| 114 void ClearHttpAndMediaCaches( | 100 void ClearHttpAndMediaCaches( |
| 115 const base::Time begin, | 101 const base::Time begin, |
| 116 const base::Time end, | 102 const base::Time end, |
| 117 const base::Callback<bool(const GURL&)>& url_matcher, | 103 const base::Callback<bool(const GURL&)>& url_matcher, |
| 118 const base::Closure& callback) override; | 104 const base::Closure& callback) override; |
| 105 void Flush() override; |
| 106 void ClearBluetoothAllowedDevicesMapForTesting() override; |
| 119 | 107 |
| 120 void Flush() override; | 108 BackgroundFetchContext* GetBackgroundFetchContext(); |
| 109 BackgroundSyncContext* GetBackgroundSyncContext(); |
| 110 PaymentAppContextImpl* GetPaymentAppContext(); |
| 111 BroadcastChannelProvider* GetBroadcastChannelProvider(); |
| 112 BluetoothAllowedDevicesMap* GetBluetoothAllowedDevicesMap(); |
| 113 |
| 114 // mojom::StoragePartitionService interface. |
| 115 void OpenLocalStorage( |
| 116 const url::Origin& origin, |
| 117 mojo::InterfaceRequest<mojom::LevelDBWrapper> request) override; |
| 118 |
| 119 // Returns the NetworkContext associated with this storage partition. Only |
| 120 // used when the network service is enabled. |
| 121 mojom::NetworkContext* network_context() { return network_context_.get(); } |
| 121 | 122 |
| 122 // Can return nullptr while |this| is being destroyed. | 123 // Can return nullptr while |this| is being destroyed. |
| 123 BrowserContext* browser_context() const; | 124 BrowserContext* browser_context() const; |
| 124 | 125 |
| 125 // Called by each renderer process once. | 126 // Called by each renderer process once. |
| 126 void Bind(mojo::InterfaceRequest<mojom::StoragePartitionService> request); | 127 void Bind(mojo::InterfaceRequest<mojom::StoragePartitionService> request); |
| 127 | 128 |
| 128 struct DataDeletionHelper; | 129 struct DataDeletionHelper; |
| 129 struct QuotaManagedDataDeletionHelper; | 130 struct QuotaManagedDataDeletionHelper; |
| 130 | 131 |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 228 scoped_refptr<storage::SpecialStoragePolicy> special_storage_policy_; | 229 scoped_refptr<storage::SpecialStoragePolicy> special_storage_policy_; |
| 229 scoped_refptr<HostZoomLevelContext> host_zoom_level_context_; | 230 scoped_refptr<HostZoomLevelContext> host_zoom_level_context_; |
| 230 scoped_refptr<PlatformNotificationContextImpl> platform_notification_context_; | 231 scoped_refptr<PlatformNotificationContextImpl> platform_notification_context_; |
| 231 scoped_refptr<BackgroundFetchContext> background_fetch_context_; | 232 scoped_refptr<BackgroundFetchContext> background_fetch_context_; |
| 232 scoped_refptr<BackgroundSyncContext> background_sync_context_; | 233 scoped_refptr<BackgroundSyncContext> background_sync_context_; |
| 233 scoped_refptr<PaymentAppContextImpl> payment_app_context_; | 234 scoped_refptr<PaymentAppContextImpl> payment_app_context_; |
| 234 scoped_refptr<BroadcastChannelProvider> broadcast_channel_provider_; | 235 scoped_refptr<BroadcastChannelProvider> broadcast_channel_provider_; |
| 235 scoped_refptr<BluetoothAllowedDevicesMap> bluetooth_allowed_devices_map_; | 236 scoped_refptr<BluetoothAllowedDevicesMap> bluetooth_allowed_devices_map_; |
| 236 | 237 |
| 237 mojo::BindingSet<mojom::StoragePartitionService> bindings_; | 238 mojo::BindingSet<mojom::StoragePartitionService> bindings_; |
| 239 mojom::NetworkContextPtr network_context_; |
| 238 | 240 |
| 239 // Raw pointer that should always be valid. The BrowserContext owns the | 241 // Raw pointer that should always be valid. The BrowserContext owns the |
| 240 // StoragePartitionImplMap which then owns StoragePartitionImpl. When the | 242 // StoragePartitionImplMap which then owns StoragePartitionImpl. When the |
| 241 // BrowserContext is destroyed, |this| will be destroyed too. | 243 // BrowserContext is destroyed, |this| will be destroyed too. |
| 242 BrowserContext* browser_context_; | 244 BrowserContext* browser_context_; |
| 243 | 245 |
| 244 base::WeakPtrFactory<StoragePartitionImpl> weak_factory_; | 246 base::WeakPtrFactory<StoragePartitionImpl> weak_factory_; |
| 245 | 247 |
| 246 DISALLOW_COPY_AND_ASSIGN(StoragePartitionImpl); | 248 DISALLOW_COPY_AND_ASSIGN(StoragePartitionImpl); |
| 247 }; | 249 }; |
| 248 | 250 |
| 249 } // namespace content | 251 } // namespace content |
| 250 | 252 |
| 251 #endif // CONTENT_BROWSER_STORAGE_PARTITION_IMPL_H_ | 253 #endif // CONTENT_BROWSER_STORAGE_PARTITION_IMPL_H_ |
| OLD | NEW |