Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(112)

Side by Side Diff: content/renderer/dom_storage/webstoragearea_impl.cc

Issue 10533093: Implement WebStorageArea::containsItem(key) in chrome and drt/test_shell. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698