| 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 base::FilePath GetPath() = 0; | 49 virtual base::FilePath GetPath() = 0; |
| 50 virtual net::URLRequestContextGetter* GetURLRequestContext() = 0; | 50 virtual net::URLRequestContextGetter* GetURLRequestContext() = 0; |
| 51 virtual net::URLRequestContextGetter* GetMediaURLRequestContext() = 0; | 51 virtual net::URLRequestContextGetter* GetMediaURLRequestContext() = 0; |
| 52 virtual quota::QuotaManager* GetQuotaManager() = 0; | 52 virtual quota::QuotaManager* GetQuotaManager() = 0; |
| 53 virtual appcache::AppCacheService* GetAppCacheService() = 0; | 53 virtual appcache::AppCacheService* GetAppCacheService() = 0; |
| 54 virtual fileapi::FileSystemContext* GetFileSystemContext() = 0; | 54 virtual fileapi::FileSystemContext* GetFileSystemContext() = 0; |
| 55 virtual webkit_database::DatabaseTracker* GetDatabaseTracker() = 0; | 55 virtual webkit_database::DatabaseTracker* GetDatabaseTracker() = 0; |
| 56 virtual DOMStorageContext* GetDOMStorageContext() = 0; | 56 virtual DOMStorageContext* GetDOMStorageContext() = 0; |
| 57 virtual IndexedDBContext* GetIndexedDBContext() = 0; | 57 virtual IndexedDBContext* GetIndexedDBContext() = 0; |
| 58 | 58 |
| 59 // Starts an asynchronous task that does a best-effort clear of all the | 59 enum StorageMask { |
| 60 // data inside this StoragePartition for the given |storage_origin|. | 60 kCookies = 1 << 0, |
| 61 |
| 62 // Corresponds to quota::kStorageTypeTemporary. |
| 63 kQuotaManagedTemporaryStorage = 1 << 1, |
| 64 |
| 65 // Corresponds to quota::kStorageTypePersistent. |
| 66 kQuotaManagedPersistentStorage = 1 << 2, |
| 67 |
| 68 // Local dom storage. |
| 69 kLocalDomStorage = 1 << 3, |
| 70 kSessionDomStorage = 1 << 4, |
| 71 |
| 72 kAllStorage = -1, |
| 73 }; |
| 74 |
| 75 // Starts an asynchronous task that does a best-effort clear the data |
| 76 // corresonding to the given |storage_mask| inside this StoragePartition for |
| 77 // the given |storage_origin|. Note kSessionDomStorage is not cleared and the |
| 78 // mask is ignored. |
| 61 // | 79 // |
| 62 // TODO(ajwong): Right now, the embedder may have some | 80 // TODO(ajwong): Right now, the embedder may have some |
| 63 // URLRequestContextGetter objects that the StoragePartition does not know | 81 // URLRequestContextGetter objects that the StoragePartition does not know |
| 64 // about. This will no longer be the case when we resolve | 82 // about. This will no longer be the case when we resolve |
| 65 // http://crbug.com/159193. Remove |request_context_getter| when that bug | 83 // http://crbug.com/159193. Remove |request_context_getter| when that bug |
| 66 // is fixed. | 84 // is fixed. |
| 67 virtual void AsyncClearDataForOrigin( | 85 virtual void AsyncClearDataForOrigin( |
| 86 uint32 storage_mask, |
| 68 const GURL& storage_origin, | 87 const GURL& storage_origin, |
| 69 net::URLRequestContextGetter* request_context_getter) = 0; | 88 net::URLRequestContextGetter* request_context_getter) = 0; |
| 70 | 89 |
| 71 // Similar to AsyncClearDataForOrigin(), but deletes all data out of the | 90 // Similar to AsyncClearDataForOrigin(), but deletes all data out of the |
| 72 // StoragePartition rather than just the data related to this origin. | 91 // StoragePartition rather than just the data related to this origin. |
| 73 virtual void AsyncClearAllData() = 0; | 92 virtual void AsyncClearData(uint32 storage_mask) = 0; |
| 74 | 93 |
| 75 protected: | 94 protected: |
| 76 virtual ~StoragePartition() {} | 95 virtual ~StoragePartition() {} |
| 77 }; | 96 }; |
| 78 | 97 |
| 79 } // namespace content | 98 } // namespace content |
| 80 | 99 |
| 81 #endif // CONTENT_PUBLIC_BROWSER_STORAGE_PARTITION_H_ | 100 #endif // CONTENT_PUBLIC_BROWSER_STORAGE_PARTITION_H_ |
| OLD | NEW |