| 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/file_path.h" | 9 #include "base/file_path.h" |
| 10 #include "base/gtest_prod_util.h" | 10 #include "base/gtest_prod_util.h" |
| 11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
| 12 #include "base/memory/scoped_ptr.h" |
| 12 #include "base/nullable_string16.h" | 13 #include "base/nullable_string16.h" |
| 13 #include "base/string16.h" | 14 #include "base/string16.h" |
| 14 #include "googleurl/src/gurl.h" | 15 #include "googleurl/src/gurl.h" |
| 15 #include "webkit/dom_storage/dom_storage_database.h" | |
| 16 #include "webkit/dom_storage/dom_storage_types.h" | 16 #include "webkit/dom_storage/dom_storage_types.h" |
| 17 | 17 |
| 18 namespace dom_storage { | 18 namespace dom_storage { |
| 19 | 19 |
| 20 class DomStorageDatabaseAdapter; |
| 20 class DomStorageMap; | 21 class DomStorageMap; |
| 21 class DomStorageTaskRunner; | 22 class DomStorageTaskRunner; |
| 22 | 23 |
| 23 // Container for a per-origin Map of key/value pairs potentially | 24 // Container for a per-origin Map of key/value pairs potentially |
| 24 // backed by storage on disk and lazily commits changes to disk. | 25 // backed by storage on disk and lazily commits changes to disk. |
| 25 // See class comments for DomStorageContext for a larger overview. | 26 // See class comments for DomStorageContext for a larger overview. |
| 26 class DomStorageArea | 27 class DomStorageArea |
| 27 : public base::RefCountedThreadSafe<DomStorageArea> { | 28 : public base::RefCountedThreadSafe<DomStorageArea> { |
| 28 | 29 |
| 29 public: | 30 public: |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 void OnCommitComplete(); | 112 void OnCommitComplete(); |
| 112 | 113 |
| 113 void ShutdownInCommitSequence(); | 114 void ShutdownInCommitSequence(); |
| 114 | 115 |
| 115 int64 namespace_id_; | 116 int64 namespace_id_; |
| 116 std::string persistent_namespace_id_; | 117 std::string persistent_namespace_id_; |
| 117 GURL origin_; | 118 GURL origin_; |
| 118 FilePath directory_; | 119 FilePath directory_; |
| 119 scoped_refptr<DomStorageTaskRunner> task_runner_; | 120 scoped_refptr<DomStorageTaskRunner> task_runner_; |
| 120 scoped_refptr<DomStorageMap> map_; | 121 scoped_refptr<DomStorageMap> map_; |
| 121 scoped_ptr<DomStorageDatabase> backing_; | 122 scoped_ptr<DomStorageDatabaseAdapter> backing_; |
| 122 bool is_initial_import_done_; | 123 bool is_initial_import_done_; |
| 123 bool is_shutdown_; | 124 bool is_shutdown_; |
| 124 scoped_ptr<CommitBatch> commit_batch_; | 125 scoped_ptr<CommitBatch> commit_batch_; |
| 125 int commit_batches_in_flight_; | 126 int commit_batches_in_flight_; |
| 126 }; | 127 }; |
| 127 | 128 |
| 128 } // namespace dom_storage | 129 } // namespace dom_storage |
| 129 | 130 |
| 130 #endif // WEBKIT_DOM_STORAGE_DOM_STORAGE_AREA_H_ | 131 #endif // WEBKIT_DOM_STORAGE_DOM_STORAGE_AREA_H_ |
| OLD | NEW |