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

Unified Diff: chrome/browser/in_process_webkit/dom_storage_dispatcher_host.cc

Issue 159778: Make LocalStorage persistent (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/in_process_webkit/dom_storage_dispatcher_host.cc
===================================================================
--- chrome/browser/in_process_webkit/dom_storage_dispatcher_host.cc (revision 22402)
+++ chrome/browser/in_process_webkit/dom_storage_dispatcher_host.cc (working copy)
@@ -14,9 +14,11 @@
#include "webkit/api/public/WebStorageArea.h"
#include "webkit/api/public/WebStorageNamespace.h"
#include "webkit/api/public/WebString.h"
+#include "webkit/glue/webkit_glue.h"
using WebKit::WebStorageArea;
using WebKit::WebStorageNamespace;
+using WebKit::WebString;
DOMStorageDispatcherHost::DOMStorageDispatcherHost(
IPC::Message::Sender* message_sender,
@@ -281,7 +283,7 @@
DCHECK(ChromeThread::CurrentlyOn(ChromeThread::WEBKIT));
WebStorageArea* storage_area = GetStorageArea(storage_area_id);
CHECK(storage_area); // TODO(jorlow): Do better than this.
- WebKit::WebString value = storage_area->getItem(key);
+ WebString value = storage_area->getItem(key);
ViewHostMsg_DOMStorageGetItem::WriteReplyParams(reply_msg, (string16)value,
value.isNull());
Send(reply_msg);
@@ -375,8 +377,10 @@
return new_namespace_id;
}
-string16 DOMStorageDispatcherHost::GetLocalStoragePath() {
- // TODO(jorlow): Create a path based on the WebKitContext.
- string16 path;
- return path;
+WebString DOMStorageDispatcherHost::GetLocalStoragePath() {
+ const FilePath& path = webkit_context_->data_path();
+ if (path.empty())
+ return WebString();
+ FilePath::StringType path_string = path.AppendASCII("localStorage").value();
+ return webkit_glue::FilePathStringToWebString(path_string);
}

Powered by Google App Engine
This is Rietveld 408576698