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" |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 } | 52 } |
53 | 53 |
54 WebString WebStorageAreaImpl::key(unsigned index) { | 54 WebString WebStorageAreaImpl::key(unsigned index) { |
55 return cached_area_->GetKey(connection_id_, index); | 55 return cached_area_->GetKey(connection_id_, index); |
56 } | 56 } |
57 | 57 |
58 WebString WebStorageAreaImpl::getItem(const WebString& key) { | 58 WebString WebStorageAreaImpl::getItem(const WebString& key) { |
59 return cached_area_->GetItem(connection_id_, key); | 59 return cached_area_->GetItem(connection_id_, key); |
60 } | 60 } |
61 | 61 |
| 62 bool WebStorageAreaImpl::containsItem(const WebString& key) { |
| 63 return cached_area_->ContainsItem(connection_id_, key); |
| 64 } |
| 65 |
62 void WebStorageAreaImpl::setItem( | 66 void WebStorageAreaImpl::setItem( |
63 const WebString& key, const WebString& value, const WebURL& page_url, | 67 const WebString& key, const WebString& value, const WebURL& page_url, |
64 WebStorageArea::Result& result) { | 68 WebStorageArea::Result& result) { |
65 if (!cached_area_->SetItem(connection_id_, key, value, page_url)) | 69 if (!cached_area_->SetItem(connection_id_, key, value, page_url)) |
66 result = ResultBlockedByQuota; | 70 result = ResultBlockedByQuota; |
67 else | 71 else |
68 result = ResultOK; | 72 result = ResultOK; |
69 } | 73 } |
70 | 74 |
71 void WebStorageAreaImpl::removeItem( | 75 void WebStorageAreaImpl::removeItem( |
72 const WebString& key, const WebURL& page_url) { | 76 const WebString& key, const WebURL& page_url) { |
73 cached_area_->RemoveItem(connection_id_, key, page_url); | 77 cached_area_->RemoveItem(connection_id_, key, page_url); |
74 } | 78 } |
75 | 79 |
76 void WebStorageAreaImpl::clear(const WebURL& page_url) { | 80 void WebStorageAreaImpl::clear(const WebURL& page_url) { |
77 cached_area_->Clear(connection_id_, page_url); | 81 cached_area_->Clear(connection_id_, page_url); |
78 } | 82 } |
OLD | NEW |