summaryrefslogtreecommitdiffstats
path: root/content/renderer/indexed_db_dispatcher.cc
diff options
context:
space:
mode:
Diffstat (limited to 'content/renderer/indexed_db_dispatcher.cc')
-rw-r--r--content/renderer/indexed_db_dispatcher.cc34
1 files changed, 34 insertions, 0 deletions
diff --git a/content/renderer/indexed_db_dispatcher.cc b/content/renderer/indexed_db_dispatcher.cc
index eb00ac3..3e57137 100644
--- a/content/renderer/indexed_db_dispatcher.cc
+++ b/content/renderer/indexed_db_dispatcher.cc
@@ -20,6 +20,7 @@
#include "third_party/WebKit/Source/WebKit/chromium/public/WebSerializedScriptValue.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebString.h"
+using WebKit::WebDOMStringList;
using WebKit::WebExceptionCode;
using WebKit::WebFrame;
using WebKit::WebIDBCallbacks;
@@ -47,6 +48,8 @@ bool IndexedDBDispatcher::OnMessageReceived(const IPC::Message& msg) {
OnSuccessIndexedDBKey)
IPC_MESSAGE_HANDLER(IndexedDBMsg_CallbacksSuccessIDBTransaction,
OnSuccessIDBTransaction)
+ IPC_MESSAGE_HANDLER(IndexedDBMsg_CallbacksSuccessStringList,
+ OnSuccessStringList)
IPC_MESSAGE_HANDLER(IndexedDBMsg_CallbacksSuccessSerializedScriptValue,
OnSuccessSerializedScriptValue)
IPC_MESSAGE_HANDLER(IndexedDBMsg_CallbacksError, OnError)
@@ -122,6 +125,26 @@ void IndexedDBDispatcher::RequestIDBFactoryOpen(
RenderThread::current()->Send(new IndexedDBHostMsg_FactoryOpen(params));
}
+void IndexedDBDispatcher::RequestIDBFactoryGetDatabaseNames(
+ WebIDBCallbacks* callbacks_ptr,
+ const string16& origin,
+ WebFrame* web_frame) {
+ scoped_ptr<WebIDBCallbacks> callbacks(callbacks_ptr);
+
+ if (!web_frame)
+ return; // We must be shutting down.
+ RenderView* render_view = RenderView::FromWebView(web_frame->view());
+ if (!render_view)
+ return; // We must be shutting down.
+
+ IndexedDBHostMsg_FactoryGetDatabaseNames_Params params;
+ params.routing_id = render_view->routing_id();
+ params.response_id = pending_callbacks_.Add(callbacks.release());
+ params.origin = origin;
+ RenderThread::current()->Send(
+ new IndexedDBHostMsg_FactoryGetDatabaseNames(params));
+}
+
void IndexedDBDispatcher::RequestIDBFactoryDeleteDatabase(
const string16& name,
WebIDBCallbacks* callbacks_ptr,
@@ -384,6 +407,17 @@ void IndexedDBDispatcher::OnSuccessIDBTransaction(int32 response_id,
pending_callbacks_.Remove(response_id);
}
+void IndexedDBDispatcher::OnSuccessStringList(
+ int32 response_id, const std::vector<string16>& value) {
+ WebIDBCallbacks* callbacks = pending_callbacks_.Lookup(response_id);
+ WebDOMStringList string_list;
+ for (std::vector<string16>::const_iterator it = value.begin();
+ it != value.end(); ++it)
+ string_list.append(*it);
+ callbacks->onSuccess(string_list);
+ pending_callbacks_.Remove(response_id);
+}
+
void IndexedDBDispatcher::OnSuccessSerializedScriptValue(
int32 response_id, const SerializedScriptValue& value) {
WebIDBCallbacks* callbacks = pending_callbacks_.Lookup(response_id);