diff options
author | jorlow@chromium.org <jorlow@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-17 11:47:36 +0000 |
---|---|---|
committer | jorlow@chromium.org <jorlow@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-17 11:47:36 +0000 |
commit | 35e55bffc4738b3dbd68be3f01aa918e56133bc8 (patch) | |
tree | 93087319199c4139a6adf49038d15477038809f8 /chrome/browser/in_process_webkit | |
parent | e7fd1980c7fbe92aea58b6d7256770d7be9ac621 (diff) | |
download | chromium_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/browser/in_process_webkit')
-rw-r--r-- | chrome/browser/in_process_webkit/indexed_db_dispatcher_host.cc | 16 |
1 files changed, 15 insertions, 1 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( |