Skip to content

Commit

Permalink
IPC plumbing for IDBObjectStore.autoIncrement
Browse files Browse the repository at this point in the history
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
  • Loading branch information
jsbell@chromium.org committed May 17, 2012
1 parent b3a4502 commit d94b1c8
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -685,6 +685,8 @@ bool IndexedDBDispatcherHost::ObjectStoreDispatcherHost::OnMessageReceived(
IPC_MESSAGE_HANDLER(IndexedDBHostMsg_ObjectStoreName, OnName)
IPC_MESSAGE_HANDLER(IndexedDBHostMsg_ObjectStoreKeyPath, OnKeyPath)
IPC_MESSAGE_HANDLER(IndexedDBHostMsg_ObjectStoreIndexNames, OnIndexNames)
IPC_MESSAGE_HANDLER(IndexedDBHostMsg_ObjectStoreAutoIncrement,
OnAutoIncrement)
IPC_MESSAGE_HANDLER(IndexedDBHostMsg_ObjectStoreGet, OnGet)
IPC_MESSAGE_HANDLER(IndexedDBHostMsg_ObjectStorePut, OnPut)
IPC_MESSAGE_HANDLER(IndexedDBHostMsg_ObjectStoreDelete, OnDelete)
Expand Down Expand Up @@ -735,6 +737,12 @@ void IndexedDBDispatcherHost::ObjectStoreDispatcherHost::OnIndexNames(
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(
int idb_object_store_id,
int32 thread_id,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ class IndexedDBDispatcherHost : public content::BrowserMessageFilter {
content::IndexedDBKeyPath* keyPath);
void OnIndexNames(int32 idb_object_store_id,
std::vector<string16>* index_names);
void OnAutoIncrement(int32 idb_object_store_id, bool* auto_increment);
void OnGet(int idb_object_store_id,
int32 thread_id,
int32 response_id,
Expand Down
5 changes: 5 additions & 0 deletions content/common/indexed_db/indexed_db_messages.h
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,11 @@ IPC_SYNC_MESSAGE_CONTROL1_1(IndexedDBHostMsg_ObjectStoreIndexNames,
int32, /* idb_object_store_id */
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.
IPC_SYNC_MESSAGE_CONTROL5_1(IndexedDBHostMsg_ObjectStoreGet,
int32, /* idb_object_store_id */
Expand Down
8 changes: 8 additions & 0 deletions content/common/indexed_db/proxy_webidbobjectstore_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,14 @@ WebDOMStringList RendererWebIDBObjectStoreImpl::indexNames() const {
return web_result;
}

bool RendererWebIDBObjectStoreImpl::autoIncrement() const {
bool result;
IndexedDBDispatcher::Send(
new IndexedDBHostMsg_ObjectStoreAutoIncrement(
idb_object_store_id_, &result));
return result;
}

void RendererWebIDBObjectStoreImpl::get(
const WebIDBKeyRange& key_range,
WebIDBCallbacks* callbacks,
Expand Down
1 change: 1 addition & 0 deletions content/common/indexed_db/proxy_webidbobjectstore_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ class RendererWebIDBObjectStoreImpl : public WebKit::WebIDBObjectStore {
virtual WebKit::WebString name() const;
virtual WebKit::WebIDBKeyPath keyPath() const;
virtual WebKit::WebDOMStringList indexNames() const;
virtual bool autoIncrement() const;

virtual void get(const WebKit::WebIDBKeyRange& key_range,
WebKit::WebIDBCallbacks* callbacks,
Expand Down

0 comments on commit d94b1c8

Please sign in to comment.