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

Unified Diff: content/common/indexed_db/indexed_db_dispatcher.cc

Issue 12217049: Proxy WebData-based WebIDBDatabase::put (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Update to use explicit &front() Created 7 years, 10 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
Index: content/common/indexed_db/indexed_db_dispatcher.cc
diff --git a/content/common/indexed_db/indexed_db_dispatcher.cc b/content/common/indexed_db/indexed_db_dispatcher.cc
index 67c85b881ee3317d3adb1dce87ceeff942a635fa..d3231e71ef7b5377ae26523c06fa407822d37a3c 100644
--- a/content/common/indexed_db/indexed_db_dispatcher.cc
+++ b/content/common/indexed_db/indexed_db_dispatcher.cc
@@ -18,6 +18,7 @@
#include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBKeyRange.h"
using WebKit::WebDOMStringList;
+using WebKit::WebData;
using WebKit::WebExceptionCode;
using WebKit::WebFrame;
using WebKit::WebIDBCallbacks;
@@ -387,7 +388,7 @@ void IndexedDBDispatcher::RequestIDBDatabaseGet(
}
-void IndexedDBDispatcher::RequestIDBDatabasePut(
+void IndexedDBDispatcher::RequestIDBDatabasePutOld(
int32 ipc_database_id,
int64 transaction_id,
int64 object_store_id,
@@ -399,7 +400,7 @@ void IndexedDBDispatcher::RequestIDBDatabasePut(
const WebKit::WebVector<WebKit::WebVector<
WebKit::WebIDBKey> >& index_keys) {
ResetCursorPrefetchCaches();
- IndexedDBHostMsg_DatabasePut_Params params;
+ IndexedDBHostMsg_DatabasePutOld_Params params;
init_params(params, callbacks);
params.ipc_database_id = ipc_database_id;
params.transaction_id = transaction_id;
@@ -422,6 +423,43 @@ void IndexedDBDispatcher::RequestIDBDatabasePut(
params.index_keys[i][j] = IndexedDBKey(index_keys[i][j]);
}
}
+ Send(new IndexedDBHostMsg_DatabasePutOld(params));
+}
+
+void IndexedDBDispatcher::RequestIDBDatabasePut(
+ int32 ipc_database_id,
+ int64 transaction_id,
+ int64 object_store_id,
+ const WebData& value,
+ const IndexedDBKey& key,
+ WebIDBDatabase::PutMode put_mode,
+ WebIDBCallbacks* callbacks,
+ const WebVector<long long>& index_ids,
+ const WebVector<WebKit::WebVector<
+ WebIDBKey> >& index_keys) {
+ ResetCursorPrefetchCaches();
+ IndexedDBHostMsg_DatabasePut_Params params;
+ init_params(params, callbacks);
+ params.ipc_database_id = ipc_database_id;
+ params.transaction_id = transaction_id;
+ params.object_store_id = object_store_id;
+
+ params.value.assign(value.data(), value.data() + value.size());
+ params.key = key;
+ params.put_mode = put_mode;
+
+ COMPILE_ASSERT(sizeof(params.index_ids[0]) ==
+ sizeof(index_ids[0]), Cant_copy);
+ params.index_ids.assign(index_ids.data(),
+ index_ids.data() + index_ids.size());
+
+ params.index_keys.resize(index_keys.size());
+ for (size_t i = 0; i < index_keys.size(); ++i) {
+ params.index_keys[i].resize(index_keys[i].size());
+ for (size_t j = 0; j < index_keys[i].size(); ++j) {
+ params.index_keys[i][j] = IndexedDBKey(index_keys[i][j]);
+ }
+ }
Send(new IndexedDBHostMsg_DatabasePut(params));
}
« no previous file with comments | « content/common/indexed_db/indexed_db_dispatcher.h ('k') | content/common/indexed_db/indexed_db_dispatcher_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698