Chromium Code Reviews| Index: webkit/dom_storage/dom_storage_area.h |
| =================================================================== |
| --- webkit/dom_storage/dom_storage_area.h (revision 127221) |
| +++ webkit/dom_storage/dom_storage_area.h (working copy) |
| @@ -27,6 +27,9 @@ |
| : public base::RefCountedThreadSafe<DomStorageArea> { |
| public: |
| + static FilePath DatabaseFileNameFromOrigin(const GURL& origin); |
|
benm (inactive)
2012/03/19 14:22:53
Why is this public now?
michaeln
2012/03/19 16:04:42
This change really belongs in https://chromiumcode
|
| + static const FilePath::CharType kDatabaseFileExtension[]; |
| + |
| DomStorageArea(int64 namespace_id, |
| const GURL& origin, |
| const FilePath& directory, |
| @@ -45,23 +48,30 @@ |
| 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; |
| + |
| // 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* GetCommitBatch(); |
| + void OnCommitTimer(); |
| void CommitChanges(); |
| + void OnCommitComplete(); |
| + void CommitShutdownChanges(); |
| - static FilePath DatabaseFileNameFromOrigin(const GURL& origin); |
| - |
| ~DomStorageArea(); |
| int64 namespace_id_; |
| @@ -70,10 +80,11 @@ |
| 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 |