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 "content/renderer/dom_storage/webstoragearea_impl.h" | 5 #include "content/renderer/dom_storage/webstoragearea_impl.h" |
6 | 6 |
7 #include "base/lazy_instance.h" | 7 #include "base/lazy_instance.h" |
8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
9 #include "base/time.h" | 9 #include "base/time.h" |
10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
11 #include "content/common/dom_storage_messages.h" | 11 #include "content/common/dom_storage_messages.h" |
12 #include "content/renderer/dom_storage/dom_storage_dispatcher.h" | 12 #include "content/renderer/dom_storage/dom_storage_dispatcher.h" |
13 #include "content/renderer/render_thread_impl.h" | 13 #include "content/renderer/render_thread_impl.h" |
14 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURL.h" | 14 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURL.h" |
15 #include "webkit/dom_storage/dom_storage_cached_area.h" | 15 #include "webkit/dom_storage/dom_storage_cached_area.h" |
16 | 16 |
17 using dom_storage::DomStorageCachedArea; | 17 using dom_storage::DomStorageCachedArea; |
18 using WebKit::WebString; | 18 using WebKit::WebString; |
19 using WebKit::WebURL; | 19 using WebKit::WebURL; |
20 | 20 |
| 21 namespace content { |
| 22 |
21 namespace { | 23 namespace { |
22 typedef IDMap<WebStorageAreaImpl> AreaImplMap; | 24 typedef IDMap<WebStorageAreaImpl> AreaImplMap; |
23 base::LazyInstance<AreaImplMap>::Leaky | 25 base::LazyInstance<AreaImplMap>::Leaky |
24 g_all_areas_map = LAZY_INSTANCE_INITIALIZER; | 26 g_all_areas_map = LAZY_INSTANCE_INITIALIZER; |
25 | 27 |
26 DomStorageDispatcher* dispatcher() { | 28 DomStorageDispatcher* dispatcher() { |
27 return RenderThreadImpl::current()->dom_storage_dispatcher(); | 29 return RenderThreadImpl::current()->dom_storage_dispatcher(); |
28 } | 30 } |
29 } // namespace | 31 } // namespace |
30 | 32 |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 cached_area_->RemoveItem(connection_id_, key, page_url); | 75 cached_area_->RemoveItem(connection_id_, key, page_url); |
74 } | 76 } |
75 | 77 |
76 void WebStorageAreaImpl::clear(const WebURL& page_url) { | 78 void WebStorageAreaImpl::clear(const WebURL& page_url) { |
77 cached_area_->Clear(connection_id_, page_url); | 79 cached_area_->Clear(connection_id_, page_url); |
78 } | 80 } |
79 | 81 |
80 size_t WebStorageAreaImpl::memoryBytesUsedByCache() const { | 82 size_t WebStorageAreaImpl::memoryBytesUsedByCache() const { |
81 return cached_area_->MemoryBytesUsedByCache(); | 83 return cached_area_->MemoryBytesUsedByCache(); |
82 } | 84 } |
| 85 |
| 86 } // namespace content |
OLD | NEW |