| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_IN_PROCESS_WEBKIT_INDEXED_DB_CONTEXT_H_ | 5 #ifndef CONTENT_BROWSER_IN_PROCESS_WEBKIT_INDEXED_DB_CONTEXT_H_ |
| 6 #define CONTENT_BROWSER_IN_PROCESS_WEBKIT_INDEXED_DB_CONTEXT_H_ | 6 #define CONTENT_BROWSER_IN_PROCESS_WEBKIT_INDEXED_DB_CONTEXT_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 // Get the file name of the indexed db file for the given origin. | 49 // Get the file name of the indexed db file for the given origin. |
| 50 FilePath GetIndexedDBFilePath(const string16& origin_id) const; | 50 FilePath GetIndexedDBFilePath(const string16& origin_id) const; |
| 51 | 51 |
| 52 void set_clear_local_state_on_exit(bool clear_local_state) { | 52 void set_clear_local_state_on_exit(bool clear_local_state) { |
| 53 clear_local_state_on_exit_ = clear_local_state; | 53 clear_local_state_on_exit_ = clear_local_state; |
| 54 } | 54 } |
| 55 | 55 |
| 56 // Deletes a single indexed db file. | 56 // Deletes a single indexed db file. |
| 57 void DeleteIndexedDBFile(const FilePath& file_path); | 57 void DeleteIndexedDBFile(const FilePath& file_path); |
| 58 | 58 |
| 59 // Deletes all indexed db files for the given origin. | 59 // Deletes all indexed db files for the given origin. Only works for |
| 60 // extensions, not any origin. |
| 60 void DeleteIndexedDBForOrigin(const string16& origin_id); | 61 void DeleteIndexedDBForOrigin(const string16& origin_id); |
| 61 | 62 |
| 63 // TODO(dgrogan): Once we can delete IndexedDB directories out from |
| 64 // underneath open webkit instances, merge this and DeleteIndexedDBForOrigin. |
| 65 void EvictOrigin(const string16& origin_id); |
| 66 |
| 62 // Does a particular origin get unlimited storage? | 67 // Does a particular origin get unlimited storage? |
| 63 bool IsUnlimitedStorageGranted(const GURL& origin) const; | 68 bool IsUnlimitedStorageGranted(const GURL& origin) const; |
| 64 | 69 |
| 65 void GetAllOriginIdentifiers(std::vector<string16>* origin_ids); | 70 void GetAllOriginIdentifiers(std::vector<string16>* origin_ids); |
| 66 | 71 |
| 67 quota::QuotaManagerProxy* quota_manager_proxy(); | 72 quota::QuotaManagerProxy* quota_manager_proxy(); |
| 68 | 73 |
| 69 #ifdef UNIT_TEST | 74 #ifdef UNIT_TEST |
| 70 // For unit tests allow to override the |data_path_|. | 75 // For unit tests allow to override the |data_path_|. |
| 71 void set_data_path(const FilePath& data_path) { data_path_ = data_path; } | 76 void set_data_path(const FilePath& data_path) { data_path_ = data_path; } |
| 72 #endif | 77 #endif |
| 73 | 78 |
| 74 private: | 79 private: |
| 75 scoped_ptr<WebKit::WebIDBFactory> idb_factory_; | 80 scoped_ptr<WebKit::WebIDBFactory> idb_factory_; |
| 76 | 81 |
| 77 // Path where the indexed db data is stored | 82 // Path where the indexed db data is stored |
| 78 FilePath data_path_; | 83 FilePath data_path_; |
| 79 | 84 |
| 80 // True if the destructor should delete its files. | 85 // True if the destructor should delete its files. |
| 81 bool clear_local_state_on_exit_; | 86 bool clear_local_state_on_exit_; |
| 82 | 87 |
| 83 scoped_refptr<quota::SpecialStoragePolicy> special_storage_policy_; | 88 scoped_refptr<quota::SpecialStoragePolicy> special_storage_policy_; |
| 84 | 89 |
| 85 scoped_refptr<quota::QuotaManagerProxy> quota_manager_proxy_; | 90 scoped_refptr<quota::QuotaManagerProxy> quota_manager_proxy_; |
| 86 | 91 |
| 87 DISALLOW_COPY_AND_ASSIGN(IndexedDBContext); | 92 DISALLOW_COPY_AND_ASSIGN(IndexedDBContext); |
| 88 }; | 93 }; |
| 89 | 94 |
| 90 #endif // CONTENT_BROWSER_IN_PROCESS_WEBKIT_INDEXED_DB_CONTEXT_H_ | 95 #endif // CONTENT_BROWSER_IN_PROCESS_WEBKIT_INDEXED_DB_CONTEXT_H_ |
| OLD | NEW |