summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorjorlow@chromium.org <jorlow@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-17 11:47:36 +0000
committerjorlow@chromium.org <jorlow@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-17 11:47:36 +0000
commit35e55bffc4738b3dbd68be3f01aa918e56133bc8 (patch)
tree93087319199c4139a6adf49038d15477038809f8 /chrome
parente7fd1980c7fbe92aea58b6d7256770d7be9ac621 (diff)
downloadchromium_src-35e55bffc4738b3dbd68be3f01aa918e56133bc8.zip
chromium_src-35e55bffc4738b3dbd68be3f01aa918e56133bc8.tar.gz
chromium_src-35e55bffc4738b3dbd68be3f01aa918e56133bc8.tar.bz2
The Chromium side of implementing the IndexedDB base path stuff.
This allows Chromium to specify where IndexedDB files are stored. TEST=none BUG=none Review URL: http://codereview.chromium.org/3413010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@59781 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/in_process_webkit/indexed_db_dispatcher_host.cc16
-rw-r--r--chrome/renderer/renderer_webidbfactory_impl.cc3
-rw-r--r--chrome/renderer/renderer_webidbfactory_impl.h3
3 files changed, 19 insertions, 3 deletions
diff --git a/chrome/browser/in_process_webkit/indexed_db_dispatcher_host.cc b/chrome/browser/in_process_webkit/indexed_db_dispatcher_host.cc
index 29bb36e..6ed3f52 100644
--- a/chrome/browser/in_process_webkit/indexed_db_dispatcher_host.cc
+++ b/chrome/browser/in_process_webkit/indexed_db_dispatcher_host.cc
@@ -25,6 +25,7 @@
#include "third_party/WebKit/WebKit/chromium/public/WebIDBTransaction.h"
#include "third_party/WebKit/WebKit/chromium/public/WebSecurityOrigin.h"
#include "third_party/WebKit/WebKit/chromium/public/WebVector.h"
+#include "webkit/glue/webkit_glue.h"
using WebKit::WebDOMStringList;
using WebKit::WebIDBCursor;
@@ -39,6 +40,13 @@ using WebKit::WebSecurityOrigin;
using WebKit::WebSerializedScriptValue;
using WebKit::WebVector;
+namespace {
+
+const FilePath::CharType kIndexedDBStorageDirectory[] =
+ FILE_PATH_LITERAL("IndexedDB");
+
+}
+
IndexedDBDispatcherHost::IndexedDBDispatcherHost(
IPC::Message::Sender* sender, WebKitContext* webkit_context)
: sender_(sender),
@@ -228,11 +236,17 @@ void IndexedDBDispatcherHost::OnIDBFactoryOpen(
// TODO(jorlow): Check the content settings map and use params.routing_id_
// if it's necessary to ask the user for permission.
+ FilePath base_path = webkit_context_->data_path();
+ FilePath indexed_db_path;
+ if (!base_path.empty())
+ indexed_db_path = base_path.Append(kIndexedDBStorageDirectory);
+
DCHECK(ChromeThread::CurrentlyOn(ChromeThread::WEBKIT));
Context()->GetIDBFactory()->open(
params.name_, params.description_,
new IndexedDBCallbacks<WebIDBDatabase>(this, params.response_id_),
- WebSecurityOrigin::createFromDatabaseIdentifier(params.origin_), NULL);
+ WebSecurityOrigin::createFromDatabaseIdentifier(params.origin_), NULL,
+ webkit_glue::FilePathToWebString(indexed_db_path));
}
void IndexedDBDispatcherHost::OnIDBFactoryAbortPendingTransactions(
diff --git a/chrome/renderer/renderer_webidbfactory_impl.cc b/chrome/renderer/renderer_webidbfactory_impl.cc
index f1dd4dd..f06e190 100644
--- a/chrome/renderer/renderer_webidbfactory_impl.cc
+++ b/chrome/renderer/renderer_webidbfactory_impl.cc
@@ -26,7 +26,8 @@ RendererWebIDBFactoryImpl::~RendererWebIDBFactoryImpl() {
void RendererWebIDBFactoryImpl::open(
const WebString& name, const WebString& description,
WebIDBCallbacks* callbacks, const WebSecurityOrigin& origin,
- WebFrame* web_frame) {
+ WebFrame* web_frame, const WebString& dataDir) {
+ // Don't send the dataDir. We know what we want on the Browser side of things.
IndexedDBDispatcher* dispatcher =
RenderThread::current()->indexed_db_dispatcher();
dispatcher->RequestIDBFactoryOpen(
diff --git a/chrome/renderer/renderer_webidbfactory_impl.h b/chrome/renderer/renderer_webidbfactory_impl.h
index e2f2b47..3953249 100644
--- a/chrome/renderer/renderer_webidbfactory_impl.h
+++ b/chrome/renderer/renderer_webidbfactory_impl.h
@@ -27,7 +27,8 @@ class RendererWebIDBFactoryImpl : public WebKit::WebIDBFactory {
virtual void open(
const WebKit::WebString& name, const WebKit::WebString& description,
WebKit::WebIDBCallbacks* callbacks,
- const WebKit::WebSecurityOrigin& origin, WebKit::WebFrame* web_frame);
+ const WebKit::WebSecurityOrigin& origin, WebKit::WebFrame* web_frame,
+ const WebKit::WebString& dataDir);
virtual void abortPendingTransactions(
const WebKit::WebVector<int>& pendingIDs);
};