| 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_macros.h" | 8 #include "base/metrics/histogram_macros.h" |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
| 11 #include "content/common/dom_storage/dom_storage_messages.h" | 11 #include "content/common/dom_storage/dom_storage_messages.h" |
| 12 #include "content/renderer/dom_storage/dom_storage_cached_area.h" | 12 #include "content/renderer/dom_storage/dom_storage_cached_area.h" |
| 13 #include "content/renderer/dom_storage/dom_storage_dispatcher.h" | 13 #include "content/renderer/dom_storage/dom_storage_dispatcher.h" |
| 14 #include "content/renderer/render_thread_impl.h" | 14 #include "content/renderer/render_thread_impl.h" |
| 15 #include "third_party/WebKit/public/platform/WebURL.h" | 15 #include "third_party/WebKit/public/platform/WebURL.h" |
| 16 | 16 |
| 17 using blink::WebString; | 17 using blink::WebString; |
| 18 using blink::WebURL; | 18 using blink::WebURL; |
| 19 | 19 |
| 20 namespace content { | 20 namespace content { |
| 21 | 21 |
| 22 namespace { | 22 namespace { |
| 23 typedef IDMap<WebStorageAreaImpl> AreaImplMap; | 23 typedef IDMap<WebStorageAreaImpl*> AreaImplMap; |
| 24 base::LazyInstance<AreaImplMap>::Leaky | 24 base::LazyInstance<AreaImplMap>::Leaky |
| 25 g_all_areas_map = LAZY_INSTANCE_INITIALIZER; | 25 g_all_areas_map = LAZY_INSTANCE_INITIALIZER; |
| 26 | 26 |
| 27 DomStorageDispatcher* dispatcher() { | 27 DomStorageDispatcher* dispatcher() { |
| 28 return RenderThreadImpl::current()->dom_storage_dispatcher(); | 28 return RenderThreadImpl::current()->dom_storage_dispatcher(); |
| 29 } | 29 } |
| 30 } // namespace | 30 } // namespace |
| 31 | 31 |
| 32 // static | 32 // static |
| 33 WebStorageAreaImpl* WebStorageAreaImpl::FromConnectionId(int id) { | 33 WebStorageAreaImpl* WebStorageAreaImpl::FromConnectionId(int id) { |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 void WebStorageAreaImpl::removeItem( | 70 void WebStorageAreaImpl::removeItem( |
| 71 const WebString& key, const WebURL& page_url) { | 71 const WebString& key, const WebURL& page_url) { |
| 72 cached_area_->RemoveItem(connection_id_, key, page_url); | 72 cached_area_->RemoveItem(connection_id_, key, page_url); |
| 73 } | 73 } |
| 74 | 74 |
| 75 void WebStorageAreaImpl::clear(const WebURL& page_url) { | 75 void WebStorageAreaImpl::clear(const WebURL& page_url) { |
| 76 cached_area_->Clear(connection_id_, page_url); | 76 cached_area_->Clear(connection_id_, page_url); |
| 77 } | 77 } |
| 78 | 78 |
| 79 } // namespace content | 79 } // namespace content |
| OLD | NEW |