diff options
author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-12-13 21:11:00 +0000 |
---|---|---|
committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-12-13 21:11:00 +0000 |
commit | 2ba871b0a7f13009b6420828af3869d5832efc2d (patch) | |
tree | fc50a741bbdc85640a2df707c0155e7779e6e29e /chrome/common | |
parent | 56879f932544d7752b9a9b5f8e0f3be24d3dcda3 (diff) | |
download | chromium_src-2ba871b0a7f13009b6420828af3869d5832efc2d.zip chromium_src-2ba871b0a7f13009b6420828af3869d5832efc2d.tar.gz chromium_src-2ba871b0a7f13009b6420828af3869d5832efc2d.tar.bz2 |
Make IndexedDBDispatcherHost be a message filter and move its messages into a separate file.
Review URL: http://codereview.chromium.org/5680007
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@69050 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common')
-rw-r--r-- | chrome/common/indexed_db_messages.cc | 339 | ||||
-rw-r--r-- | chrome/common/indexed_db_messages.h | 493 | ||||
-rw-r--r-- | chrome/common/render_messages.cc | 3 | ||||
-rw-r--r-- | chrome/common/render_messages.h | 7 | ||||
-rw-r--r-- | chrome/common/render_messages_internal.h | 274 | ||||
-rw-r--r-- | chrome/common/render_messages_params.cc | 325 | ||||
-rw-r--r-- | chrome/common/render_messages_params.h | 195 |
7 files changed, 832 insertions, 804 deletions
diff --git a/chrome/common/indexed_db_messages.cc b/chrome/common/indexed_db_messages.cc new file mode 100644 index 0000000..c7c0e22 --- /dev/null +++ b/chrome/common/indexed_db_messages.cc @@ -0,0 +1,339 @@ +// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/common/common_param_traits.h" + +#define IPC_MESSAGE_IMPL +#include "chrome/common/indexed_db_messages.h" + +IndexedDBHostMsg_FactoryOpen_Params::IndexedDBHostMsg_FactoryOpen_Params() + : routing_id(0), + response_id(0), + maximum_size(0) { +} + +IndexedDBHostMsg_FactoryOpen_Params::~IndexedDBHostMsg_FactoryOpen_Params() { +} + +IndexedDBHostMsg_DatabaseCreateObjectStore_Params:: + IndexedDBHostMsg_DatabaseCreateObjectStore_Params() + : auto_increment(false), + transaction_id(0), + idb_database_id(0) { +} + +IndexedDBHostMsg_DatabaseCreateObjectStore_Params:: + ~IndexedDBHostMsg_DatabaseCreateObjectStore_Params() { +} + +IndexedDBHostMsg_IndexOpenCursor_Params:: + IndexedDBHostMsg_IndexOpenCursor_Params() + : response_id(0), + lower_open(false), + upper_open(false), + direction(0), + idb_index_id(0), + transaction_id(0) { +} + +IndexedDBHostMsg_IndexOpenCursor_Params:: + ~IndexedDBHostMsg_IndexOpenCursor_Params() { +} + + +IndexedDBHostMsg_ObjectStorePut_Params:: + IndexedDBHostMsg_ObjectStorePut_Params() + : idb_object_store_id(0), + response_id(0), + add_only(false), + transaction_id(0) { +} + +IndexedDBHostMsg_ObjectStorePut_Params:: +~IndexedDBHostMsg_ObjectStorePut_Params() { +} + +IndexedDBHostMsg_ObjectStoreCreateIndex_Params:: + IndexedDBHostMsg_ObjectStoreCreateIndex_Params() + : unique(false), + transaction_id(0), + idb_object_store_id(0) { +} + +IndexedDBHostMsg_ObjectStoreCreateIndex_Params:: + ~IndexedDBHostMsg_ObjectStoreCreateIndex_Params() { +} + + +IndexedDBHostMsg_ObjectStoreOpenCursor_Params:: + IndexedDBHostMsg_ObjectStoreOpenCursor_Params() + : response_id(0), + lower_open(false), + upper_open(false), + direction(0), + idb_object_store_id(0), + transaction_id(0) { +} + +IndexedDBHostMsg_ObjectStoreOpenCursor_Params:: + ~IndexedDBHostMsg_ObjectStoreOpenCursor_Params() { +} + +namespace IPC { + +void ParamTraits<IndexedDBHostMsg_FactoryOpen_Params>::Write( + Message* m, + const param_type& p) { + WriteParam(m, p.routing_id); + WriteParam(m, p.response_id); + WriteParam(m, p.origin); + WriteParam(m, p.name); + WriteParam(m, p.maximum_size); +} + +bool ParamTraits<IndexedDBHostMsg_FactoryOpen_Params>::Read(const Message* m, + void** iter, + param_type* p) { + return + ReadParam(m, iter, &p->routing_id) && + ReadParam(m, iter, &p->response_id) && + ReadParam(m, iter, &p->origin) && + ReadParam(m, iter, &p->name) && + ReadParam(m, iter, &p->maximum_size); +} + +void ParamTraits<IndexedDBHostMsg_FactoryOpen_Params>::Log(const param_type& p, + std::string* l) { + l->append("("); + LogParam(p.routing_id, l); + l->append(", "); + LogParam(p.response_id, l); + l->append(", "); + LogParam(p.origin, l); + l->append(", "); + LogParam(p.name, l); + l->append(", "); + LogParam(p.maximum_size, l); + l->append(")"); +} + +void ParamTraits<IndexedDBHostMsg_DatabaseCreateObjectStore_Params>::Write( + Message* m, + const param_type& p) { + WriteParam(m, p.name); + WriteParam(m, p.key_path); + WriteParam(m, p.auto_increment); + WriteParam(m, p.transaction_id); + WriteParam(m, p.idb_database_id); +} + +bool ParamTraits<IndexedDBHostMsg_DatabaseCreateObjectStore_Params>::Read( + const Message* m, + void** iter, + param_type* p) { + return + ReadParam(m, iter, &p->name) && + ReadParam(m, iter, &p->key_path) && + ReadParam(m, iter, &p->auto_increment) && + ReadParam(m, iter, &p->transaction_id) && + ReadParam(m, iter, &p->idb_database_id); +} + +void ParamTraits<IndexedDBHostMsg_DatabaseCreateObjectStore_Params>::Log( + const param_type& p, + std::string* l) { + l->append("("); + LogParam(p.name, l); + l->append(", "); + LogParam(p.key_path, l); + l->append(", "); + LogParam(p.auto_increment, l); + l->append(", "); + LogParam(p.transaction_id, l); + l->append(", "); + LogParam(p.idb_database_id, l); + l->append(")"); +} + +void ParamTraits<IndexedDBHostMsg_IndexOpenCursor_Params>::Write( + Message* m, + const param_type& p) { + WriteParam(m, p.response_id); + WriteParam(m, p.lower_key); + WriteParam(m, p.upper_key); + WriteParam(m, p.lower_open); + WriteParam(m, p.upper_open); + WriteParam(m, p.direction); + WriteParam(m, p.idb_index_id); + WriteParam(m, p.transaction_id); +} + +bool ParamTraits<IndexedDBHostMsg_IndexOpenCursor_Params>::Read( + const Message* m, + void** iter, + param_type* p) { + return + ReadParam(m, iter, &p->response_id) && + ReadParam(m, iter, &p->lower_key) && + ReadParam(m, iter, &p->upper_key) && + ReadParam(m, iter, &p->lower_open) && + ReadParam(m, iter, &p->upper_open) && + ReadParam(m, iter, &p->direction) && + ReadParam(m, iter, &p->idb_index_id) && + ReadParam(m, iter, &p->transaction_id); +} + +void ParamTraits<IndexedDBHostMsg_IndexOpenCursor_Params>::Log( + const param_type& p, + std::string* l) { + l->append("("); + LogParam(p.response_id, l); + l->append(", "); + LogParam(p.lower_key, l); + l->append(", "); + LogParam(p.upper_key, l); + l->append(", "); + LogParam(p.lower_open, l); + l->append(", "); + LogParam(p.upper_open, l); + l->append(", "); + LogParam(p.direction, l); + l->append(", "); + LogParam(p.idb_index_id, l); + l->append(","); + LogParam(p.transaction_id, l); + l->append(")"); +} + +void ParamTraits<IndexedDBHostMsg_ObjectStorePut_Params>::Write( + Message* m, + const param_type& p) { + WriteParam(m, p.idb_object_store_id); + WriteParam(m, p.response_id); + WriteParam(m, p.serialized_value); + WriteParam(m, p.key); + WriteParam(m, p.add_only); + WriteParam(m, p.transaction_id); +} + +bool ParamTraits<IndexedDBHostMsg_ObjectStorePut_Params>::Read( + const Message* m, + void** iter, + param_type* p) { + return + ReadParam(m, iter, &p->idb_object_store_id) && + ReadParam(m, iter, &p->response_id) && + ReadParam(m, iter, &p->serialized_value) && + ReadParam(m, iter, &p->key) && + ReadParam(m, iter, &p->add_only) && + ReadParam(m, iter, &p->transaction_id); +} + +void ParamTraits<IndexedDBHostMsg_ObjectStorePut_Params>::Log( + const param_type& p, + std::string* l) { + l->append("("); + LogParam(p.idb_object_store_id, l); + l->append(", "); + LogParam(p.response_id, l); + l->append(", "); + LogParam(p.serialized_value, l); + l->append(", "); + LogParam(p.key, l); + l->append(", "); + LogParam(p.add_only, l); + l->append(", "); + LogParam(p.transaction_id, l); + l->append(")"); +} + +void ParamTraits<IndexedDBHostMsg_ObjectStoreCreateIndex_Params>::Write( + Message* m, + const param_type& p) { + WriteParam(m, p.name); + WriteParam(m, p.key_path); + WriteParam(m, p.unique); + WriteParam(m, p.transaction_id); + WriteParam(m, p.idb_object_store_id); +} + +bool ParamTraits<IndexedDBHostMsg_ObjectStoreCreateIndex_Params>::Read( + const Message* m, + void** iter, + param_type* p) { + return + ReadParam(m, iter, &p->name) && + ReadParam(m, iter, &p->key_path) && + ReadParam(m, iter, &p->unique) && + ReadParam(m, iter, &p->transaction_id) && + ReadParam(m, iter, &p->idb_object_store_id); +} + +void ParamTraits<IndexedDBHostMsg_ObjectStoreCreateIndex_Params>::Log( + const param_type& p, + std::string* l) { + l->append("("); + LogParam(p.name, l); + l->append(", "); + LogParam(p.key_path, l); + l->append(", "); + LogParam(p.unique, l); + l->append(", "); + LogParam(p.transaction_id, l); + l->append(", "); + LogParam(p.idb_object_store_id, l); + l->append(")"); +} + +void ParamTraits<IndexedDBHostMsg_ObjectStoreOpenCursor_Params>::Write( + Message* m, + const param_type& p) { + WriteParam(m, p.response_id); + WriteParam(m, p.lower_key); + WriteParam(m, p.upper_key); + WriteParam(m, p.lower_open); + WriteParam(m, p.upper_open); + WriteParam(m, p.direction); + WriteParam(m, p.idb_object_store_id); + WriteParam(m, p.transaction_id); +} + +bool ParamTraits<IndexedDBHostMsg_ObjectStoreOpenCursor_Params>::Read( + const Message* m, + void** iter, + param_type* p) { + return + ReadParam(m, iter, &p->response_id) && + ReadParam(m, iter, &p->lower_key) && + ReadParam(m, iter, &p->upper_key) && + ReadParam(m, iter, &p->lower_open) && + ReadParam(m, iter, &p->upper_open) && + ReadParam(m, iter, &p->direction) && + ReadParam(m, iter, &p->idb_object_store_id) && + ReadParam(m, iter, &p->transaction_id); +} + +void ParamTraits<IndexedDBHostMsg_ObjectStoreOpenCursor_Params>::Log( + const param_type& p, + std::string* l) { + l->append("("); + LogParam(p.response_id, l); + l->append(", "); + LogParam(p.lower_key, l); + l->append(", "); + LogParam(p.upper_key, l); + l->append(", "); + LogParam(p.lower_open, l); + l->append(", "); + LogParam(p.upper_open, l); + l->append(", "); + LogParam(p.direction, l); + l->append(", "); + LogParam(p.idb_object_store_id, l); + l->append(","); + LogParam(p.transaction_id, l); + l->append(")"); +} + +} // namespace IPC diff --git a/chrome/common/indexed_db_messages.h b/chrome/common/indexed_db_messages.h new file mode 100644 index 0000000..8eb77eb --- /dev/null +++ b/chrome/common/indexed_db_messages.h @@ -0,0 +1,493 @@ +// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_COMMON_INDEXED_DB_MESSAGES_H_ +#define CHROME_COMMON_INDEXED_DB_MESSAGES_H_ +#pragma once + +#include "chrome/common/indexed_db_key.h" +#include "chrome/common/indexed_db_param_traits.h" +#include "chrome/common/serialized_script_value.h" +#include "ipc/ipc_message_macros.h" +#include "ipc/ipc_param_traits.h" +#include "third_party/WebKit/WebKit/chromium/public/WebExceptionCode.h" + +#define IPC_MESSAGE_START IndexedDBMsgStart + +// Used to open an indexed database. +struct IndexedDBHostMsg_FactoryOpen_Params { + IndexedDBHostMsg_FactoryOpen_Params(); + ~IndexedDBHostMsg_FactoryOpen_Params(); + + // The routing ID of the view initiating the open. + int32 routing_id; + + // The response should have this id. + int32 response_id; + + // The origin doing the initiating. + string16 origin; + + // The name of the database. + string16 name; + + // The maximum size of the database. + uint64 maximum_size; +}; + +// Used to create an object store. +struct IndexedDBHostMsg_DatabaseCreateObjectStore_Params { + IndexedDBHostMsg_DatabaseCreateObjectStore_Params(); + ~IndexedDBHostMsg_DatabaseCreateObjectStore_Params(); + + // The name of the object store. + string16 name; + + // The keyPath of the object store. + NullableString16 key_path; + + // Whether the object store created should have a key generator. + bool auto_increment; + + // The transaction this is associated with. + int32 transaction_id; + + // The database the object store belongs to. + int32 idb_database_id; +}; + +// Used to open both cursors and object cursors in IndexedDB. +struct IndexedDBHostMsg_IndexOpenCursor_Params { + IndexedDBHostMsg_IndexOpenCursor_Params(); + ~IndexedDBHostMsg_IndexOpenCursor_Params(); + + // The response should have this id. + int32 response_id; + + // The serialized lower key. + IndexedDBKey lower_key; + + // The serialized upper key. + IndexedDBKey upper_key; + + // Is the lower bound open? + bool lower_open; + + // Is the upper bound open? + bool upper_open; + + // The direction of this cursor. + int32 direction; + + // The index the index belongs to. + int32 idb_index_id; + + // The transaction this request belongs to. + int transaction_id; +}; + +// Used to set a value in an object store. +struct IndexedDBHostMsg_ObjectStorePut_Params { + IndexedDBHostMsg_ObjectStorePut_Params(); + ~IndexedDBHostMsg_ObjectStorePut_Params(); + + // The object store's id. + int32 idb_object_store_id; + + // The id any response should contain. + int32 response_id; + + // The value to set. + SerializedScriptValue serialized_value; + + // The key to set it on (may not be "valid"/set in some cases). + IndexedDBKey key; + + // If it already exists, don't update (just return an error). + bool add_only; + + // The transaction it's associated with. + int transaction_id; +}; + +// Used to create an index. +struct IndexedDBHostMsg_ObjectStoreCreateIndex_Params { + IndexedDBHostMsg_ObjectStoreCreateIndex_Params(); + ~IndexedDBHostMsg_ObjectStoreCreateIndex_Params(); + + // The name of the index. + string16 name; + + // The keyPath of the index. + NullableString16 key_path; + + // Whether the index created has unique keys. + bool unique; + + // The transaction this is associated with. + int32 transaction_id; + + // The object store the index belongs to. + int32 idb_object_store_id; +}; + +// Used to open an IndexedDB cursor. +struct IndexedDBHostMsg_ObjectStoreOpenCursor_Params { + IndexedDBHostMsg_ObjectStoreOpenCursor_Params(); + ~IndexedDBHostMsg_ObjectStoreOpenCursor_Params(); + + // The response should have this id. + int32 response_id; + + // The serialized lower key. + IndexedDBKey lower_key; + + // The serialized upper key. + IndexedDBKey upper_key; + + // Is the lower bound open? + bool lower_open; + + // Is the upper bound open? + bool upper_open; + + // The direction of this cursor. + int32 direction; + + // The object store the cursor belongs to. + int32 idb_object_store_id; + + // The transaction this request belongs to. + int transaction_id; +}; + +namespace IPC { +template <> +struct ParamTraits<IndexedDBHostMsg_FactoryOpen_Params> { + typedef IndexedDBHostMsg_FactoryOpen_Params param_type; + static void Write(Message* m, const param_type& p); + static bool Read(const Message* m, void** iter, param_type* p); + static void Log(const param_type& p, std::string* l); +}; + +template <> +struct ParamTraits<IndexedDBHostMsg_DatabaseCreateObjectStore_Params> { + typedef IndexedDBHostMsg_DatabaseCreateObjectStore_Params param_type; + static void Write(Message* m, const param_type& p); + static bool Read(const Message* m, void** iter, param_type* p); + static void Log(const param_type& p, std::string* l); +}; + +template <> +struct ParamTraits<IndexedDBHostMsg_IndexOpenCursor_Params> { + typedef IndexedDBHostMsg_IndexOpenCursor_Params param_type; + static void Write(Message* m, const param_type& p); + static bool Read(const Message* m, void** iter, param_type* p); + static void Log(const param_type& p, std::string* l); +}; + +template <> +struct ParamTraits<IndexedDBHostMsg_ObjectStorePut_Params> { + typedef IndexedDBHostMsg_ObjectStorePut_Params param_type; + static void Write(Message* m, const param_type& p); + static bool Read(const Message* m, void** iter, param_type* p); + static void Log(const param_type& p, std::string* l); +}; + +template <> +struct ParamTraits<IndexedDBHostMsg_ObjectStoreCreateIndex_Params> { + typedef IndexedDBHostMsg_ObjectStoreCreateIndex_Params param_type; + static void Write(Message* m, const param_type& p); + static bool Read(const Message* m, void** iter, param_type* p); + static void Log(const param_type& p, std::string* l); +}; + +template <> +struct ParamTraits<IndexedDBHostMsg_ObjectStoreOpenCursor_Params> { + typedef IndexedDBHostMsg_ObjectStoreOpenCursor_Params param_type; + static void Write(Message* m, const param_type& p); + static bool Read(const Message* m, void** iter, param_type* p); + static void Log(const param_type& p, std::string* l); +}; + +} // namespace IPC + +// Indexed DB messages sent from the browser to the renderer. + +// IDBCallback message handlers. +IPC_MESSAGE_CONTROL1(IndexedDBMsg_CallbacksSuccessNull, + int32 /* response_id */) +IPC_MESSAGE_CONTROL2(IndexedDBMsg_CallbacksSuccessIDBCursor, + int32 /* response_id */, + int32 /* cursor_id */) +IPC_MESSAGE_CONTROL2(IndexedDBMsg_CallbacksSuccessIDBDatabase, + int32 /* response_id */, + int32 /* idb_database_id */) +IPC_MESSAGE_CONTROL2(IndexedDBMsg_CallbacksSuccessIndexedDBKey, + int32 /* response_id */, + IndexedDBKey /* indexed_db_key */) +IPC_MESSAGE_CONTROL2(IndexedDBMsg_CallbacksSuccessIDBIndex, + int32 /* response_id */, + int32 /* idb_index_id */) +IPC_MESSAGE_CONTROL2(IndexedDBMsg_CallbacksSuccessIDBObjectStore, + int32 /* response_id */, + int32 /* idb_object_store_id */) +IPC_MESSAGE_CONTROL2(IndexedDBMsg_CallbacksSuccessIDBTransaction, + int32 /* response_id */, + int32 /* idb_transaction_id */) +IPC_MESSAGE_CONTROL2(IndexedDBMsg_CallbacksSuccessSerializedScriptValue, + int32 /* response_id */, + SerializedScriptValue /* serialized_script_value */) +IPC_MESSAGE_CONTROL3(IndexedDBMsg_CallbacksError, + int32 /* response_id */, + int /* code */, + string16 /* message */) + +// IDBTransactionCallback message handlers. +IPC_MESSAGE_CONTROL1(IndexedDBMsg_TransactionCallbacksAbort, + int32 /* transaction_id */) +IPC_MESSAGE_CONTROL1(IndexedDBMsg_TransactionCallbacksComplete, + int32 /* transaction_id */) +IPC_MESSAGE_CONTROL1(IndexedDBMsg_TransactionCallbacksTimeout, + int32 /* transaction_id */) + + +// Indexed DB messages sent from the renderer to the browser. + +// WebIDBCursor::direction() message. +IPC_SYNC_MESSAGE_CONTROL1_1(IndexedDBHostMsg_CursorDirection, + int32, /* idb_cursor_id */ + int32 /* direction */) + +// WebIDBCursor::key() message. +IPC_SYNC_MESSAGE_CONTROL1_1(IndexedDBHostMsg_CursorKey, + int32, /* idb_cursor_id */ + IndexedDBKey /* key */) + +// WebIDBCursor::value() message. +IPC_SYNC_MESSAGE_CONTROL1_2(IndexedDBHostMsg_CursorValue, + int32, /* idb_cursor_id */ + SerializedScriptValue, /* script_value */ + IndexedDBKey /* key */) + +// WebIDBCursor::update() message. +IPC_SYNC_MESSAGE_CONTROL3_1(IndexedDBHostMsg_CursorUpdate, + int32, /* idb_cursor_id */ + int32, /* response_id */ + SerializedScriptValue, /* value */ + WebKit::WebExceptionCode /* ec */) + +// WebIDBCursor::continue() message. +IPC_SYNC_MESSAGE_CONTROL3_1(IndexedDBHostMsg_CursorContinue, + int32, /* idb_cursor_id */ + int32, /* response_id */ + IndexedDBKey, /* key */ + WebKit::WebExceptionCode /* ec */) + +// WebIDBCursor::remove() message. +IPC_SYNC_MESSAGE_CONTROL2_1(IndexedDBHostMsg_CursorDelete, + int32, /* idb_cursor_id */ + int32, /* response_id */ + WebKit::WebExceptionCode /* ec */) + +// WebIDBFactory::open() message. +IPC_MESSAGE_CONTROL1(IndexedDBHostMsg_FactoryOpen, + IndexedDBHostMsg_FactoryOpen_Params) + +// WebIDBDatabase::name() message. +IPC_SYNC_MESSAGE_CONTROL1_1(IndexedDBHostMsg_DatabaseName, + int32, /* idb_database_id */ + string16 /* name */) + +// WebIDBDatabase::version() message. +IPC_SYNC_MESSAGE_CONTROL1_1(IndexedDBHostMsg_DatabaseVersion, + int32, /* idb_database_id */ + string16 /* version */) + +// WebIDBDatabase::objectStoreNames() message. +IPC_SYNC_MESSAGE_CONTROL1_1(IndexedDBHostMsg_DatabaseObjectStoreNames, + int32, /* idb_database_id */ + std::vector<string16> /* objectStoreNames */) + +// WebIDBDatabase::createObjectStore() message. +IPC_SYNC_MESSAGE_CONTROL1_2(IndexedDBHostMsg_DatabaseCreateObjectStore, + IndexedDBHostMsg_DatabaseCreateObjectStore_Params, + int32, /* object_store_id */ + WebKit::WebExceptionCode /* ec */) + +// WebIDBDatabase::removeObjectStore() message. +IPC_SYNC_MESSAGE_CONTROL3_1(IndexedDBHostMsg_DatabaseDeleteObjectStore, + int32, /* idb_database_id */ + string16, /* name */ + int32, /* transaction_id */ + WebKit::WebExceptionCode /* ec */) + +// WebIDBDatabase::setVersion() message. +IPC_SYNC_MESSAGE_CONTROL3_1(IndexedDBHostMsg_DatabaseSetVersion, + int32, /* idb_database_id */ + int32, /* response_id */ + string16, /* version */ + WebKit::WebExceptionCode /* ec */) + +// WebIDBDatabase::transaction() message. +// TODO: make this message async. Have the renderer create a +// temporary ID and keep a map in the browser process of real +// IDs to temporary IDs. We can then update the transaction +// to its real ID asynchronously. +IPC_SYNC_MESSAGE_CONTROL4_2(IndexedDBHostMsg_DatabaseTransaction, + int32, /* idb_database_id */ + std::vector<string16>, /* object_stores */ + int32, /* mode */ + int32, /* timeout */ + int32, /* idb_transaction_id */ + WebKit::WebExceptionCode /* ec */) + +// WebIDBDatabase::~WebIDBDatabase() message. +IPC_MESSAGE_CONTROL1(IndexedDBHostMsg_DatabaseDestroyed, + int32 /* idb_database_id */) + +// WebIDBIndex::name() message. +IPC_SYNC_MESSAGE_CONTROL1_1(IndexedDBHostMsg_IndexName, + int32, /* idb_index_id */ + string16 /* name */) + +// WebIDBIndex::storeName() message. +IPC_SYNC_MESSAGE_CONTROL1_1(IndexedDBHostMsg_IndexStoreName, + int32, /* idb_index_id */ + string16 /* store_name */) + +// WebIDBIndex::keyPath() message. +IPC_SYNC_MESSAGE_CONTROL1_1(IndexedDBHostMsg_IndexKeyPath, + int32, /* idb_index_id */ + NullableString16 /* key_path */) + +// WebIDBIndex::unique() message. +IPC_SYNC_MESSAGE_CONTROL1_1(IndexedDBHostMsg_IndexUnique, + int32, /* idb_unique_id */ + bool /* unique */) + +// WebIDBIndex::openObjectCursor() message. +IPC_SYNC_MESSAGE_CONTROL1_1(IndexedDBHostMsg_IndexOpenObjectCursor, + IndexedDBHostMsg_IndexOpenCursor_Params, + WebKit::WebExceptionCode /* ec */) + +// WebIDBIndex::openKeyCursor() message. +IPC_SYNC_MESSAGE_CONTROL1_1(IndexedDBHostMsg_IndexOpenKeyCursor, + IndexedDBHostMsg_IndexOpenCursor_Params, + WebKit::WebExceptionCode /* ec */) + +// WebIDBIndex::getObject() message. +IPC_SYNC_MESSAGE_CONTROL4_1(IndexedDBHostMsg_IndexGetObject, + int32, /* idb_index_id */ + int32, /* response_id */ + IndexedDBKey, /* key */ + int32, /* transaction_id */ + WebKit::WebExceptionCode /* ec */) + +// WebIDBIndex::getKey() message. +IPC_SYNC_MESSAGE_CONTROL4_1(IndexedDBHostMsg_IndexGetKey, + int32, /* idb_index_id */ + int32, /* response_id */ + IndexedDBKey, /* key */ + int32, /* transaction_id */ + WebKit::WebExceptionCode /* ec */) + +// WebIDBIndex::~WebIDBIndex() message. +IPC_MESSAGE_CONTROL1(IndexedDBHostMsg_IndexDestroyed, + int32 /* idb_index_id */) + +// WebIDBObjectStore::name() message. +IPC_SYNC_MESSAGE_CONTROL1_1(IndexedDBHostMsg_ObjectStoreName, + int32, /* idb_object_store_id */ + string16 /* name */) + +// WebIDBObjectStore::keyPath() message. +IPC_SYNC_MESSAGE_CONTROL1_1(IndexedDBHostMsg_ObjectStoreKeyPath, + int32, /* idb_object_store_id */ + NullableString16 /* keyPath */) + +// WebIDBObjectStore::indexNames() message. +IPC_SYNC_MESSAGE_CONTROL1_1(IndexedDBHostMsg_ObjectStoreIndexNames, + int32, /* idb_object_store_id */ + std::vector<string16> /* index_names */) + +// WebIDBObjectStore::get() message. +IPC_SYNC_MESSAGE_CONTROL4_1(IndexedDBHostMsg_ObjectStoreGet, + int32, /* idb_object_store_id */ + int32, /* response_id */ + IndexedDBKey, /* key */ + int32, /* transaction_id */ + WebKit::WebExceptionCode /* ec */) + +// WebIDBObjectStore::put() message. +IPC_SYNC_MESSAGE_CONTROL1_1(IndexedDBHostMsg_ObjectStorePut, + IndexedDBHostMsg_ObjectStorePut_Params, + WebKit::WebExceptionCode /* ec */) + +// WebIDBObjectStore::delete() message. +IPC_SYNC_MESSAGE_CONTROL4_1(IndexedDBHostMsg_ObjectStoreDelete, + int32, /* idb_object_store_id */ + int32, /* response_id */ + IndexedDBKey, /* key */ + int32, /* transaction_id */ + WebKit::WebExceptionCode /* ec */) + +// WebIDBObjectStore::createIndex() message. +IPC_SYNC_MESSAGE_CONTROL1_2(IndexedDBHostMsg_ObjectStoreCreateIndex, + IndexedDBHostMsg_ObjectStoreCreateIndex_Params, + int32, /* index_id */ + WebKit::WebExceptionCode /* ec */) + +// WebIDBObjectStore::index() message. +IPC_SYNC_MESSAGE_CONTROL2_2(IndexedDBHostMsg_ObjectStoreIndex, + int32, /* idb_object_store_id */ + string16, /* name */ + int32, /* idb_index_id */ + WebKit::WebExceptionCode /* ec */) + +// WebIDBObjectStore::deleteIndex() message. +IPC_SYNC_MESSAGE_CONTROL3_1(IndexedDBHostMsg_ObjectStoreDeleteIndex, + int32, /* idb_object_store_id */ + string16, /* name */ + int32, /* transaction_id */ + WebKit::WebExceptionCode /* ec */) + +// WebIDBObjectStore::openCursor() message. +IPC_SYNC_MESSAGE_CONTROL1_1(IndexedDBHostMsg_ObjectStoreOpenCursor, + IndexedDBHostMsg_ObjectStoreOpenCursor_Params, + WebKit::WebExceptionCode /* ec */) + +// WebIDBObjectStore::~WebIDBObjectStore() message. +IPC_MESSAGE_CONTROL1(IndexedDBHostMsg_ObjectStoreDestroyed, + int32 /* idb_object_store_id */) + +// WebIDBDatabase::~WebIDBCursor() message. +IPC_MESSAGE_CONTROL1(IndexedDBHostMsg_CursorDestroyed, + int32 /* idb_cursor_id */) + +// IDBTransaction::ObjectStore message. +IPC_SYNC_MESSAGE_CONTROL2_2(IndexedDBHostMsg_TransactionObjectStore, + int32, /* transaction_id */ + string16, /* name */ + int32, /* object_store_id */ + WebKit::WebExceptionCode /* ec */) + +// WebIDBTransaction::mode() message. +IPC_SYNC_MESSAGE_CONTROL1_1(IndexedDBHostMsg_TransactionMode, + int32, /* idb_transaction_id */ + int /* mode */) + +// WebIDBTransaction::abort() message. +IPC_MESSAGE_CONTROL1(IndexedDBHostMsg_TransactionAbort, + int32 /* idb_transaction_id */) + +// IDBTransaction::DidCompleteTaskEvents() message. +IPC_MESSAGE_CONTROL1(IndexedDBHostMsg_TransactionDidCompleteTaskEvents, + int32 /* idb_transaction_id */) + +// WebIDBTransaction::~WebIDBTransaction() message. +IPC_MESSAGE_CONTROL1(IndexedDBHostMsg_TransactionDestroyed, + int32 /* idb_transaction_id */) + +#endif // CHROME_COMMON_INDEXED_DB_MESSAGES_H_ diff --git a/chrome/common/render_messages.cc b/chrome/common/render_messages.cc index 04472bf..ed0fa20 100644 --- a/chrome/common/render_messages.cc +++ b/chrome/common/render_messages.cc @@ -7,11 +7,8 @@ #include "chrome/common/extensions/extension_extent.h" #include "chrome/common/extensions/url_pattern.h" #include "chrome/common/gpu_param_traits.h" -#include "chrome/common/indexed_db_key.h" -#include "chrome/common/indexed_db_param_traits.h" #include "chrome/common/render_messages_params.h" #include "chrome/common/resource_response.h" -#include "chrome/common/serialized_script_value.h" #include "chrome/common/speech_input_result.h" #include "chrome/common/thumbnail_score.h" #include "chrome/common/web_apps.h" diff --git a/chrome/common/render_messages.h b/chrome/common/render_messages.h index b7de06d..e5d0e2a 100644 --- a/chrome/common/render_messages.h +++ b/chrome/common/render_messages.h @@ -17,7 +17,6 @@ #include "base/string16.h" #include "chrome/common/common_param_traits.h" #include "chrome/common/css_colors.h" -#include "chrome/common/indexed_db_param_traits.h" #include "chrome/common/page_transition_types.h" #include "chrome/common/translate_errors.h" #include "chrome/common/view_types.h" @@ -101,12 +100,6 @@ struct ViewHostMsg_DidPrintPage_Params; struct ViewHostMsg_Audio_CreateStream_Params; struct ViewHostMsg_ShowPopup_Params; struct ViewHostMsg_ScriptedPrint_Params; -struct ViewHostMsg_IDBFactoryOpen_Params; -struct ViewHostMsg_IDBDatabaseCreateObjectStore_Params; -struct ViewHostMsg_IDBIndexOpenCursor_Params; -struct ViewHostMsg_IDBObjectStoreCreateIndex_Params; -struct ViewHostMsg_IDBObjectStoreOpenCursor_Params; -struct ViewHostMsg_IDBObjectStorePut_Params; struct ViewMsg_ExecuteCode_Params; struct ViewHostMsg_CreateWorker_Params; struct ViewHostMsg_ShowNotification_Params; diff --git a/chrome/common/render_messages_internal.h b/chrome/common/render_messages_internal.h index c981923..304dcae 100644 --- a/chrome/common/render_messages_internal.h +++ b/chrome/common/render_messages_internal.h @@ -23,7 +23,6 @@ #include "chrome/common/window_container_type.h" #include "ipc/ipc_message_macros.h" #include "media/audio/audio_buffers_state.h" -#include "third_party/WebKit/WebKit/chromium/public/WebExceptionCode.h" #include "third_party/WebKit/WebKit/chromium/public/WebFindOptions.h" #include "third_party/WebKit/WebKit/chromium/public/WebMediaPlayerAction.h" #include "third_party/WebKit/WebKit/chromium/public/WebScreenInfo.h" @@ -51,7 +50,6 @@ typedef std::map<std::string, std::string> SubstitutionMap; class Value; class GPUInfo; -class SerializedScriptValue; class SkBitmap; struct ThumbnailScore; class WebCursor; @@ -902,43 +900,6 @@ IPC_MESSAGE_ROUTED1(ViewMsg_NotifyRenderViewType, IPC_MESSAGE_ROUTED1(ViewMsg_ExecuteCode, ViewMsg_ExecuteCode_Params) -// IDBCallback message handlers. -IPC_MESSAGE_CONTROL1(ViewMsg_IDBCallbacksSuccessNull, - int32 /* response_id */) -IPC_MESSAGE_CONTROL2(ViewMsg_IDBCallbacksSuccessIDBCursor, - int32 /* response_id */, - int32 /* cursor_id */) -IPC_MESSAGE_CONTROL2(ViewMsg_IDBCallbacksSuccessIDBDatabase, - int32 /* response_id */, - int32 /* idb_database_id */) -IPC_MESSAGE_CONTROL2(ViewMsg_IDBCallbacksSuccessIndexedDBKey, - int32 /* response_id */, - IndexedDBKey /* indexed_db_key */) -IPC_MESSAGE_CONTROL2(ViewMsg_IDBCallbacksSuccessIDBIndex, - int32 /* response_id */, - int32 /* idb_index_id */) -IPC_MESSAGE_CONTROL2(ViewMsg_IDBCallbacksSuccessIDBObjectStore, - int32 /* response_id */, - int32 /* idb_object_store_id */) -IPC_MESSAGE_CONTROL2(ViewMsg_IDBCallbacksSuccessIDBTransaction, - int32 /* response_id */, - int32 /* idb_transaction_id */) -IPC_MESSAGE_CONTROL2(ViewMsg_IDBCallbacksSuccessSerializedScriptValue, - int32 /* response_id */, - SerializedScriptValue /* serialized_script_value */) -IPC_MESSAGE_CONTROL3(ViewMsg_IDBCallbacksError, - int32 /* response_id */, - int /* code */, - string16 /* message */) - -// IDBTransactionCallback message handlers. -IPC_MESSAGE_CONTROL1(ViewMsg_IDBTransactionCallbacksAbort, - int32 /* transaction_id */) -IPC_MESSAGE_CONTROL1(ViewMsg_IDBTransactionCallbacksComplete, - int32 /* transaction_id */) -IPC_MESSAGE_CONTROL1(ViewMsg_IDBTransactionCallbacksTimeout, - int32 /* transaction_id */) - #if defined(IPC_MESSAGE_LOG_ENABLED) // Tell the renderer process to begin or end IPC message logging. IPC_MESSAGE_CONTROL1(ViewMsg_SetIPCLoggingEnabled, @@ -2353,241 +2314,6 @@ IPC_MESSAGE_CONTROL3(ViewHostMsg_DidGenerateCacheableMetadata, double /* expected_response_time */, std::vector<char> /* data */) -// WebIDBCursor::direction() message. -IPC_SYNC_MESSAGE_CONTROL1_1(ViewHostMsg_IDBCursorDirection, - int32, /* idb_cursor_id */ - int32 /* direction */) - -// WebIDBCursor::key() message. -IPC_SYNC_MESSAGE_CONTROL1_1(ViewHostMsg_IDBCursorKey, - int32, /* idb_cursor_id */ - IndexedDBKey) - -// WebIDBCursor::value() message. -IPC_SYNC_MESSAGE_CONTROL1_2(ViewHostMsg_IDBCursorValue, - int32, /* idb_cursor_id */ - SerializedScriptValue, /* script_value */ - IndexedDBKey /* key */) - -// WebIDBCursor::update() message. -IPC_SYNC_MESSAGE_CONTROL3_1(ViewHostMsg_IDBCursorUpdate, - int32, /* idb_cursor_id */ - int32, /* response_id */ - SerializedScriptValue, /* value */ - WebKit::WebExceptionCode /* ec */) - -// WebIDBCursor::continue() message. -IPC_SYNC_MESSAGE_CONTROL3_1(ViewHostMsg_IDBCursorContinue, - int32, /* idb_cursor_id */ - int32, /* response_id */ - IndexedDBKey, /* key */ - WebKit::WebExceptionCode /* ec */) - -// WebIDBCursor::remove() message. -IPC_SYNC_MESSAGE_CONTROL2_1(ViewHostMsg_IDBCursorDelete, - int32, /* idb_cursor_id */ - int32, /* response_id */ - WebKit::WebExceptionCode /* ec */) - -// WebIDBFactory::open() message. -IPC_MESSAGE_CONTROL1(ViewHostMsg_IDBFactoryOpen, - ViewHostMsg_IDBFactoryOpen_Params) - -// WebIDBDatabase::name() message. -IPC_SYNC_MESSAGE_CONTROL1_1(ViewHostMsg_IDBDatabaseName, - int32, /* idb_database_id */ - string16 /* name */) - -// WebIDBDatabase::version() message. -IPC_SYNC_MESSAGE_CONTROL1_1(ViewHostMsg_IDBDatabaseVersion, - int32, /* idb_database_id */ - string16 /* vesion */) - -// WebIDBDatabase::objectStoreNames() message. -IPC_SYNC_MESSAGE_CONTROL1_1(ViewHostMsg_IDBDatabaseObjectStoreNames, - int32, /* idb_database_id */ - std::vector<string16> /* objectStoreNames */) - -// WebIDBDatabase::createObjectStore() message. -IPC_SYNC_MESSAGE_CONTROL1_2(ViewHostMsg_IDBDatabaseCreateObjectStore, - ViewHostMsg_IDBDatabaseCreateObjectStore_Params, - int32, /* object_store_id */ - WebKit::WebExceptionCode /* ec */) - -// WebIDBDatabase::removeObjectStore() message. -IPC_SYNC_MESSAGE_CONTROL3_1(ViewHostMsg_IDBDatabaseDeleteObjectStore, - int32, /* idb_database_id */ - string16, /* name */ - int32, /* transaction_id */ - WebKit::WebExceptionCode /* ec */) - -// WebIDBDatabase::setVersion() message. -IPC_SYNC_MESSAGE_CONTROL3_1(ViewHostMsg_IDBDatabaseSetVersion, - int32, /* idb_database_id */ - int32, /* response_id */ - string16, /* version */ - WebKit::WebExceptionCode /* ec */) - -// WebIDBDatabase::transaction() message. -// TODO: make this message async. Have the renderer create a -// temporary ID and keep a map in the browser process of real -// IDs to temporary IDs. We can then update the transaction -// to its real ID asynchronously. -IPC_SYNC_MESSAGE_CONTROL4_2(ViewHostMsg_IDBDatabaseTransaction, - int32, /* idb_database_id */ - std::vector<string16>, /* object_stores */ - int32, /* mode */ - int32, /* timeout */ - int32, /* idb_transaction_id */ - WebKit::WebExceptionCode /* ec */) - -// WebIDBDatabase::~WebIDBDatabase() message. -IPC_MESSAGE_CONTROL1(ViewHostMsg_IDBDatabaseDestroyed, - int32 /* idb_database_id */) - -// WebIDBIndex::name() message. -IPC_SYNC_MESSAGE_CONTROL1_1(ViewHostMsg_IDBIndexName, - int32, /* idb_index_id */ - string16 /* name */) - -// WebIDBIndex::storeName() message. -IPC_SYNC_MESSAGE_CONTROL1_1(ViewHostMsg_IDBIndexStoreName, - int32, /* idb_index_id */ - string16 /* store_name */) - -// WebIDBIndex::keyPath() message. -IPC_SYNC_MESSAGE_CONTROL1_1(ViewHostMsg_IDBIndexKeyPath, - int32, /* idb_index_id */ - NullableString16 /* key_path */) - -// WebIDBIndex::unique() message. -IPC_SYNC_MESSAGE_CONTROL1_1(ViewHostMsg_IDBIndexUnique, - int32, /* idb_unique_id */ - bool /* unique */) - -// WebIDBIndex::openObjectCursor() message. -IPC_SYNC_MESSAGE_CONTROL1_1(ViewHostMsg_IDBIndexOpenObjectCursor, - ViewHostMsg_IDBIndexOpenCursor_Params, - WebKit::WebExceptionCode /* ec */) - -// WebIDBIndex::openKeyCursor() message. -IPC_SYNC_MESSAGE_CONTROL1_1(ViewHostMsg_IDBIndexOpenKeyCursor, - ViewHostMsg_IDBIndexOpenCursor_Params, - WebKit::WebExceptionCode /* ec */) - -// WebIDBIndex::getObject() message. -IPC_SYNC_MESSAGE_CONTROL4_1(ViewHostMsg_IDBIndexGetObject, - int32, /* idb_index_id */ - int32, /* response_id */ - IndexedDBKey, /* key */ - int32, /* transaction_id */ - WebKit::WebExceptionCode /* ec */) - -// WebIDBIndex::getKey() message. -IPC_SYNC_MESSAGE_CONTROL4_1(ViewHostMsg_IDBIndexGetKey, - int32, /* idb_index_id */ - int32, /* response_id */ - IndexedDBKey, /* key */ - int32, /* transaction_id */ - WebKit::WebExceptionCode /* ec */) - -// WebIDBIndex::~WebIDBIndex() message. -IPC_MESSAGE_CONTROL1(ViewHostMsg_IDBIndexDestroyed, - int32 /* idb_index_id */) - -// WebIDBObjectStore::name() message. -IPC_SYNC_MESSAGE_CONTROL1_1(ViewHostMsg_IDBObjectStoreName, - int32, /* idb_object_store_id */ - string16 /* name */) - -// WebIDBObjectStore::keyPath() message. -IPC_SYNC_MESSAGE_CONTROL1_1(ViewHostMsg_IDBObjectStoreKeyPath, - int32, /* idb_object_store_id */ - NullableString16 /* keyPath */) - -// WebIDBObjectStore::indexNames() message. -IPC_SYNC_MESSAGE_CONTROL1_1(ViewHostMsg_IDBObjectStoreIndexNames, - int32, /* idb_object_store_id */ - std::vector<string16> /* index_names */) - -// WebIDBObjectStore::get() message. -IPC_SYNC_MESSAGE_CONTROL4_1(ViewHostMsg_IDBObjectStoreGet, - int32, /* idb_object_store_id */ - int32, /* response_id */ - IndexedDBKey, /* key */ - int32, /* transaction_id */ - WebKit::WebExceptionCode /* ec */) - -// WebIDBObjectStore::put() message. -IPC_SYNC_MESSAGE_CONTROL1_1(ViewHostMsg_IDBObjectStorePut, - ViewHostMsg_IDBObjectStorePut_Params, - WebKit::WebExceptionCode /* ec */) - -// WebIDBObjectStore::delete() message. -IPC_SYNC_MESSAGE_CONTROL4_1(ViewHostMsg_IDBObjectStoreDelete, - int32, /* idb_object_store_id */ - int32, /* response_id */ - IndexedDBKey, /* key */ - int32, /* transaction_id */ - WebKit::WebExceptionCode /* ec */) - -// WebIDBObjectStore::createIndex() message. -IPC_SYNC_MESSAGE_CONTROL1_2(ViewHostMsg_IDBObjectStoreCreateIndex, - ViewHostMsg_IDBObjectStoreCreateIndex_Params, - int32, /* index_id */ - WebKit::WebExceptionCode /* ec */) - -// WebIDBObjectStore::index() message. -IPC_SYNC_MESSAGE_CONTROL2_2(ViewHostMsg_IDBObjectStoreIndex, - int32, /* idb_object_store_id */ - string16, /* name */ - int32, /* idb_index_id */ - WebKit::WebExceptionCode /* ec */) - -// WebIDBObjectStore::deleteIndex() message. -IPC_SYNC_MESSAGE_CONTROL3_1(ViewHostMsg_IDBObjectStoreDeleteIndex, - int32, /* idb_object_store_id */ - string16, /* name */ - int32, /* transaction_id */ - WebKit::WebExceptionCode /* ec */) - -// WebIDBObjectStore::openCursor() message. -IPC_SYNC_MESSAGE_CONTROL1_1(ViewHostMsg_IDBObjectStoreOpenCursor, - ViewHostMsg_IDBObjectStoreOpenCursor_Params, - WebKit::WebExceptionCode /* ec */) - -// WebIDBObjectStore::~WebIDBObjectStore() message. -IPC_MESSAGE_CONTROL1(ViewHostMsg_IDBObjectStoreDestroyed, - int32 /* idb_object_store_id */) - -// WebIDBDatabase::~WebIDBCursor() message. -IPC_MESSAGE_CONTROL1(ViewHostMsg_IDBCursorDestroyed, - int32 /* idb_cursor_id */) - -// IDBTransaction::ObjectStore message. -IPC_SYNC_MESSAGE_CONTROL2_2(ViewHostMsg_IDBTransactionObjectStore, - int32, /* transaction_id */ - string16, /* name */ - int32, /* object_store_id */ - WebKit::WebExceptionCode /* ec */) - -// WebIDBTransaction::mode() message. -IPC_SYNC_MESSAGE_CONTROL1_1(ViewHostMsg_IDBTransactionMode, - int32, /* idb_transaction_id */ - int /* mode */) - -// WebIDBTransaction::abort() message. -IPC_MESSAGE_CONTROL1(ViewHostMsg_IDBTransactionAbort, - int32 /* idb_transaction_id */) - -// IDBTransaction::DidCompleteTaskEvents() message. -IPC_MESSAGE_CONTROL1(ViewHostMsg_IDBTransactionDidCompleteTaskEvents, - int32 /* idb_transaction_id */) - -// WebIDBTransaction::~WebIDBTransaction() message. -IPC_MESSAGE_CONTROL1(ViewHostMsg_IDBTransactionDestroyed, - int32 /* idb_transaction_id */) - // Opens a file asynchronously. The response returns a file descriptor // and an error code from base/platform_file.h. IPC_MESSAGE_ROUTED3(ViewHostMsg_AsyncOpenFile, diff --git a/chrome/common/render_messages_params.cc b/chrome/common/render_messages_params.cc index 01d3d58..618ca8e 100644 --- a/chrome/common/render_messages_params.cc +++ b/chrome/common/render_messages_params.cc @@ -6,7 +6,6 @@ #include "chrome/common/navigation_gesture.h" #include "chrome/common/common_param_traits.h" -#include "chrome/common/indexed_db_param_traits.h" #include "chrome/common/render_messages.h" #include "net/base/upload_data.h" @@ -166,76 +165,6 @@ ViewHostMsg_ScriptedPrint_Params::ViewHostMsg_ScriptedPrint_Params() ViewHostMsg_ScriptedPrint_Params::~ViewHostMsg_ScriptedPrint_Params() { } -ViewHostMsg_IDBFactoryOpen_Params::ViewHostMsg_IDBFactoryOpen_Params() - : routing_id_(0), - response_id_(0), - maximum_size_(0) { -} - -ViewHostMsg_IDBFactoryOpen_Params::~ViewHostMsg_IDBFactoryOpen_Params() { -} - -ViewHostMsg_IDBDatabaseCreateObjectStore_Params:: - ViewHostMsg_IDBDatabaseCreateObjectStore_Params() - : auto_increment_(false), - transaction_id_(0), - idb_database_id_(0) { -} - -ViewHostMsg_IDBDatabaseCreateObjectStore_Params:: - ~ViewHostMsg_IDBDatabaseCreateObjectStore_Params() { -} - -ViewHostMsg_IDBIndexOpenCursor_Params::ViewHostMsg_IDBIndexOpenCursor_Params() - : response_id_(0), - lower_open_(false), - upper_open_(false), - direction_(0), - idb_index_id_(0), - transaction_id_(0) { -} - -ViewHostMsg_IDBIndexOpenCursor_Params:: - ~ViewHostMsg_IDBIndexOpenCursor_Params() { -} - - -ViewHostMsg_IDBObjectStorePut_Params::ViewHostMsg_IDBObjectStorePut_Params() - : idb_object_store_id_(0), - response_id_(0), - add_only_(false), - transaction_id_(0) { -} - -ViewHostMsg_IDBObjectStorePut_Params::~ViewHostMsg_IDBObjectStorePut_Params() { -} - -ViewHostMsg_IDBObjectStoreCreateIndex_Params:: -ViewHostMsg_IDBObjectStoreCreateIndex_Params() - : unique_(false), - transaction_id_(0), - idb_object_store_id_(0) { -} - -ViewHostMsg_IDBObjectStoreCreateIndex_Params:: -~ViewHostMsg_IDBObjectStoreCreateIndex_Params() { -} - - -ViewHostMsg_IDBObjectStoreOpenCursor_Params:: - ViewHostMsg_IDBObjectStoreOpenCursor_Params() - : response_id_(0), - lower_open_(false), - upper_open_(false), - direction_(0), - idb_object_store_id_(0), - transaction_id_(0) { -} - -ViewHostMsg_IDBObjectStoreOpenCursor_Params:: - ~ViewHostMsg_IDBObjectStoreOpenCursor_Params() { -} - ViewMsg_ExecuteCode_Params::ViewMsg_ExecuteCode_Params() { } @@ -1211,260 +1140,6 @@ void ParamTraits<ViewHostMsg_ScriptedPrint_Params>::Log(const param_type& p, l->append(")"); } -void ParamTraits<ViewHostMsg_IDBFactoryOpen_Params>::Write( - Message* m, - const param_type& p) { - WriteParam(m, p.routing_id_); - WriteParam(m, p.response_id_); - WriteParam(m, p.origin_); - WriteParam(m, p.name_); - WriteParam(m, p.maximum_size_); -} - -bool ParamTraits<ViewHostMsg_IDBFactoryOpen_Params>::Read(const Message* m, - void** iter, - param_type* p) { - return - ReadParam(m, iter, &p->routing_id_) && - ReadParam(m, iter, &p->response_id_) && - ReadParam(m, iter, &p->origin_) && - ReadParam(m, iter, &p->name_) && - ReadParam(m, iter, &p->maximum_size_); -} - -void ParamTraits<ViewHostMsg_IDBFactoryOpen_Params>::Log(const param_type& p, - std::string* l) { - l->append("("); - LogParam(p.routing_id_, l); - l->append(", "); - LogParam(p.response_id_, l); - l->append(", "); - LogParam(p.origin_, l); - l->append(", "); - LogParam(p.name_, l); - l->append(", "); - LogParam(p.maximum_size_, l); - l->append(")"); -} - -void ParamTraits<ViewHostMsg_IDBDatabaseCreateObjectStore_Params>::Write( - Message* m, - const param_type& p) { - WriteParam(m, p.name_); - WriteParam(m, p.key_path_); - WriteParam(m, p.auto_increment_); - WriteParam(m, p.transaction_id_); - WriteParam(m, p.idb_database_id_); -} - -bool ParamTraits<ViewHostMsg_IDBDatabaseCreateObjectStore_Params>::Read( - const Message* m, - void** iter, - param_type* p) { - return - ReadParam(m, iter, &p->name_) && - ReadParam(m, iter, &p->key_path_) && - ReadParam(m, iter, &p->auto_increment_) && - ReadParam(m, iter, &p->transaction_id_) && - ReadParam(m, iter, &p->idb_database_id_); -} - -void ParamTraits<ViewHostMsg_IDBDatabaseCreateObjectStore_Params>::Log( - const param_type& p, - std::string* l) { - l->append("("); - LogParam(p.name_, l); - l->append(", "); - LogParam(p.key_path_, l); - l->append(", "); - LogParam(p.auto_increment_, l); - l->append(", "); - LogParam(p.transaction_id_, l); - l->append(", "); - LogParam(p.idb_database_id_, l); - l->append(")"); -} - -void ParamTraits<ViewHostMsg_IDBIndexOpenCursor_Params>::Write( - Message* m, - const param_type& p) { - WriteParam(m, p.response_id_); - WriteParam(m, p.lower_key_); - WriteParam(m, p.upper_key_); - WriteParam(m, p.lower_open_); - WriteParam(m, p.upper_open_); - WriteParam(m, p.direction_); - WriteParam(m, p.idb_index_id_); - WriteParam(m, p.transaction_id_); -} - -bool ParamTraits<ViewHostMsg_IDBIndexOpenCursor_Params>::Read( - const Message* m, - void** iter, - param_type* p) { - return - ReadParam(m, iter, &p->response_id_) && - ReadParam(m, iter, &p->lower_key_) && - ReadParam(m, iter, &p->upper_key_) && - ReadParam(m, iter, &p->lower_open_) && - ReadParam(m, iter, &p->upper_open_) && - ReadParam(m, iter, &p->direction_) && - ReadParam(m, iter, &p->idb_index_id_) && - ReadParam(m, iter, &p->transaction_id_); -} - -void ParamTraits<ViewHostMsg_IDBIndexOpenCursor_Params>::Log( - const param_type& p, - std::string* l) { - l->append("("); - LogParam(p.response_id_, l); - l->append(", "); - LogParam(p.lower_key_, l); - l->append(", "); - LogParam(p.upper_key_, l); - l->append(", "); - LogParam(p.lower_open_, l); - l->append(", "); - LogParam(p.upper_open_, l); - l->append(", "); - LogParam(p.direction_, l); - l->append(", "); - LogParam(p.idb_index_id_, l); - l->append(","); - LogParam(p.transaction_id_, l); - l->append(")"); -} - -void ParamTraits<ViewHostMsg_IDBObjectStorePut_Params>::Write( - Message* m, - const param_type& p) { - WriteParam(m, p.idb_object_store_id_); - WriteParam(m, p.response_id_); - WriteParam(m, p.serialized_value_); - WriteParam(m, p.key_); - WriteParam(m, p.add_only_); - WriteParam(m, p.transaction_id_); -} - -bool ParamTraits<ViewHostMsg_IDBObjectStorePut_Params>::Read( - const Message* m, - void** iter, - param_type* p) { - return - ReadParam(m, iter, &p->idb_object_store_id_) && - ReadParam(m, iter, &p->response_id_) && - ReadParam(m, iter, &p->serialized_value_) && - ReadParam(m, iter, &p->key_) && - ReadParam(m, iter, &p->add_only_) && - ReadParam(m, iter, &p->transaction_id_); -} - -void ParamTraits<ViewHostMsg_IDBObjectStorePut_Params>::Log( - const param_type& p, - std::string* l) { - l->append("("); - LogParam(p.idb_object_store_id_, l); - l->append(", "); - LogParam(p.response_id_, l); - l->append(", "); - LogParam(p.serialized_value_, l); - l->append(", "); - LogParam(p.key_, l); - l->append(", "); - LogParam(p.add_only_, l); - l->append(", "); - LogParam(p.transaction_id_, l); - l->append(")"); -} - -void ParamTraits<ViewHostMsg_IDBObjectStoreCreateIndex_Params>::Write( - Message* m, - const param_type& p) { - WriteParam(m, p.name_); - WriteParam(m, p.key_path_); - WriteParam(m, p.unique_); - WriteParam(m, p.transaction_id_); - WriteParam(m, p.idb_object_store_id_); -} - -bool ParamTraits<ViewHostMsg_IDBObjectStoreCreateIndex_Params>::Read( - const Message* m, - void** iter, - param_type* p) { - return - ReadParam(m, iter, &p->name_) && - ReadParam(m, iter, &p->key_path_) && - ReadParam(m, iter, &p->unique_) && - ReadParam(m, iter, &p->transaction_id_) && - ReadParam(m, iter, &p->idb_object_store_id_); -} - -void ParamTraits<ViewHostMsg_IDBObjectStoreCreateIndex_Params>::Log( - const param_type& p, - std::string* l) { - l->append("("); - LogParam(p.name_, l); - l->append(", "); - LogParam(p.key_path_, l); - l->append(", "); - LogParam(p.unique_, l); - l->append(", "); - LogParam(p.transaction_id_, l); - l->append(", "); - LogParam(p.idb_object_store_id_, l); - l->append(")"); -} - -void ParamTraits<ViewHostMsg_IDBObjectStoreOpenCursor_Params>::Write( - Message* m, - const param_type& p) { - WriteParam(m, p.response_id_); - WriteParam(m, p.lower_key_); - WriteParam(m, p.upper_key_); - WriteParam(m, p.lower_open_); - WriteParam(m, p.upper_open_); - WriteParam(m, p.direction_); - WriteParam(m, p.idb_object_store_id_); - WriteParam(m, p.transaction_id_); -} - -bool ParamTraits<ViewHostMsg_IDBObjectStoreOpenCursor_Params>::Read( - const Message* m, - void** iter, - param_type* p) { - return - ReadParam(m, iter, &p->response_id_) && - ReadParam(m, iter, &p->lower_key_) && - ReadParam(m, iter, &p->upper_key_) && - ReadParam(m, iter, &p->lower_open_) && - ReadParam(m, iter, &p->upper_open_) && - ReadParam(m, iter, &p->direction_) && - ReadParam(m, iter, &p->idb_object_store_id_) && - ReadParam(m, iter, &p->transaction_id_); -} - -void ParamTraits<ViewHostMsg_IDBObjectStoreOpenCursor_Params>::Log( - const param_type& p, - std::string* l) { - l->append("("); - LogParam(p.response_id_, l); - l->append(", "); - LogParam(p.lower_key_, l); - l->append(", "); - LogParam(p.upper_key_, l); - l->append(", "); - LogParam(p.lower_open_, l); - l->append(", "); - LogParam(p.upper_open_, l); - l->append(", "); - LogParam(p.direction_, l); - l->append(", "); - LogParam(p.idb_object_store_id_, l); - l->append(","); - LogParam(p.transaction_id_, l); - l->append(")"); -} - void ParamTraits<ViewMsg_ExecuteCode_Params>::Write(Message* m, const param_type& p) { WriteParam(m, p.request_id); diff --git a/chrome/common/render_messages_params.h b/chrome/common/render_messages_params.h index b522e66..af32a1a 100644 --- a/chrome/common/render_messages_params.h +++ b/chrome/common/render_messages_params.h @@ -19,7 +19,6 @@ #include "chrome/common/extensions/extension.h" #include "chrome/common/extensions/extension_extent.h" #include "chrome/common/extensions/url_pattern.h" -#include "chrome/common/indexed_db_key.h" #include "chrome/common/navigation_gesture.h" #include "chrome/common/navigation_types.h" #include "chrome/common/page_transition_types.h" @@ -634,153 +633,6 @@ struct ViewHostMsg_ScriptedPrint_Params { bool use_overlays; }; -// Used to open an indexed database. -struct ViewHostMsg_IDBFactoryOpen_Params { - ViewHostMsg_IDBFactoryOpen_Params(); - ~ViewHostMsg_IDBFactoryOpen_Params(); - - // The routing ID of the view initiating the open. - int32 routing_id_; - - // The response should have this id. - int32 response_id_; - - // The origin doing the initiating. - string16 origin_; - - // The name of the database. - string16 name_; - - // The maximum size of the database. - uint64 maximum_size_; -}; - -// Used to create an object store. -struct ViewHostMsg_IDBDatabaseCreateObjectStore_Params { - ViewHostMsg_IDBDatabaseCreateObjectStore_Params(); - ~ViewHostMsg_IDBDatabaseCreateObjectStore_Params(); - - // The name of the object store. - string16 name_; - - // The keyPath of the object store. - NullableString16 key_path_; - - // Whether the object store created should have a key generator. - bool auto_increment_; - - // The transaction this is associated with. - int32 transaction_id_; - - // The database the object store belongs to. - int32 idb_database_id_; -}; - -// Used to open both cursors and object cursors in IndexedDB. -struct ViewHostMsg_IDBIndexOpenCursor_Params { - ViewHostMsg_IDBIndexOpenCursor_Params(); - ~ViewHostMsg_IDBIndexOpenCursor_Params(); - - // The response should have this id. - int32 response_id_; - - // The serialized lower key. - IndexedDBKey lower_key_; - - // The serialized upper key. - IndexedDBKey upper_key_; - - // Is the lower bound open? - bool lower_open_; - - // Is the upper bound open? - bool upper_open_; - - // The direction of this cursor. - int32 direction_; - - // The index the index belongs to. - int32 idb_index_id_; - - // The transaction this request belongs to. - int transaction_id_; -}; - -// Used to set a value in an object store. -struct ViewHostMsg_IDBObjectStorePut_Params { - ViewHostMsg_IDBObjectStorePut_Params(); - ~ViewHostMsg_IDBObjectStorePut_Params(); - - // The object store's id. - int32 idb_object_store_id_; - - // The id any response should contain. - int32 response_id_; - - // The value to set. - SerializedScriptValue serialized_value_; - - // The key to set it on (may not be "valid"/set in some cases). - IndexedDBKey key_; - - // If it already exists, don't update (just return an error). - bool add_only_; - - // The transaction it's associated with. - int transaction_id_; -}; - -// Used to create an index. -struct ViewHostMsg_IDBObjectStoreCreateIndex_Params { - ViewHostMsg_IDBObjectStoreCreateIndex_Params(); - ~ViewHostMsg_IDBObjectStoreCreateIndex_Params(); - - // The name of the index. - string16 name_; - - // The keyPath of the index. - NullableString16 key_path_; - - // Whether the index created has unique keys. - bool unique_; - - // The transaction this is associated with. - int32 transaction_id_; - - // The object store the index belongs to. - int32 idb_object_store_id_; -}; - -// Used to open an IndexedDB cursor. -struct ViewHostMsg_IDBObjectStoreOpenCursor_Params { - ViewHostMsg_IDBObjectStoreOpenCursor_Params(); - ~ViewHostMsg_IDBObjectStoreOpenCursor_Params(); - - // The response should have this id. - int32 response_id_; - - // The serialized lower key. - IndexedDBKey lower_key_; - - // The serialized upper key. - IndexedDBKey upper_key_; - - // Is the lower bound open? - bool lower_open_; - - // Is the upper bound open? - bool upper_open_; - - // The direction of this cursor. - int32 direction_; - - // The object store the cursor belongs to. - int32 idb_object_store_id_; - - // The transaction this request belongs to. - int transaction_id_; -}; - // Allows an extension to execute code in a tab. struct ViewMsg_ExecuteCode_Params { ViewMsg_ExecuteCode_Params(); @@ -1166,53 +1018,6 @@ struct ParamTraits<ViewHostMsg_ScriptedPrint_Params> { }; template <> -struct ParamTraits<ViewHostMsg_IDBFactoryOpen_Params> { - typedef ViewHostMsg_IDBFactoryOpen_Params param_type; - static void Write(Message* m, const param_type& p); - static bool Read(const Message* m, void** iter, param_type* p); - static void Log(const param_type& p, std::string* l); -}; - -template <> -struct ParamTraits<ViewHostMsg_IDBDatabaseCreateObjectStore_Params> { - typedef ViewHostMsg_IDBDatabaseCreateObjectStore_Params param_type; - static void Write(Message* m, const param_type& p); - static bool Read(const Message* m, void** iter, param_type* p); - static void Log(const param_type& p, std::string* l); -}; - -template <> -struct ParamTraits<ViewHostMsg_IDBIndexOpenCursor_Params> { - typedef ViewHostMsg_IDBIndexOpenCursor_Params param_type; - static void Write(Message* m, const param_type& p); - static bool Read(const Message* m, void** iter, param_type* p); - static void Log(const param_type& p, std::string* l); -}; - -template <> -struct ParamTraits<ViewHostMsg_IDBObjectStorePut_Params> { - typedef ViewHostMsg_IDBObjectStorePut_Params param_type; - static void Write(Message* m, const param_type& p); - static bool Read(const Message* m, void** iter, param_type* p); - static void Log(const param_type& p, std::string* l); -}; - -template <> -struct ParamTraits<ViewHostMsg_IDBObjectStoreCreateIndex_Params> { - typedef ViewHostMsg_IDBObjectStoreCreateIndex_Params param_type; - static void Write(Message* m, const param_type& p); - static bool Read(const Message* m, void** iter, param_type* p); - static void Log(const param_type& p, std::string* l); -}; - -template <> -struct ParamTraits<ViewHostMsg_IDBObjectStoreOpenCursor_Params> { - typedef ViewHostMsg_IDBObjectStoreOpenCursor_Params param_type; - static void Write(Message* m, const param_type& p); - static bool Read(const Message* m, void** iter, param_type* p); - static void Log(const param_type& p, std::string* l); -}; - template<> struct ParamTraits<ViewMsg_ExecuteCode_Params> { typedef ViewMsg_ExecuteCode_Params param_type; |