summaryrefslogtreecommitdiffstats
path: root/chrome/renderer/renderer_webidbobjectstore_impl.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/renderer/renderer_webidbobjectstore_impl.cc')
-rw-r--r--chrome/renderer/renderer_webidbobjectstore_impl.cc33
1 files changed, 32 insertions, 1 deletions
diff --git a/chrome/renderer/renderer_webidbobjectstore_impl.cc b/chrome/renderer/renderer_webidbobjectstore_impl.cc
index 79c0da8..5441dab 100644
--- a/chrome/renderer/renderer_webidbobjectstore_impl.cc
+++ b/chrome/renderer/renderer_webidbobjectstore_impl.cc
@@ -4,17 +4,22 @@
#include "chrome/renderer/renderer_webidbobjectstore_impl.h"
+#include "chrome/common/indexed_db_key.h"
#include "chrome/common/render_messages.h"
+#include "chrome/common/serialized_script_value.h"
#include "chrome/renderer/indexed_db_dispatcher.h"
#include "chrome/renderer/render_thread.h"
#include "chrome/renderer/renderer_webidbindex_impl.h"
#include "third_party/WebKit/WebKit/chromium/public/WebDOMStringList.h"
+#include "third_party/WebKit/WebKit/chromium/public/WebIDBKey.h"
#include "third_party/WebKit/WebKit/chromium/public/WebString.h"
using WebKit::WebDOMStringList;
using WebKit::WebFrame;
using WebKit::WebIDBCallbacks;
using WebKit::WebIDBIndex;
+using WebKit::WebIDBKey;
+using WebKit::WebSerializedScriptValue;
using WebKit::WebString;
RendererWebIDBObjectStoreImpl::RendererWebIDBObjectStoreImpl(
@@ -35,7 +40,7 @@ WebString RendererWebIDBObjectStoreImpl::name() const {
}
WebString RendererWebIDBObjectStoreImpl::keyPath() const {
- string16 result;
+ NullableString16 result;
RenderThread::current()->Send(
new ViewHostMsg_IDBObjectStoreKeyPath(idb_object_store_id_, &result));
return result;
@@ -53,6 +58,32 @@ WebDOMStringList RendererWebIDBObjectStoreImpl::indexNames() const {
return web_result;
}
+void RendererWebIDBObjectStoreImpl::get(const WebIDBKey& key,
+ WebIDBCallbacks* callbacks) {
+ IndexedDBDispatcher* dispatcher =
+ RenderThread::current()->indexed_db_dispatcher();
+ dispatcher->RequestIDBObjectStoreGet(IndexedDBKey(key),
+ callbacks, idb_object_store_id_);
+}
+
+void RendererWebIDBObjectStoreImpl::put(
+ const WebSerializedScriptValue& value, const WebIDBKey& key, bool add_only,
+ WebIDBCallbacks* callbacks) {
+ IndexedDBDispatcher* dispatcher =
+ RenderThread::current()->indexed_db_dispatcher();
+ dispatcher->RequestIDBObjectStorePut(
+ SerializedScriptValue(value), IndexedDBKey(key), add_only, callbacks,
+ idb_object_store_id_);
+}
+
+void RendererWebIDBObjectStoreImpl::remove(const WebIDBKey& key,
+ WebIDBCallbacks* callbacks) {
+ IndexedDBDispatcher* dispatcher =
+ RenderThread::current()->indexed_db_dispatcher();
+ dispatcher->RequestIDBObjectStoreRemove(IndexedDBKey(key), callbacks,
+ idb_object_store_id_);
+}
+
void RendererWebIDBObjectStoreImpl::createIndex(
const WebString& name, const WebString& key_path, bool unique,
WebIDBCallbacks* callbacks) {