| 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_cached_area.h" | 5 #include "webkit/dom_storage/dom_storage_cached_area.h" |
| 6 | 6 |
| 7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "base/time.h" | 8 #include "base/time.h" |
| 9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
| 10 #include "webkit/dom_storage/dom_storage_map.h" | 10 #include "webkit/dom_storage/dom_storage_map.h" |
| 11 #include "webkit/dom_storage/dom_storage_proxy.h" | 11 #include "webkit/dom_storage/dom_storage_proxy.h" |
| 12 | 12 |
| 13 namespace dom_storage { | 13 namespace dom_storage { |
| 14 | 14 |
| 15 DomStorageCachedArea::DomStorageCachedArea( | 15 DomStorageCachedArea::DomStorageCachedArea( |
| 16 int64 namespace_id, const GURL& origin, DomStorageProxy* proxy) | 16 int64 namespace_id, const GURL& origin, DomStorageProxy* proxy) |
| 17 : ignore_all_mutations_(false), | 17 : ignore_all_mutations_(false), |
| 18 namespace_id_(namespace_id), origin_(origin), | 18 namespace_id_(namespace_id), origin_(origin), |
| 19 proxy_(proxy), weak_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)) { | 19 proxy_(proxy), weak_factory_(this) { |
| 20 } | 20 } |
| 21 | 21 |
| 22 DomStorageCachedArea::~DomStorageCachedArea() { | 22 DomStorageCachedArea::~DomStorageCachedArea() { |
| 23 } | 23 } |
| 24 | 24 |
| 25 unsigned DomStorageCachedArea::GetLength(int connection_id) { | 25 unsigned DomStorageCachedArea::GetLength(int connection_id) { |
| 26 PrimeIfNeeded(connection_id); | 26 PrimeIfNeeded(connection_id); |
| 27 return map_->Length(); | 27 return map_->Length(); |
| 28 } | 28 } |
| 29 | 29 |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 221 ignore_key_mutations_.erase(found); | 221 ignore_key_mutations_.erase(found); |
| 222 } | 222 } |
| 223 | 223 |
| 224 void DomStorageCachedArea::OnClearComplete(bool success) { | 224 void DomStorageCachedArea::OnClearComplete(bool success) { |
| 225 DCHECK(success); | 225 DCHECK(success); |
| 226 DCHECK(ignore_all_mutations_); | 226 DCHECK(ignore_all_mutations_); |
| 227 ignore_all_mutations_ = false; | 227 ignore_all_mutations_ = false; |
| 228 } | 228 } |
| 229 | 229 |
| 230 } // namespace dom_storage | 230 } // namespace dom_storage |
| OLD | NEW |