| 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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 // Corresponds to quota::kStorageTypeTemporary. | 62 // Corresponds to quota::kStorageTypeTemporary. |
| 63 kQuotaManagedTemporaryStorage = 1 << 1, | 63 kQuotaManagedTemporaryStorage = 1 << 1, |
| 64 | 64 |
| 65 // Corresponds to quota::kStorageTypePersistent. | 65 // Corresponds to quota::kStorageTypePersistent. |
| 66 kQuotaManagedPersistentStorage = 1 << 2, | 66 kQuotaManagedPersistentStorage = 1 << 2, |
| 67 | 67 |
| 68 // Local dom storage. | 68 // Local dom storage. |
| 69 kLocalDomStorage = 1 << 3, | 69 kLocalDomStorage = 1 << 3, |
| 70 kSessionDomStorage = 1 << 4, | 70 kSessionDomStorage = 1 << 4, |
| 71 | 71 |
| 72 // Local shader storage. |
| 73 kShaderStorage = 1 << 5, |
| 74 |
| 72 kAllStorage = -1, | 75 kAllStorage = -1, |
| 73 }; | 76 }; |
| 74 | 77 |
| 75 // Starts an asynchronous task that does a best-effort clear the data | 78 // Starts an asynchronous task that does a best-effort clear the data |
| 76 // corresonding to the given |storage_mask| inside this StoragePartition for | 79 // corresonding to the given |storage_mask| inside this StoragePartition for |
| 77 // the given |storage_origin|. Note kSessionDomStorage is not cleared and the | 80 // the given |storage_origin|. Note kSessionDomStorage is not cleared and the |
| 78 // mask is ignored. | 81 // mask is ignored. |
| 79 // | 82 // |
| 80 // TODO(ajwong): Right now, the embedder may have some | 83 // TODO(ajwong): Right now, the embedder may have some |
| 81 // URLRequestContextGetter objects that the StoragePartition does not know | 84 // URLRequestContextGetter objects that the StoragePartition does not know |
| 82 // about. This will no longer be the case when we resolve | 85 // about. This will no longer be the case when we resolve |
| 83 // http://crbug.com/159193. Remove |request_context_getter| when that bug | 86 // http://crbug.com/159193. Remove |request_context_getter| when that bug |
| 84 // is fixed. | 87 // is fixed. |
| 85 virtual void AsyncClearDataForOrigin( | 88 virtual void AsyncClearDataForOrigin( |
| 86 uint32 storage_mask, | 89 uint32 storage_mask, |
| 87 const GURL& storage_origin, | 90 const GURL& storage_origin, |
| 88 net::URLRequestContextGetter* request_context_getter) = 0; | 91 net::URLRequestContextGetter* request_context_getter) = 0; |
| 89 | 92 |
| 90 // Similar to AsyncClearDataForOrigin(), but deletes all data out of the | 93 // Similar to AsyncClearDataForOrigin(), but deletes all data out of the |
| 91 // StoragePartition rather than just the data related to this origin. | 94 // StoragePartition rather than just the data related to this origin. |
| 92 virtual void AsyncClearData(uint32 storage_mask) = 0; | 95 virtual void AsyncClearData(uint32 storage_mask) = 0; |
| 93 | 96 |
| 97 // Similar to AsyncClearDataForOrigin(), but deletes all the data out of the |
| 98 // StoragePartion from between the given |begin| and |end| dates rather |
| 99 // then just the data related to this origin. |
| 100 // |
| 101 // Note: This currently only supports the shader cache. |
| 102 virtual void AsyncClearDataBetween(uint32 storage_mask, |
| 103 const base::Time& begin, |
| 104 const base::Time& end, |
| 105 const base::Closure& callback) = 0; |
| 94 protected: | 106 protected: |
| 95 virtual ~StoragePartition() {} | 107 virtual ~StoragePartition() {} |
| 96 }; | 108 }; |
| 97 | 109 |
| 98 } // namespace content | 110 } // namespace content |
| 99 | 111 |
| 100 #endif // CONTENT_PUBLIC_BROWSER_STORAGE_PARTITION_H_ | 112 #endif // CONTENT_PUBLIC_BROWSER_STORAGE_PARTITION_H_ |
| OLD | NEW |