Commit d94b1c82 authored by jsbell@chromium.org's avatar jsbell@chromium.org

IPC plumbing for IDBObjectStore.autoIncrement

This enables http://webkit.org/b/86662 to implement the feature - checking the internal autoIncrement flag of an object store.

BUG=128386
TEST=browser_tests --gtest_filter='IndexedDBLayoutTest.BasicTests'



Review URL: https://chromiumcodereview.appspot.com/10332204

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@137731 0039d316-1c4b-4281-b951-d872f2087c98
parent b3a4502c
...@@ -685,6 +685,8 @@ bool IndexedDBDispatcherHost::ObjectStoreDispatcherHost::OnMessageReceived( ...@@ -685,6 +685,8 @@ bool IndexedDBDispatcherHost::ObjectStoreDispatcherHost::OnMessageReceived(
IPC_MESSAGE_HANDLER(IndexedDBHostMsg_ObjectStoreName, OnName) IPC_MESSAGE_HANDLER(IndexedDBHostMsg_ObjectStoreName, OnName)
IPC_MESSAGE_HANDLER(IndexedDBHostMsg_ObjectStoreKeyPath, OnKeyPath) IPC_MESSAGE_HANDLER(IndexedDBHostMsg_ObjectStoreKeyPath, OnKeyPath)
IPC_MESSAGE_HANDLER(IndexedDBHostMsg_ObjectStoreIndexNames, OnIndexNames) IPC_MESSAGE_HANDLER(IndexedDBHostMsg_ObjectStoreIndexNames, OnIndexNames)
IPC_MESSAGE_HANDLER(IndexedDBHostMsg_ObjectStoreAutoIncrement,
OnAutoIncrement)
IPC_MESSAGE_HANDLER(IndexedDBHostMsg_ObjectStoreGet, OnGet) IPC_MESSAGE_HANDLER(IndexedDBHostMsg_ObjectStoreGet, OnGet)
IPC_MESSAGE_HANDLER(IndexedDBHostMsg_ObjectStorePut, OnPut) IPC_MESSAGE_HANDLER(IndexedDBHostMsg_ObjectStorePut, OnPut)
IPC_MESSAGE_HANDLER(IndexedDBHostMsg_ObjectStoreDelete, OnDelete) IPC_MESSAGE_HANDLER(IndexedDBHostMsg_ObjectStoreDelete, OnDelete)
...@@ -735,6 +737,12 @@ void IndexedDBDispatcherHost::ObjectStoreDispatcherHost::OnIndexNames( ...@@ -735,6 +737,12 @@ void IndexedDBDispatcherHost::ObjectStoreDispatcherHost::OnIndexNames(
index_names->push_back(web_index_names.item(i)); index_names->push_back(web_index_names.item(i));
} }
void IndexedDBDispatcherHost::ObjectStoreDispatcherHost::OnAutoIncrement(
int32 idb_object_store_id, bool* auto_increment) {
parent_->SyncGetter<bool>(&map_, idb_object_store_id, auto_increment,
&WebIDBObjectStore::autoIncrement);
}
void IndexedDBDispatcherHost::ObjectStoreDispatcherHost::OnGet( void IndexedDBDispatcherHost::ObjectStoreDispatcherHost::OnGet(
int idb_object_store_id, int idb_object_store_id,
int32 thread_id, int32 thread_id,
......
...@@ -197,6 +197,7 @@ class IndexedDBDispatcherHost : public content::BrowserMessageFilter { ...@@ -197,6 +197,7 @@ class IndexedDBDispatcherHost : public content::BrowserMessageFilter {
content::IndexedDBKeyPath* keyPath); content::IndexedDBKeyPath* keyPath);
void OnIndexNames(int32 idb_object_store_id, void OnIndexNames(int32 idb_object_store_id,
std::vector<string16>* index_names); std::vector<string16>* index_names);
void OnAutoIncrement(int32 idb_object_store_id, bool* auto_increment);
void OnGet(int idb_object_store_id, void OnGet(int idb_object_store_id,
int32 thread_id, int32 thread_id,
int32 response_id, int32 response_id,
......
...@@ -449,6 +449,11 @@ IPC_SYNC_MESSAGE_CONTROL1_1(IndexedDBHostMsg_ObjectStoreIndexNames, ...@@ -449,6 +449,11 @@ IPC_SYNC_MESSAGE_CONTROL1_1(IndexedDBHostMsg_ObjectStoreIndexNames,
int32, /* idb_object_store_id */ int32, /* idb_object_store_id */
std::vector<string16> /* index_names */) std::vector<string16> /* index_names */)
// WebIDBObjectStore::autoIncrement() message.
IPC_SYNC_MESSAGE_CONTROL1_1(IndexedDBHostMsg_ObjectStoreAutoIncrement,
int32, /* idb_object_store_id */
bool /* auto_increment */)
// WebIDBObjectStore::get() message. // WebIDBObjectStore::get() message.
IPC_SYNC_MESSAGE_CONTROL5_1(IndexedDBHostMsg_ObjectStoreGet, IPC_SYNC_MESSAGE_CONTROL5_1(IndexedDBHostMsg_ObjectStoreGet,
int32, /* idb_object_store_id */ int32, /* idb_object_store_id */
......
...@@ -73,6 +73,14 @@ WebDOMStringList RendererWebIDBObjectStoreImpl::indexNames() const { ...@@ -73,6 +73,14 @@ WebDOMStringList RendererWebIDBObjectStoreImpl::indexNames() const {
return web_result; return web_result;
} }
bool RendererWebIDBObjectStoreImpl::autoIncrement() const {
bool result;
IndexedDBDispatcher::Send(
new IndexedDBHostMsg_ObjectStoreAutoIncrement(
idb_object_store_id_, &result));
return result;
}
void RendererWebIDBObjectStoreImpl::get( void RendererWebIDBObjectStoreImpl::get(
const WebIDBKeyRange& key_range, const WebIDBKeyRange& key_range,
WebIDBCallbacks* callbacks, WebIDBCallbacks* callbacks,
......
...@@ -27,6 +27,7 @@ class RendererWebIDBObjectStoreImpl : public WebKit::WebIDBObjectStore { ...@@ -27,6 +27,7 @@ class RendererWebIDBObjectStoreImpl : public WebKit::WebIDBObjectStore {
virtual WebKit::WebString name() const; virtual WebKit::WebString name() const;
virtual WebKit::WebIDBKeyPath keyPath() const; virtual WebKit::WebIDBKeyPath keyPath() const;
virtual WebKit::WebDOMStringList indexNames() const; virtual WebKit::WebDOMStringList indexNames() const;
virtual bool autoIncrement() const;
virtual void get(const WebKit::WebIDBKeyRange& key_range, virtual void get(const WebKit::WebIDBKeyRange& key_range,
WebKit::WebIDBCallbacks* callbacks, WebKit::WebIDBCallbacks* callbacks,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment