Chromium Code Reviews| 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> |
| 11 | 11 |
| 12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
| 13 #include "base/files/file_path.h" | 13 #include "base/files/file_path.h" |
| 14 #include "base/gtest_prod_util.h" | 14 #include "base/gtest_prod_util.h" |
| 15 #include "base/macros.h" | 15 #include "base/macros.h" |
| 16 #include "base/memory/ref_counted.h" | 16 #include "base/memory/ref_counted.h" |
| 17 #include "content/browser/appcache/chrome_appcache_service.h" | 17 #include "content/browser/appcache/chrome_appcache_service.h" |
| 18 #include "content/browser/background_sync/background_sync_context.h" | 18 #include "content/browser/background_sync/background_sync_context.h" |
| 19 #include "content/browser/bluetooth/bluetooth_allowed_devices_map.h" | |
| 19 #include "content/browser/broadcast_channel/broadcast_channel_provider.h" | 20 #include "content/browser/broadcast_channel/broadcast_channel_provider.h" |
| 20 #include "content/browser/cache_storage/cache_storage_context_impl.h" | 21 #include "content/browser/cache_storage/cache_storage_context_impl.h" |
| 21 #include "content/browser/dom_storage/dom_storage_context_wrapper.h" | 22 #include "content/browser/dom_storage/dom_storage_context_wrapper.h" |
| 22 #include "content/browser/host_zoom_level_context.h" | 23 #include "content/browser/host_zoom_level_context.h" |
| 23 #include "content/browser/indexed_db/indexed_db_context_impl.h" | 24 #include "content/browser/indexed_db/indexed_db_context_impl.h" |
| 24 #include "content/browser/notifications/platform_notification_context_impl.h" | 25 #include "content/browser/notifications/platform_notification_context_impl.h" |
| 25 #include "content/browser/payments/payment_app_context_impl.h" | 26 #include "content/browser/payments/payment_app_context_impl.h" |
| 26 #include "content/browser/push_messaging/push_messaging_context.h" | 27 #include "content/browser/push_messaging/push_messaging_context.h" |
| 27 #include "content/browser/service_worker/service_worker_context_wrapper.h" | 28 #include "content/browser/service_worker/service_worker_context_wrapper.h" |
| 28 #include "content/common/content_export.h" | 29 #include "content/common/content_export.h" |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 71 CacheStorageContextImpl* GetCacheStorageContext() override; | 72 CacheStorageContextImpl* GetCacheStorageContext() override; |
| 72 ServiceWorkerContextWrapper* GetServiceWorkerContext() override; | 73 ServiceWorkerContextWrapper* GetServiceWorkerContext() override; |
| 73 HostZoomMap* GetHostZoomMap() override; | 74 HostZoomMap* GetHostZoomMap() override; |
| 74 HostZoomLevelContext* GetHostZoomLevelContext() override; | 75 HostZoomLevelContext* GetHostZoomLevelContext() override; |
| 75 ZoomLevelDelegate* GetZoomLevelDelegate() override; | 76 ZoomLevelDelegate* GetZoomLevelDelegate() override; |
| 76 PlatformNotificationContextImpl* GetPlatformNotificationContext() override; | 77 PlatformNotificationContextImpl* GetPlatformNotificationContext() override; |
| 77 | 78 |
| 78 BackgroundSyncContext* GetBackgroundSyncContext(); | 79 BackgroundSyncContext* GetBackgroundSyncContext(); |
| 79 PaymentAppContextImpl* GetPaymentAppContext(); | 80 PaymentAppContextImpl* GetPaymentAppContext(); |
| 80 BroadcastChannelProvider* GetBroadcastChannelProvider(); | 81 BroadcastChannelProvider* GetBroadcastChannelProvider(); |
| 82 BluetoothAllowedDevicesMap* GetBluetoothAllowedDevicesMap(); | |
| 81 | 83 |
| 82 // mojom::StoragePartitionService interface. | 84 // mojom::StoragePartitionService interface. |
| 83 void OpenLocalStorage( | 85 void OpenLocalStorage( |
| 84 const url::Origin& origin, | 86 const url::Origin& origin, |
| 85 mojo::InterfaceRequest<mojom::LevelDBWrapper> request) override; | 87 mojo::InterfaceRequest<mojom::LevelDBWrapper> request) override; |
| 86 | 88 |
| 87 void ClearDataForOrigin(uint32_t remove_mask, | 89 void ClearDataForOrigin(uint32_t remove_mask, |
| 88 uint32_t quota_storage_remove_mask, | 90 uint32_t quota_storage_remove_mask, |
| 89 const GURL& storage_origin, | 91 const GURL& storage_origin, |
| 90 net::URLRequestContextGetter* request_context_getter, | 92 net::URLRequestContextGetter* request_context_getter, |
| 91 const base::Closure& callback) override; | 93 const base::Closure& callback) override; |
| 92 void ClearData(uint32_t remove_mask, | 94 void ClearData(uint32_t remove_mask, |
| 93 uint32_t quota_storage_remove_mask, | 95 uint32_t quota_storage_remove_mask, |
| 94 const GURL& storage_origin, | 96 const GURL& storage_origin, |
| 95 const OriginMatcherFunction& origin_matcher, | 97 const OriginMatcherFunction& origin_matcher, |
| 96 const base::Time begin, | 98 const base::Time begin, |
| 97 const base::Time end, | 99 const base::Time end, |
| 98 const base::Closure& callback) override; | 100 const base::Closure& callback) override; |
| 99 | 101 |
| 100 void ClearData(uint32_t remove_mask, | 102 void ClearData(uint32_t remove_mask, |
| 101 uint32_t quota_storage_remove_mask, | 103 uint32_t quota_storage_remove_mask, |
| 102 const OriginMatcherFunction& origin_matcher, | 104 const OriginMatcherFunction& origin_matcher, |
| 103 const CookieMatcherFunction& cookie_matcher, | 105 const CookieMatcherFunction& cookie_matcher, |
| 104 const base::Time begin, | 106 const base::Time begin, |
| 105 const base::Time end, | 107 const base::Time end, |
| 106 const base::Closure& callback) override; | 108 const base::Closure& callback) override; |
| 107 | 109 |
| 108 void Flush() override; | 110 void Flush() override; |
| 109 | 111 |
| 112 void ClearBluetoothAllowedDevicesMap() override; | |
|
scheib
2017/02/03 23:28:13
All the overrides should be together without new-l
juncai
2017/02/08 06:43:49
Done.
| |
| 113 | |
| 110 // Can return nullptr while |this| is being destroyed. | 114 // Can return nullptr while |this| is being destroyed. |
| 111 BrowserContext* browser_context() const; | 115 BrowserContext* browser_context() const; |
| 112 | 116 |
| 113 // Called by each renderer process once. | 117 // Called by each renderer process once. |
| 114 void Bind(mojo::InterfaceRequest<mojom::StoragePartitionService> request); | 118 void Bind(mojo::InterfaceRequest<mojom::StoragePartitionService> request); |
| 115 | 119 |
| 116 struct DataDeletionHelper; | 120 struct DataDeletionHelper; |
| 117 struct QuotaManagedDataDeletionHelper; | 121 struct QuotaManagedDataDeletionHelper; |
| 118 | 122 |
| 119 private: | 123 private: |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 175 DOMStorageContextWrapper* dom_storage_context, | 179 DOMStorageContextWrapper* dom_storage_context, |
| 176 IndexedDBContextImpl* indexed_db_context, | 180 IndexedDBContextImpl* indexed_db_context, |
| 177 CacheStorageContextImpl* cache_storage_context, | 181 CacheStorageContextImpl* cache_storage_context, |
| 178 ServiceWorkerContextWrapper* service_worker_context, | 182 ServiceWorkerContextWrapper* service_worker_context, |
| 179 PushMessagingContext* push_messaging_context, | 183 PushMessagingContext* push_messaging_context, |
| 180 storage::SpecialStoragePolicy* special_storage_policy, | 184 storage::SpecialStoragePolicy* special_storage_policy, |
| 181 HostZoomLevelContext* host_zoom_level_context, | 185 HostZoomLevelContext* host_zoom_level_context, |
| 182 PlatformNotificationContextImpl* platform_notification_context, | 186 PlatformNotificationContextImpl* platform_notification_context, |
| 183 BackgroundSyncContext* background_sync_context, | 187 BackgroundSyncContext* background_sync_context, |
| 184 PaymentAppContextImpl* payment_app_context, | 188 PaymentAppContextImpl* payment_app_context, |
| 185 scoped_refptr<BroadcastChannelProvider> broadcast_channel_provider); | 189 scoped_refptr<BroadcastChannelProvider> broadcast_channel_provider, |
| 190 scoped_refptr<BluetoothAllowedDevicesMap> bluetooth_allowed_devices_map); | |
| 186 | 191 |
| 187 // We will never have both remove_origin be populated and a cookie_matcher. | 192 // We will never have both remove_origin be populated and a cookie_matcher. |
| 188 void ClearDataImpl(uint32_t remove_mask, | 193 void ClearDataImpl(uint32_t remove_mask, |
| 189 uint32_t quota_storage_remove_mask, | 194 uint32_t quota_storage_remove_mask, |
| 190 const GURL& remove_origin, | 195 const GURL& remove_origin, |
| 191 const OriginMatcherFunction& origin_matcher, | 196 const OriginMatcherFunction& origin_matcher, |
| 192 const CookieMatcherFunction& cookie_matcher, | 197 const CookieMatcherFunction& cookie_matcher, |
| 193 net::URLRequestContextGetter* rq_context, | 198 net::URLRequestContextGetter* rq_context, |
| 194 const base::Time begin, | 199 const base::Time begin, |
| 195 const base::Time end, | 200 const base::Time end, |
| (...skipping 27 matching lines...) Expand all Loading... | |
| 223 scoped_refptr<IndexedDBContextImpl> indexed_db_context_; | 228 scoped_refptr<IndexedDBContextImpl> indexed_db_context_; |
| 224 scoped_refptr<CacheStorageContextImpl> cache_storage_context_; | 229 scoped_refptr<CacheStorageContextImpl> cache_storage_context_; |
| 225 scoped_refptr<ServiceWorkerContextWrapper> service_worker_context_; | 230 scoped_refptr<ServiceWorkerContextWrapper> service_worker_context_; |
| 226 scoped_refptr<PushMessagingContext> push_messaging_context_; | 231 scoped_refptr<PushMessagingContext> push_messaging_context_; |
| 227 scoped_refptr<storage::SpecialStoragePolicy> special_storage_policy_; | 232 scoped_refptr<storage::SpecialStoragePolicy> special_storage_policy_; |
| 228 scoped_refptr<HostZoomLevelContext> host_zoom_level_context_; | 233 scoped_refptr<HostZoomLevelContext> host_zoom_level_context_; |
| 229 scoped_refptr<PlatformNotificationContextImpl> platform_notification_context_; | 234 scoped_refptr<PlatformNotificationContextImpl> platform_notification_context_; |
| 230 scoped_refptr<BackgroundSyncContext> background_sync_context_; | 235 scoped_refptr<BackgroundSyncContext> background_sync_context_; |
| 231 scoped_refptr<PaymentAppContextImpl> payment_app_context_; | 236 scoped_refptr<PaymentAppContextImpl> payment_app_context_; |
| 232 scoped_refptr<BroadcastChannelProvider> broadcast_channel_provider_; | 237 scoped_refptr<BroadcastChannelProvider> broadcast_channel_provider_; |
| 238 scoped_refptr<BluetoothAllowedDevicesMap> bluetooth_allowed_devices_map_; | |
| 233 | 239 |
| 234 mojo::BindingSet<mojom::StoragePartitionService> bindings_; | 240 mojo::BindingSet<mojom::StoragePartitionService> bindings_; |
| 235 | 241 |
| 236 // Raw pointer that should always be valid. The BrowserContext owns the | 242 // Raw pointer that should always be valid. The BrowserContext owns the |
| 237 // StoragePartitionImplMap which then owns StoragePartitionImpl. When the | 243 // StoragePartitionImplMap which then owns StoragePartitionImpl. When the |
| 238 // BrowserContext is destroyed, |this| will be destroyed too. | 244 // BrowserContext is destroyed, |this| will be destroyed too. |
| 239 BrowserContext* browser_context_; | 245 BrowserContext* browser_context_; |
| 240 | 246 |
| 241 DISALLOW_COPY_AND_ASSIGN(StoragePartitionImpl); | 247 DISALLOW_COPY_AND_ASSIGN(StoragePartitionImpl); |
| 242 }; | 248 }; |
| 243 | 249 |
| 244 } // namespace content | 250 } // namespace content |
| 245 | 251 |
| 246 #endif // CONTENT_BROWSER_STORAGE_PARTITION_IMPL_H_ | 252 #endif // CONTENT_BROWSER_STORAGE_PARTITION_IMPL_H_ |
| OLD | NEW |