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_PUBLIC_BROWSER_STORAGE_PARTITION_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_STORAGE_PARTITION_H_ |
6 #define CONTENT_PUBLIC_BROWSER_STORAGE_PARTITION_H_ | 6 #define CONTENT_PUBLIC_BROWSER_STORAGE_PARTITION_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 virtual net::URLRequestContextGetter* GetURLRequestContext() = 0; | 49 virtual net::URLRequestContextGetter* GetURLRequestContext() = 0; |
50 virtual net::URLRequestContextGetter* GetMediaURLRequestContext() = 0; | 50 virtual net::URLRequestContextGetter* GetMediaURLRequestContext() = 0; |
51 virtual quota::QuotaManager* GetQuotaManager() = 0; | 51 virtual quota::QuotaManager* GetQuotaManager() = 0; |
52 virtual AppCacheService* GetAppCacheService() = 0; | 52 virtual AppCacheService* GetAppCacheService() = 0; |
53 virtual fileapi::FileSystemContext* GetFileSystemContext() = 0; | 53 virtual fileapi::FileSystemContext* GetFileSystemContext() = 0; |
54 virtual webkit_database::DatabaseTracker* GetDatabaseTracker() = 0; | 54 virtual webkit_database::DatabaseTracker* GetDatabaseTracker() = 0; |
55 virtual DOMStorageContext* GetDOMStorageContext() = 0; | 55 virtual DOMStorageContext* GetDOMStorageContext() = 0; |
56 virtual IndexedDBContext* GetIndexedDBContext() = 0; | 56 virtual IndexedDBContext* GetIndexedDBContext() = 0; |
57 virtual ServiceWorkerContext* GetServiceWorkerContext() = 0; | 57 virtual ServiceWorkerContext* GetServiceWorkerContext() = 0; |
58 | 58 |
59 enum RemoveDataMask { | 59 static const uint32 REMOVE_DATA_MASK_APPCACHE = 1 << 0; |
60 REMOVE_DATA_MASK_APPCACHE = 1 << 0, | 60 static const uint32 REMOVE_DATA_MASK_COOKIES = 1 << 1; |
61 REMOVE_DATA_MASK_COOKIES = 1 << 1, | 61 static const uint32 REMOVE_DATA_MASK_FILE_SYSTEMS = 1 << 2; |
62 REMOVE_DATA_MASK_FILE_SYSTEMS = 1 << 2, | 62 static const uint32 REMOVE_DATA_MASK_INDEXEDDB = 1 << 3; |
63 REMOVE_DATA_MASK_INDEXEDDB = 1 << 3, | 63 static const uint32 REMOVE_DATA_MASK_LOCAL_STORAGE = 1 << 4; |
64 REMOVE_DATA_MASK_LOCAL_STORAGE = 1 << 4, | 64 static const uint32 REMOVE_DATA_MASK_SHADER_CACHE = 1 << 5; |
65 REMOVE_DATA_MASK_SHADER_CACHE = 1 << 5, | 65 static const uint32 REMOVE_DATA_MASK_WEBSQL = 1 << 6; |
66 REMOVE_DATA_MASK_WEBSQL = 1 << 6, | 66 static const uint32 REMOVE_DATA_MASK_WEBRTC_IDENTITY = 1 << 7; |
67 REMOVE_DATA_MASK_WEBRTC_IDENTITY = 1 << 7, | 67 static const uint32 REMOVE_DATA_MASK_ALL = 0xFFFFFFFF; |
68 REMOVE_DATA_MASK_ALL = -1 | |
69 }; | |
70 | 68 |
71 enum QuotaManagedStorageMask { | 69 // Corresponds to quota::kStorageTypeTemporary. |
72 // Corresponds to quota::kStorageTypeTemporary. | 70 static const uint32 QUOTA_MANAGED_STORAGE_MASK_TEMPORARY = 1 << 0; |
73 QUOTA_MANAGED_STORAGE_MASK_TEMPORARY = 1 << 0, | 71 // Corresponds to quota::kStorageTypePersistent. |
74 | 72 static const uint32 QUOTA_MANAGED_STORAGE_MASK_PERSISTENT = 1 << 1; |
75 // Corresponds to quota::kStorageTypePersistent. | 73 // Corresponds to quota::kStorageTypeSyncable. |
76 QUOTA_MANAGED_STORAGE_MASK_PERSISTENT = 1 << 1, | 74 static const uint32 QUOTA_MANAGED_STORAGE_MASK_SYNCABLE = 1 << 2; |
77 | 75 static const uint32 QUOTA_MANAGED_STORAGE_MASK_ALL = 0xFFFFFFFF; |
78 // Corresponds to quota::kStorageTypeSyncable. | |
79 QUOTA_MANAGED_STORAGE_MASK_SYNCABLE = 1 << 2, | |
80 | |
81 QUOTA_MANAGED_STORAGE_MASK_ALL = -1 | |
82 }; | |
83 | 76 |
84 // Starts an asynchronous task that does a best-effort clear the data | 77 // Starts an asynchronous task that does a best-effort clear the data |
85 // corresponding to the given |remove_mask| and |quota_storage_remove_mask| | 78 // corresponding to the given |remove_mask| and |quota_storage_remove_mask| |
86 // inside this StoragePartition for the given |storage_origin|. | 79 // inside this StoragePartition for the given |storage_origin|. |
87 // Note session dom storage is not cleared even if you specify | 80 // Note session dom storage is not cleared even if you specify |
88 // REMOVE_DATA_MASK_LOCAL_STORAGE. | 81 // REMOVE_DATA_MASK_LOCAL_STORAGE. |
89 // | 82 // |
90 // TODO(ajwong): Right now, the embedder may have some | 83 // TODO(ajwong): Right now, the embedder may have some |
91 // URLRequestContextGetter objects that the StoragePartition does not know | 84 // URLRequestContextGetter objects that the StoragePartition does not know |
92 // about. This will no longer be the case when we resolve | 85 // about. This will no longer be the case when we resolve |
(...skipping 25 matching lines...) Expand all Loading... |
118 const base::Time end, | 111 const base::Time end, |
119 const base::Closure& callback) = 0; | 112 const base::Closure& callback) = 0; |
120 | 113 |
121 protected: | 114 protected: |
122 virtual ~StoragePartition() {} | 115 virtual ~StoragePartition() {} |
123 }; | 116 }; |
124 | 117 |
125 } // namespace content | 118 } // namespace content |
126 | 119 |
127 #endif // CONTENT_PUBLIC_BROWSER_STORAGE_PARTITION_H_ | 120 #endif // CONTENT_PUBLIC_BROWSER_STORAGE_PARTITION_H_ |
OLD | NEW |