| 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> |
| 9 |
| 8 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| 9 #include "base/files/file_path.h" | 11 #include "base/files/file_path.h" |
| 10 #include "base/gtest_prod_util.h" | 12 #include "base/gtest_prod_util.h" |
| 13 #include "base/macros.h" |
| 11 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
| 12 #include "content/browser/appcache/chrome_appcache_service.h" | 15 #include "content/browser/appcache/chrome_appcache_service.h" |
| 13 #include "content/browser/background_sync/background_sync_context_impl.h" | 16 #include "content/browser/background_sync/background_sync_context_impl.h" |
| 14 #include "content/browser/cache_storage/cache_storage_context_impl.h" | 17 #include "content/browser/cache_storage/cache_storage_context_impl.h" |
| 15 #include "content/browser/dom_storage/dom_storage_context_wrapper.h" | 18 #include "content/browser/dom_storage/dom_storage_context_wrapper.h" |
| 16 #include "content/browser/host_zoom_level_context.h" | 19 #include "content/browser/host_zoom_level_context.h" |
| 17 #include "content/browser/indexed_db/indexed_db_context_impl.h" | 20 #include "content/browser/indexed_db/indexed_db_context_impl.h" |
| 18 #include "content/browser/media/webrtc_identity_store.h" | 21 #include "content/browser/media/webrtc_identity_store.h" |
| 19 #include "content/browser/navigator_connect/navigator_connect_context_impl.h" | 22 #include "content/browser/navigator_connect/navigator_connect_context_impl.h" |
| 20 #include "content/browser/notifications/platform_notification_context_impl.h" | 23 #include "content/browser/notifications/platform_notification_context_impl.h" |
| 21 #include "content/browser/service_worker/service_worker_context_wrapper.h" | 24 #include "content/browser/service_worker/service_worker_context_wrapper.h" |
| 22 #include "content/common/content_export.h" | 25 #include "content/common/content_export.h" |
| 23 #include "content/public/browser/storage_partition.h" | 26 #include "content/public/browser/storage_partition.h" |
| 24 #include "storage/browser/quota/special_storage_policy.h" | 27 #include "storage/browser/quota/special_storage_policy.h" |
| 25 | 28 |
| 26 namespace content { | 29 namespace content { |
| 27 | 30 |
| 28 class StoragePartitionImpl : public StoragePartition { | 31 class StoragePartitionImpl : public StoragePartition { |
| 29 public: | 32 public: |
| 30 CONTENT_EXPORT ~StoragePartitionImpl() override; | 33 CONTENT_EXPORT ~StoragePartitionImpl() override; |
| 31 | 34 |
| 32 // Quota managed data uses a different bitmask for types than | 35 // Quota managed data uses a different bitmask for types than |
| 33 // StoragePartition uses. This method generates that mask. | 36 // StoragePartition uses. This method generates that mask. |
| 34 CONTENT_EXPORT static int GenerateQuotaClientMask(uint32 remove_mask); | 37 CONTENT_EXPORT static int GenerateQuotaClientMask(uint32_t remove_mask); |
| 35 | 38 |
| 36 CONTENT_EXPORT void OverrideQuotaManagerForTesting( | 39 CONTENT_EXPORT void OverrideQuotaManagerForTesting( |
| 37 storage::QuotaManager* quota_manager); | 40 storage::QuotaManager* quota_manager); |
| 38 CONTENT_EXPORT void OverrideSpecialStoragePolicyForTesting( | 41 CONTENT_EXPORT void OverrideSpecialStoragePolicyForTesting( |
| 39 storage::SpecialStoragePolicy* special_storage_policy); | 42 storage::SpecialStoragePolicy* special_storage_policy); |
| 40 | 43 |
| 41 // StoragePartition interface. | 44 // StoragePartition interface. |
| 42 base::FilePath GetPath() override; | 45 base::FilePath GetPath() override; |
| 43 net::URLRequestContextGetter* GetURLRequestContext() override; | 46 net::URLRequestContextGetter* GetURLRequestContext() override; |
| 44 net::URLRequestContextGetter* GetMediaURLRequestContext() override; | 47 net::URLRequestContextGetter* GetMediaURLRequestContext() override; |
| 45 storage::QuotaManager* GetQuotaManager() override; | 48 storage::QuotaManager* GetQuotaManager() override; |
| 46 ChromeAppCacheService* GetAppCacheService() override; | 49 ChromeAppCacheService* GetAppCacheService() override; |
| 47 storage::FileSystemContext* GetFileSystemContext() override; | 50 storage::FileSystemContext* GetFileSystemContext() override; |
| 48 storage::DatabaseTracker* GetDatabaseTracker() override; | 51 storage::DatabaseTracker* GetDatabaseTracker() override; |
| 49 DOMStorageContextWrapper* GetDOMStorageContext() override; | 52 DOMStorageContextWrapper* GetDOMStorageContext() override; |
| 50 IndexedDBContextImpl* GetIndexedDBContext() override; | 53 IndexedDBContextImpl* GetIndexedDBContext() override; |
| 51 CacheStorageContextImpl* GetCacheStorageContext() override; | 54 CacheStorageContextImpl* GetCacheStorageContext() override; |
| 52 ServiceWorkerContextWrapper* GetServiceWorkerContext() override; | 55 ServiceWorkerContextWrapper* GetServiceWorkerContext() override; |
| 53 GeofencingManager* GetGeofencingManager() override; | 56 GeofencingManager* GetGeofencingManager() override; |
| 54 HostZoomMap* GetHostZoomMap() override; | 57 HostZoomMap* GetHostZoomMap() override; |
| 55 HostZoomLevelContext* GetHostZoomLevelContext() override; | 58 HostZoomLevelContext* GetHostZoomLevelContext() override; |
| 56 ZoomLevelDelegate* GetZoomLevelDelegate() override; | 59 ZoomLevelDelegate* GetZoomLevelDelegate() override; |
| 57 NavigatorConnectContextImpl* GetNavigatorConnectContext() override; | 60 NavigatorConnectContextImpl* GetNavigatorConnectContext() override; |
| 58 PlatformNotificationContextImpl* GetPlatformNotificationContext() override; | 61 PlatformNotificationContextImpl* GetPlatformNotificationContext() override; |
| 59 BackgroundSyncContextImpl* GetBackgroundSyncContext() override; | 62 BackgroundSyncContextImpl* GetBackgroundSyncContext() override; |
| 60 | 63 |
| 61 void ClearDataForOrigin(uint32 remove_mask, | 64 void ClearDataForOrigin(uint32_t remove_mask, |
| 62 uint32 quota_storage_remove_mask, | 65 uint32_t quota_storage_remove_mask, |
| 63 const GURL& storage_origin, | 66 const GURL& storage_origin, |
| 64 net::URLRequestContextGetter* request_context_getter, | 67 net::URLRequestContextGetter* request_context_getter, |
| 65 const base::Closure& callback) override; | 68 const base::Closure& callback) override; |
| 66 void ClearData(uint32 remove_mask, | 69 void ClearData(uint32_t remove_mask, |
| 67 uint32 quota_storage_remove_mask, | 70 uint32_t quota_storage_remove_mask, |
| 68 const GURL& storage_origin, | 71 const GURL& storage_origin, |
| 69 const OriginMatcherFunction& origin_matcher, | 72 const OriginMatcherFunction& origin_matcher, |
| 70 const base::Time begin, | 73 const base::Time begin, |
| 71 const base::Time end, | 74 const base::Time end, |
| 72 const base::Closure& callback) override; | 75 const base::Closure& callback) override; |
| 73 | 76 |
| 74 void Flush() override; | 77 void Flush() override; |
| 75 | 78 |
| 76 WebRTCIdentityStore* GetWebRTCIdentityStore(); | 79 WebRTCIdentityStore* GetWebRTCIdentityStore(); |
| 77 | 80 |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 CacheStorageContextImpl* cache_storage_context, | 141 CacheStorageContextImpl* cache_storage_context, |
| 139 ServiceWorkerContextWrapper* service_worker_context, | 142 ServiceWorkerContextWrapper* service_worker_context, |
| 140 WebRTCIdentityStore* webrtc_identity_store, | 143 WebRTCIdentityStore* webrtc_identity_store, |
| 141 storage::SpecialStoragePolicy* special_storage_policy, | 144 storage::SpecialStoragePolicy* special_storage_policy, |
| 142 GeofencingManager* geofencing_manager, | 145 GeofencingManager* geofencing_manager, |
| 143 HostZoomLevelContext* host_zoom_level_context, | 146 HostZoomLevelContext* host_zoom_level_context, |
| 144 NavigatorConnectContextImpl* navigator_connect_context, | 147 NavigatorConnectContextImpl* navigator_connect_context, |
| 145 PlatformNotificationContextImpl* platform_notification_context, | 148 PlatformNotificationContextImpl* platform_notification_context, |
| 146 BackgroundSyncContextImpl* background_sync_context); | 149 BackgroundSyncContextImpl* background_sync_context); |
| 147 | 150 |
| 148 void ClearDataImpl(uint32 remove_mask, | 151 void ClearDataImpl(uint32_t remove_mask, |
| 149 uint32 quota_storage_remove_mask, | 152 uint32_t quota_storage_remove_mask, |
| 150 const GURL& remove_origin, | 153 const GURL& remove_origin, |
| 151 const OriginMatcherFunction& origin_matcher, | 154 const OriginMatcherFunction& origin_matcher, |
| 152 net::URLRequestContextGetter* rq_context, | 155 net::URLRequestContextGetter* rq_context, |
| 153 const base::Time begin, | 156 const base::Time begin, |
| 154 const base::Time end, | 157 const base::Time end, |
| 155 const base::Closure& callback); | 158 const base::Closure& callback); |
| 156 | 159 |
| 157 // Used by StoragePartitionImplMap. | 160 // Used by StoragePartitionImplMap. |
| 158 // | 161 // |
| 159 // TODO(ajwong): These should be taken in the constructor and in Create() but | 162 // TODO(ajwong): These should be taken in the constructor and in Create() but |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 // StoragePartitionImplMap which then owns StoragePartitionImpl. When the | 197 // StoragePartitionImplMap which then owns StoragePartitionImpl. When the |
| 195 // BrowserContext is destroyed, |this| will be destroyed too. | 198 // BrowserContext is destroyed, |this| will be destroyed too. |
| 196 BrowserContext* browser_context_; | 199 BrowserContext* browser_context_; |
| 197 | 200 |
| 198 DISALLOW_COPY_AND_ASSIGN(StoragePartitionImpl); | 201 DISALLOW_COPY_AND_ASSIGN(StoragePartitionImpl); |
| 199 }; | 202 }; |
| 200 | 203 |
| 201 } // namespace content | 204 } // namespace content |
| 202 | 205 |
| 203 #endif // CONTENT_BROWSER_STORAGE_PARTITION_IMPL_H_ | 206 #endif // CONTENT_BROWSER_STORAGE_PARTITION_IMPL_H_ |
| OLD | NEW |