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 "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
11 #include "content/browser/appcache/chrome_appcache_service.h" | 11 #include "content/browser/appcache/chrome_appcache_service.h" |
12 #include "content/browser/dom_storage/dom_storage_context_wrapper.h" | 12 #include "content/browser/dom_storage/dom_storage_context_wrapper.h" |
13 #include "content/browser/indexed_db/indexed_db_context_impl.h" | 13 #include "content/browser/indexed_db/indexed_db_context_impl.h" |
14 #include "content/browser/media/webrtc_identity_store.h" | 14 #include "content/browser/media/webrtc_identity_store.h" |
15 #include "content/browser/service_worker/service_worker_context_wrapper.h" | 15 #include "content/browser/service_worker/service_worker_context_wrapper.h" |
16 #include "content/common/content_export.h" | 16 #include "content/common/content_export.h" |
17 #include "content/public/browser/storage_partition.h" | 17 #include "content/public/browser/storage_partition.h" |
18 #include "webkit/browser/quota/special_storage_policy.h" | 18 #include "webkit/browser/quota/special_storage_policy.h" |
19 | 19 |
20 namespace content { | 20 namespace content { |
21 | 21 |
| 22 class HostZoomLevelContext; |
| 23 |
22 class StoragePartitionImpl : public StoragePartition { | 24 class StoragePartitionImpl : public StoragePartition { |
23 public: | 25 public: |
24 CONTENT_EXPORT virtual ~StoragePartitionImpl(); | 26 CONTENT_EXPORT virtual ~StoragePartitionImpl(); |
25 | 27 |
26 // Quota managed data uses a different bitmask for types than | 28 // Quota managed data uses a different bitmask for types than |
27 // StoragePartition uses. This method generates that mask. | 29 // StoragePartition uses. This method generates that mask. |
28 CONTENT_EXPORT static int GenerateQuotaClientMask(uint32 remove_mask); | 30 CONTENT_EXPORT static int GenerateQuotaClientMask(uint32 remove_mask); |
29 | 31 |
30 CONTENT_EXPORT void OverrideQuotaManagerForTesting( | 32 CONTENT_EXPORT void OverrideQuotaManagerForTesting( |
31 quota::QuotaManager* quota_manager); | 33 quota::QuotaManager* quota_manager); |
32 CONTENT_EXPORT void OverrideSpecialStoragePolicyForTesting( | 34 CONTENT_EXPORT void OverrideSpecialStoragePolicyForTesting( |
33 quota::SpecialStoragePolicy* special_storage_policy); | 35 quota::SpecialStoragePolicy* special_storage_policy); |
34 | 36 |
35 // StoragePartition interface. | 37 // StoragePartition interface. |
36 virtual base::FilePath GetPath() OVERRIDE; | 38 virtual base::FilePath GetPath() OVERRIDE; |
37 virtual net::URLRequestContextGetter* GetURLRequestContext() OVERRIDE; | 39 virtual net::URLRequestContextGetter* GetURLRequestContext() OVERRIDE; |
38 virtual net::URLRequestContextGetter* GetMediaURLRequestContext() OVERRIDE; | 40 virtual net::URLRequestContextGetter* GetMediaURLRequestContext() OVERRIDE; |
39 virtual quota::QuotaManager* GetQuotaManager() OVERRIDE; | 41 virtual quota::QuotaManager* GetQuotaManager() OVERRIDE; |
40 virtual ChromeAppCacheService* GetAppCacheService() OVERRIDE; | 42 virtual ChromeAppCacheService* GetAppCacheService() OVERRIDE; |
41 virtual fileapi::FileSystemContext* GetFileSystemContext() OVERRIDE; | 43 virtual fileapi::FileSystemContext* GetFileSystemContext() OVERRIDE; |
42 virtual webkit_database::DatabaseTracker* GetDatabaseTracker() OVERRIDE; | 44 virtual webkit_database::DatabaseTracker* GetDatabaseTracker() OVERRIDE; |
43 virtual DOMStorageContextWrapper* GetDOMStorageContext() OVERRIDE; | 45 virtual DOMStorageContextWrapper* GetDOMStorageContext() OVERRIDE; |
44 virtual IndexedDBContextImpl* GetIndexedDBContext() OVERRIDE; | 46 virtual IndexedDBContextImpl* GetIndexedDBContext() OVERRIDE; |
45 virtual ServiceWorkerContextWrapper* GetServiceWorkerContext() OVERRIDE; | 47 virtual ServiceWorkerContextWrapper* GetServiceWorkerContext() OVERRIDE; |
| 48 virtual HostZoomMap* GetHostZoomMap() OVERRIDE; |
| 49 virtual PrefService* GetZoomLevelPrefs() OVERRIDE; |
46 | 50 |
47 virtual void ClearDataForOrigin( | 51 virtual void ClearDataForOrigin( |
48 uint32 remove_mask, | 52 uint32 remove_mask, |
49 uint32 quota_storage_remove_mask, | 53 uint32 quota_storage_remove_mask, |
50 const GURL& storage_origin, | 54 const GURL& storage_origin, |
51 net::URLRequestContextGetter* request_context_getter, | 55 net::URLRequestContextGetter* request_context_getter, |
52 const base::Closure& callback) OVERRIDE; | 56 const base::Closure& callback) OVERRIDE; |
53 virtual void ClearData(uint32 remove_mask, | 57 virtual void ClearData(uint32 remove_mask, |
54 uint32 quota_storage_remove_mask, | 58 uint32 quota_storage_remove_mask, |
55 const GURL& storage_origin, | 59 const GURL& storage_origin, |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 CONTENT_EXPORT StoragePartitionImpl( | 114 CONTENT_EXPORT StoragePartitionImpl( |
111 const base::FilePath& partition_path, | 115 const base::FilePath& partition_path, |
112 quota::QuotaManager* quota_manager, | 116 quota::QuotaManager* quota_manager, |
113 ChromeAppCacheService* appcache_service, | 117 ChromeAppCacheService* appcache_service, |
114 fileapi::FileSystemContext* filesystem_context, | 118 fileapi::FileSystemContext* filesystem_context, |
115 webkit_database::DatabaseTracker* database_tracker, | 119 webkit_database::DatabaseTracker* database_tracker, |
116 DOMStorageContextWrapper* dom_storage_context, | 120 DOMStorageContextWrapper* dom_storage_context, |
117 IndexedDBContextImpl* indexed_db_context, | 121 IndexedDBContextImpl* indexed_db_context, |
118 ServiceWorkerContextWrapper* service_worker_context, | 122 ServiceWorkerContextWrapper* service_worker_context, |
119 WebRTCIdentityStore* webrtc_identity_store, | 123 WebRTCIdentityStore* webrtc_identity_store, |
120 quota::SpecialStoragePolicy* special_storage_policy); | 124 quota::SpecialStoragePolicy* special_storage_policy, |
| 125 scoped_ptr<HostZoomLevelContext> host_zoom_level_context); |
121 | 126 |
122 void ClearDataImpl(uint32 remove_mask, | 127 void ClearDataImpl(uint32 remove_mask, |
123 uint32 quota_storage_remove_mask, | 128 uint32 quota_storage_remove_mask, |
124 const GURL& remove_origin, | 129 const GURL& remove_origin, |
125 const OriginMatcherFunction& origin_matcher, | 130 const OriginMatcherFunction& origin_matcher, |
126 net::URLRequestContextGetter* rq_context, | 131 net::URLRequestContextGetter* rq_context, |
127 const base::Time begin, | 132 const base::Time begin, |
128 const base::Time end, | 133 const base::Time end, |
129 const base::Closure& callback); | 134 const base::Closure& callback); |
130 | 135 |
(...skipping 19 matching lines...) Expand all Loading... |
150 scoped_refptr<net::URLRequestContextGetter> media_url_request_context_; | 155 scoped_refptr<net::URLRequestContextGetter> media_url_request_context_; |
151 scoped_refptr<quota::QuotaManager> quota_manager_; | 156 scoped_refptr<quota::QuotaManager> quota_manager_; |
152 scoped_refptr<ChromeAppCacheService> appcache_service_; | 157 scoped_refptr<ChromeAppCacheService> appcache_service_; |
153 scoped_refptr<fileapi::FileSystemContext> filesystem_context_; | 158 scoped_refptr<fileapi::FileSystemContext> filesystem_context_; |
154 scoped_refptr<webkit_database::DatabaseTracker> database_tracker_; | 159 scoped_refptr<webkit_database::DatabaseTracker> database_tracker_; |
155 scoped_refptr<DOMStorageContextWrapper> dom_storage_context_; | 160 scoped_refptr<DOMStorageContextWrapper> dom_storage_context_; |
156 scoped_refptr<IndexedDBContextImpl> indexed_db_context_; | 161 scoped_refptr<IndexedDBContextImpl> indexed_db_context_; |
157 scoped_refptr<ServiceWorkerContextWrapper> service_worker_context_; | 162 scoped_refptr<ServiceWorkerContextWrapper> service_worker_context_; |
158 scoped_refptr<WebRTCIdentityStore> webrtc_identity_store_; | 163 scoped_refptr<WebRTCIdentityStore> webrtc_identity_store_; |
159 scoped_refptr<quota::SpecialStoragePolicy> special_storage_policy_; | 164 scoped_refptr<quota::SpecialStoragePolicy> special_storage_policy_; |
| 165 scoped_ptr<HostZoomLevelContext> host_zoom_level_context_; |
160 | 166 |
161 DISALLOW_COPY_AND_ASSIGN(StoragePartitionImpl); | 167 DISALLOW_COPY_AND_ASSIGN(StoragePartitionImpl); |
162 }; | 168 }; |
163 | 169 |
164 } // namespace content | 170 } // namespace content |
165 | 171 |
166 #endif // CONTENT_BROWSER_STORAGE_PARTITION_IMPL_H_ | 172 #endif // CONTENT_BROWSER_STORAGE_PARTITION_IMPL_H_ |
OLD | NEW |