| 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 WEBKIT_DOM_STORAGE_DOM_STORAGE_AREA_H_ | 5 #ifndef WEBKIT_DOM_STORAGE_DOM_STORAGE_AREA_H_ |
| 6 #define WEBKIT_DOM_STORAGE_DOM_STORAGE_AREA_H_ | 6 #define WEBKIT_DOM_STORAGE_DOM_STORAGE_AREA_H_ |
| 7 | 7 |
| 8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
| 9 #include "base/gtest_prod_util.h" | 9 #include "base/gtest_prod_util.h" |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 // Frees up memory when possible. Typically, this method returns | 73 // Frees up memory when possible. Typically, this method returns |
| 74 // the object to its just constructed state, however if uncommitted | 74 // the object to its just constructed state, however if uncommitted |
| 75 // changes are pending, it does nothing. | 75 // changes are pending, it does nothing. |
| 76 void PurgeMemory(); | 76 void PurgeMemory(); |
| 77 | 77 |
| 78 // Schedules the commit of any unsaved changes and enters a | 78 // Schedules the commit of any unsaved changes and enters a |
| 79 // shutdown state such that the value getters and setters will | 79 // shutdown state such that the value getters and setters will |
| 80 // no longer do anything. | 80 // no longer do anything. |
| 81 void Shutdown(); | 81 void Shutdown(); |
| 82 | 82 |
| 83 // Returns true if the data is loaded in memory. |
| 84 bool IsLoadedInMemory() const { return is_initial_import_done_; } |
| 85 |
| 83 private: | 86 private: |
| 84 friend class DomStorageAreaTest; | 87 friend class DomStorageAreaTest; |
| 85 FRIEND_TEST_ALL_PREFIXES(DomStorageAreaTest, DomStorageAreaBasics); | 88 FRIEND_TEST_ALL_PREFIXES(DomStorageAreaTest, DomStorageAreaBasics); |
| 86 FRIEND_TEST_ALL_PREFIXES(DomStorageAreaTest, BackingDatabaseOpened); | 89 FRIEND_TEST_ALL_PREFIXES(DomStorageAreaTest, BackingDatabaseOpened); |
| 87 FRIEND_TEST_ALL_PREFIXES(DomStorageAreaTest, TestDatabaseFilePath); | 90 FRIEND_TEST_ALL_PREFIXES(DomStorageAreaTest, TestDatabaseFilePath); |
| 88 FRIEND_TEST_ALL_PREFIXES(DomStorageAreaTest, CommitTasks); | 91 FRIEND_TEST_ALL_PREFIXES(DomStorageAreaTest, CommitTasks); |
| 89 FRIEND_TEST_ALL_PREFIXES(DomStorageAreaTest, CommitChangesAtShutdown); | 92 FRIEND_TEST_ALL_PREFIXES(DomStorageAreaTest, CommitChangesAtShutdown); |
| 90 FRIEND_TEST_ALL_PREFIXES(DomStorageAreaTest, DeleteOrigin); | 93 FRIEND_TEST_ALL_PREFIXES(DomStorageAreaTest, DeleteOrigin); |
| 91 FRIEND_TEST_ALL_PREFIXES(DomStorageAreaTest, PurgeMemory); | 94 FRIEND_TEST_ALL_PREFIXES(DomStorageAreaTest, PurgeMemory); |
| 92 FRIEND_TEST_ALL_PREFIXES(DomStorageContextTest, PersistentIds); | 95 FRIEND_TEST_ALL_PREFIXES(DomStorageContextTest, PersistentIds); |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 scoped_refptr<SessionStorageDatabase> session_storage_backing_; | 129 scoped_refptr<SessionStorageDatabase> session_storage_backing_; |
| 127 bool is_initial_import_done_; | 130 bool is_initial_import_done_; |
| 128 bool is_shutdown_; | 131 bool is_shutdown_; |
| 129 scoped_ptr<CommitBatch> commit_batch_; | 132 scoped_ptr<CommitBatch> commit_batch_; |
| 130 int commit_batches_in_flight_; | 133 int commit_batches_in_flight_; |
| 131 }; | 134 }; |
| 132 | 135 |
| 133 } // namespace dom_storage | 136 } // namespace dom_storage |
| 134 | 137 |
| 135 #endif // WEBKIT_DOM_STORAGE_DOM_STORAGE_AREA_H_ | 138 #endif // WEBKIT_DOM_STORAGE_DOM_STORAGE_AREA_H_ |
| OLD | NEW |