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

Unified Diff: content/renderer/dom_storage/webstoragearea_impl.cc

Issue 2600383002: Use explicit WebString <-> string16 conversion methods in storage API files (2) (Closed)
Patch Set: Created 4 years 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 side-by-side diff with in-line comments
Download patch
Index: content/renderer/dom_storage/webstoragearea_impl.cc
diff --git a/content/renderer/dom_storage/webstoragearea_impl.cc b/content/renderer/dom_storage/webstoragearea_impl.cc
index c1db58e31b67000546d2cce1a0d01512767297ca..1cb400c54c694728f1a3576e0f0009f351a917db 100644
--- a/content/renderer/dom_storage/webstoragearea_impl.cc
+++ b/content/renderer/dom_storage/webstoragearea_impl.cc
@@ -51,17 +51,19 @@ unsigned WebStorageAreaImpl::length() {
}
WebString WebStorageAreaImpl::key(unsigned index) {
- return cached_area_->GetKey(connection_id_, index);
+ return WebString::fromUTF16(cached_area_->GetKey(connection_id_, index));
}
WebString WebStorageAreaImpl::getItem(const WebString& key) {
- return cached_area_->GetItem(connection_id_, key);
+ return WebString::fromUTF16(
+ cached_area_->GetItem(connection_id_, key.utf16()));
}
void WebStorageAreaImpl::setItem(
const WebString& key, const WebString& value, const WebURL& page_url,
WebStorageArea::Result& result) {
- if (!cached_area_->SetItem(connection_id_, key, value, page_url))
+ if (!cached_area_->SetItem(connection_id_, key.utf16(), value.utf16(),
+ page_url))
result = ResultBlockedByQuota;
else
result = ResultOK;
@@ -69,7 +71,7 @@ void WebStorageAreaImpl::setItem(
void WebStorageAreaImpl::removeItem(
const WebString& key, const WebURL& page_url) {
- cached_area_->RemoveItem(connection_id_, key, page_url);
+ cached_area_->RemoveItem(connection_id_, key.utf16(), page_url);
}
void WebStorageAreaImpl::clear(const WebURL& page_url) {

Powered by Google App Engine
This is Rietveld 408576698