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 #include "webkit/dom_storage/dom_storage_area.h" | 5 #include "webkit/dom_storage/dom_storage_area.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
9 #include "base/location.h" | 9 #include "base/location.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 if (namespace_id == kLocalStorageNamespaceId && !directory.empty()) { | 64 if (namespace_id == kLocalStorageNamespaceId && !directory.empty()) { |
65 FilePath path = directory.Append(DatabaseFileNameFromOrigin(origin_)); | 65 FilePath path = directory.Append(DatabaseFileNameFromOrigin(origin_)); |
66 backing_.reset(new DomStorageDatabase(path)); | 66 backing_.reset(new DomStorageDatabase(path)); |
67 is_initial_import_done_ = false; | 67 is_initial_import_done_ = false; |
68 } | 68 } |
69 } | 69 } |
70 | 70 |
71 DomStorageArea::~DomStorageArea() { | 71 DomStorageArea::~DomStorageArea() { |
72 } | 72 } |
73 | 73 |
| 74 void DomStorageArea::ExtractValues(ValuesMap* map) { |
| 75 if (is_shutdown_) |
| 76 return; |
| 77 InitialImportIfNeeded(); |
| 78 map_->ExtractValues(map); |
| 79 } |
| 80 |
74 unsigned DomStorageArea::Length() { | 81 unsigned DomStorageArea::Length() { |
75 if (is_shutdown_) | 82 if (is_shutdown_) |
76 return 0; | 83 return 0; |
77 InitialImportIfNeeded(); | 84 InitialImportIfNeeded(); |
78 return map_->Length(); | 85 return map_->Length(); |
79 } | 86 } |
80 | 87 |
81 NullableString16 DomStorageArea::Key(unsigned index) { | 88 NullableString16 DomStorageArea::Key(unsigned index) { |
82 if (is_shutdown_) | 89 if (is_shutdown_) |
83 return NullableString16(true); | 90 return NullableString16(true); |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
297 commit_batch_->clear_all_first, | 304 commit_batch_->clear_all_first, |
298 commit_batch_->changed_values); | 305 commit_batch_->changed_values); |
299 DCHECK(success); | 306 DCHECK(success); |
300 } | 307 } |
301 commit_batch_.reset(); | 308 commit_batch_.reset(); |
302 in_flight_commit_batch_.reset(); | 309 in_flight_commit_batch_.reset(); |
303 backing_.reset(); | 310 backing_.reset(); |
304 } | 311 } |
305 | 312 |
306 } // namespace dom_storage | 313 } // namespace dom_storage |
OLD | NEW |