Index: webkit/dom_storage/dom_storage_area.h |
=================================================================== |
--- webkit/dom_storage/dom_storage_area.h (revision 127613) |
+++ webkit/dom_storage/dom_storage_area.h (working copy) |
@@ -48,33 +48,45 @@ |
DomStorageArea* ShallowCopy(int64 destination_namespace_id); |
+ void Shutdown(); |
+ |
private: |
FRIEND_TEST_ALL_PREFIXES(DomStorageAreaTest, DomStorageAreaBasics); |
FRIEND_TEST_ALL_PREFIXES(DomStorageAreaTest, BackingDatabaseOpened); |
FRIEND_TEST_ALL_PREFIXES(DomStorageAreaTest, TestDatabaseFilePath); |
friend class base::RefCountedThreadSafe<DomStorageArea>; |
+ struct CommitBatch; |
+ ~DomStorageArea(); |
+ |
// If we haven't done so already and this is a local storage area, |
// will attempt to read any values for this origin currently |
// stored on disk. |
void InitialImportIfNeeded(); |
- // Posts a task to write the set of changed values to disk. |
- void ScheduleCommitChanges(); |
+ // Post tasks to defer writing a batch of changed values to |
+ // disk on the commit sequence, and to call back on the main |
+ // task sequence when complete. |
+ CommitBatch* CreateCommitBatchIfNeeded(); |
+ void OnCommitTimer(); |
void CommitChanges(); |
+ void OnCommitComplete(); |
- ~DomStorageArea(); |
+ void ShutdownInCommitSequence(); |
+ |
+ |
int64 namespace_id_; |
GURL origin_; |
FilePath directory_; |
scoped_refptr<DomStorageTaskRunner> task_runner_; |
scoped_refptr<DomStorageMap> map_; |
scoped_ptr<DomStorageDatabase> backing_; |
- bool initial_import_done_; |
- ValuesMap changed_values_; |
- bool clear_all_next_commit_; |
- bool commit_in_flight_; |
+ bool is_initial_import_done_; |
+ bool is_shutdown_; |
+ |
+ scoped_ptr<CommitBatch> commit_batch_; |
+ scoped_ptr<CommitBatch> in_flight_commit_batch_; |
}; |
} // namespace dom_storage |