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

Unified Diff: content/renderer/indexed_db_dispatcher.cc

Issue 7889024: Implementation of IDBFactory::getDatabaseNames (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Remove unnecessary #includes Created 9 years, 3 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
« no previous file with comments | « content/renderer/indexed_db_dispatcher.h ('k') | content/renderer/renderer_webidbfactory_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/indexed_db_dispatcher.cc
diff --git a/content/renderer/indexed_db_dispatcher.cc b/content/renderer/indexed_db_dispatcher.cc
index eb00ac395dd1db889e8a8510a0ae96eba2ae2319..3e571374bbff55a9946f18c8afad82fa39102e39 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);
« no previous file with comments | « content/renderer/indexed_db_dispatcher.h ('k') | content/renderer/renderer_webidbfactory_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698