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

Side by Side Diff: chrome/common/indexed_db_messages.h

Issue 6410007: Make the implementation .cc files go away, instead have the authors give us a... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_COMMON_INDEXED_DB_MESSAGES_H_ 5 #ifndef CHROME_COMMON_INDEXED_DB_MESSAGES_H_
6 #define CHROME_COMMON_INDEXED_DB_MESSAGES_H_ 6 #define CHROME_COMMON_INDEXED_DB_MESSAGES_H_
jam 2011/02/10 00:22:19 we don't need the ifdef guard since all the includ
7 #pragma once 7 // Message definition file, included multiple times, hence no #pragma once.
8
9 #include <map>
10 #include <string>
11 #include <vector>
8 12
9 #include "chrome/common/indexed_db_key.h" 13 #include "chrome/common/indexed_db_key.h"
10 #include "chrome/common/indexed_db_param_traits.h" 14 #include "chrome/common/indexed_db_param_traits.h"
11 #include "chrome/common/serialized_script_value.h" 15 #include "chrome/common/serialized_script_value.h"
12 #include "ipc/ipc_message_macros.h" 16 #include "ipc/ipc_message_macros.h"
13 #include "ipc/ipc_param_traits.h" 17 #include "ipc/ipc_param_traits.h"
14 #include "third_party/WebKit/Source/WebKit/chromium/public/WebExceptionCode.h" 18 #include "third_party/WebKit/Source/WebKit/chromium/public/WebExceptionCode.h"
15 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBObjectStore.h" 19 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBObjectStore.h"
16 20
21 #endif // CHROME_COMMON_INDEXED_DB_MESSAGES_H_
22
23 // IPC message macro invocations in this unguarded section.
24
17 #define IPC_MESSAGE_START IndexedDBMsgStart 25 #define IPC_MESSAGE_START IndexedDBMsgStart
18 26
27 // Argument structures used in messages
28
29 IPC_ENUM_TRAITS(WebKit::WebIDBObjectStore::PutMode)
30
19 // Used to open an indexed database. 31 // Used to open an indexed database.
20 struct IndexedDBHostMsg_FactoryOpen_Params { 32 IPC_STRUCT_BEGIN(IndexedDBHostMsg_FactoryOpen_Params)
21 IndexedDBHostMsg_FactoryOpen_Params();
22 ~IndexedDBHostMsg_FactoryOpen_Params();
23
24 // The routing ID of the view initiating the open. 33 // The routing ID of the view initiating the open.
25 int32 routing_id; 34 IPC_STRUCT_MEMBER(int32, routing_id)
26
27 // The response should have this id. 35 // The response should have this id.
28 int32 response_id; 36 IPC_STRUCT_MEMBER(int32, response_id)
29
30 // The origin doing the initiating. 37 // The origin doing the initiating.
31 string16 origin; 38 IPC_STRUCT_MEMBER(string16, origin)
32
33 // The name of the database. 39 // The name of the database.
34 string16 name; 40 IPC_STRUCT_MEMBER(string16, name)
35
36 // The maximum size of the database. 41 // The maximum size of the database.
37 uint64 maximum_size; 42 IPC_STRUCT_MEMBER(uint64, maximum_size)
38 }; 43 IPC_STRUCT_END()
39 44
40 // Used to create an object store. 45 // Used to create an object store.
41 struct IndexedDBHostMsg_DatabaseCreateObjectStore_Params { 46 IPC_STRUCT_BEGIN(IndexedDBHostMsg_DatabaseCreateObjectStore_Params)
42 IndexedDBHostMsg_DatabaseCreateObjectStore_Params();
43 ~IndexedDBHostMsg_DatabaseCreateObjectStore_Params();
44
45 // The name of the object store. 47 // The name of the object store.
46 string16 name; 48 IPC_STRUCT_MEMBER(string16, name)
47
48 // The keyPath of the object store. 49 // The keyPath of the object store.
49 NullableString16 key_path; 50 IPC_STRUCT_MEMBER(NullableString16, key_path)
50
51 // Whether the object store created should have a key generator. 51 // Whether the object store created should have a key generator.
52 bool auto_increment; 52 IPC_STRUCT_MEMBER(bool, auto_increment)
53
54 // The transaction this is associated with. 53 // The transaction this is associated with.
55 int32 transaction_id; 54 IPC_STRUCT_MEMBER(int32, transaction_id)
56
57 // The database the object store belongs to. 55 // The database the object store belongs to.
58 int32 idb_database_id; 56 IPC_STRUCT_MEMBER(int32, idb_database_id)
59 }; 57 IPC_STRUCT_END()
60 58
61 // Used to open both cursors and object cursors in IndexedDB. 59 // Used to open both cursors and object cursors in IndexedDB.
62 struct IndexedDBHostMsg_IndexOpenCursor_Params { 60 IPC_STRUCT_BEGIN(IndexedDBHostMsg_IndexOpenCursor_Params)
63 IndexedDBHostMsg_IndexOpenCursor_Params();
64 ~IndexedDBHostMsg_IndexOpenCursor_Params();
65
66 // The response should have this id. 61 // The response should have this id.
67 int32 response_id; 62 IPC_STRUCT_MEMBER(int32, response_id)
68
69 // The serialized lower key. 63 // The serialized lower key.
70 IndexedDBKey lower_key; 64 IPC_STRUCT_MEMBER(IndexedDBKey, lower_key)
71
72 // The serialized upper key. 65 // The serialized upper key.
73 IndexedDBKey upper_key; 66 IPC_STRUCT_MEMBER(IndexedDBKey, upper_key)
74
75 // Is the lower bound open? 67 // Is the lower bound open?
76 bool lower_open; 68 IPC_STRUCT_MEMBER(bool, lower_open)
77
78 // Is the upper bound open? 69 // Is the upper bound open?
79 bool upper_open; 70 IPC_STRUCT_MEMBER(bool, upper_open)
80
81 // The direction of this cursor. 71 // The direction of this cursor.
82 int32 direction; 72 IPC_STRUCT_MEMBER(int32, direction)
83
84 // The index the index belongs to. 73 // The index the index belongs to.
85 int32 idb_index_id; 74 IPC_STRUCT_MEMBER(int32, idb_index_id)
86
87 // The transaction this request belongs to. 75 // The transaction this request belongs to.
88 int transaction_id; 76 IPC_STRUCT_MEMBER(int, transaction_id)
89 }; 77 IPC_STRUCT_END()
90 78
91 // Used to set a value in an object store. 79 // Used to set a value in an object store.
92 struct IndexedDBHostMsg_ObjectStorePut_Params { 80 IPC_STRUCT_BEGIN(IndexedDBHostMsg_ObjectStorePut_Params)
93 IndexedDBHostMsg_ObjectStorePut_Params();
94 ~IndexedDBHostMsg_ObjectStorePut_Params();
95
96 // The object store's id. 81 // The object store's id.
97 int32 idb_object_store_id; 82 IPC_STRUCT_MEMBER(int32, idb_object_store_id)
98
99 // The id any response should contain. 83 // The id any response should contain.
100 int32 response_id; 84 IPC_STRUCT_MEMBER(int32, response_id)
101
102 // The value to set. 85 // The value to set.
103 SerializedScriptValue serialized_value; 86 IPC_STRUCT_MEMBER(SerializedScriptValue, serialized_value)
104
105 // The key to set it on (may not be "valid"/set in some cases). 87 // The key to set it on (may not be "valid"/set in some cases).
106 IndexedDBKey key; 88 IPC_STRUCT_MEMBER(IndexedDBKey, key)
107
108 // Whether this is an add or a put. 89 // Whether this is an add or a put.
109 WebKit::WebIDBObjectStore::PutMode put_mode; 90 IPC_STRUCT_MEMBER(WebKit::WebIDBObjectStore::PutMode, put_mode)
110
111 // The transaction it's associated with. 91 // The transaction it's associated with.
112 int transaction_id; 92 IPC_STRUCT_MEMBER(int, transaction_id)
113 }; 93 IPC_STRUCT_END()
114 94
115 // Used to create an index. 95 // Used to create an index.
116 struct IndexedDBHostMsg_ObjectStoreCreateIndex_Params { 96 IPC_STRUCT_BEGIN(IndexedDBHostMsg_ObjectStoreCreateIndex_Params)
117 IndexedDBHostMsg_ObjectStoreCreateIndex_Params();
118 ~IndexedDBHostMsg_ObjectStoreCreateIndex_Params();
119
120 // The name of the index. 97 // The name of the index.
121 string16 name; 98 IPC_STRUCT_MEMBER(string16, name)
122
123 // The keyPath of the index. 99 // The keyPath of the index.
124 NullableString16 key_path; 100 IPC_STRUCT_MEMBER(NullableString16, key_path)
125
126 // Whether the index created has unique keys. 101 // Whether the index created has unique keys.
127 bool unique; 102 IPC_STRUCT_MEMBER(bool, unique)
128
129 // The transaction this is associated with. 103 // The transaction this is associated with.
130 int32 transaction_id; 104 IPC_STRUCT_MEMBER(int32, transaction_id)
131
132 // The object store the index belongs to. 105 // The object store the index belongs to.
133 int32 idb_object_store_id; 106 IPC_STRUCT_MEMBER(int32, idb_object_store_id)
134 }; 107 IPC_STRUCT_END()
135 108
136 // Used to open an IndexedDB cursor. 109 // Used to open an IndexedDB cursor.
137 struct IndexedDBHostMsg_ObjectStoreOpenCursor_Params { 110 IPC_STRUCT_BEGIN(IndexedDBHostMsg_ObjectStoreOpenCursor_Params)
138 IndexedDBHostMsg_ObjectStoreOpenCursor_Params();
139 ~IndexedDBHostMsg_ObjectStoreOpenCursor_Params();
140
141 // The response should have this id. 111 // The response should have this id.
142 int32 response_id; 112 IPC_STRUCT_MEMBER(int32, response_id)
143
144 // The serialized lower key. 113 // The serialized lower key.
145 IndexedDBKey lower_key; 114 IPC_STRUCT_MEMBER(IndexedDBKey, lower_key)
146
147 // The serialized upper key. 115 // The serialized upper key.
148 IndexedDBKey upper_key; 116 IPC_STRUCT_MEMBER(IndexedDBKey, upper_key)
149
150 // Is the lower bound open? 117 // Is the lower bound open?
151 bool lower_open; 118 IPC_STRUCT_MEMBER(bool, lower_open)
152
153 // Is the upper bound open? 119 // Is the upper bound open?
154 bool upper_open; 120 IPC_STRUCT_MEMBER(bool, upper_open)
155
156 // The direction of this cursor. 121 // The direction of this cursor.
157 int32 direction; 122 IPC_STRUCT_MEMBER(int32, direction)
158
159 // The object store the cursor belongs to. 123 // The object store the cursor belongs to.
160 int32 idb_object_store_id; 124 IPC_STRUCT_MEMBER(int32, idb_object_store_id)
161
162 // The transaction this request belongs to. 125 // The transaction this request belongs to.
163 int transaction_id; 126 IPC_STRUCT_MEMBER(int, transaction_id)
164 }; 127 IPC_STRUCT_END()
165
166 namespace IPC {
167 template <>
168 struct ParamTraits<IndexedDBHostMsg_FactoryOpen_Params> {
169 typedef IndexedDBHostMsg_FactoryOpen_Params param_type;
170 static void Write(Message* m, const param_type& p);
171 static bool Read(const Message* m, void** iter, param_type* p);
172 static void Log(const param_type& p, std::string* l);
173 };
174
175 template <>
176 struct ParamTraits<IndexedDBHostMsg_DatabaseCreateObjectStore_Params> {
177 typedef IndexedDBHostMsg_DatabaseCreateObjectStore_Params param_type;
178 static void Write(Message* m, const param_type& p);
179 static bool Read(const Message* m, void** iter, param_type* p);
180 static void Log(const param_type& p, std::string* l);
181 };
182
183 template <>
184 struct ParamTraits<IndexedDBHostMsg_IndexOpenCursor_Params> {
185 typedef IndexedDBHostMsg_IndexOpenCursor_Params param_type;
186 static void Write(Message* m, const param_type& p);
187 static bool Read(const Message* m, void** iter, param_type* p);
188 static void Log(const param_type& p, std::string* l);
189 };
190
191 template <>
192 struct ParamTraits<IndexedDBHostMsg_ObjectStorePut_Params> {
193 typedef IndexedDBHostMsg_ObjectStorePut_Params param_type;
194 static void Write(Message* m, const param_type& p);
195 static bool Read(const Message* m, void** iter, param_type* p);
196 static void Log(const param_type& p, std::string* l);
197 };
198
199 template <>
200 struct ParamTraits<IndexedDBHostMsg_ObjectStoreCreateIndex_Params> {
201 typedef IndexedDBHostMsg_ObjectStoreCreateIndex_Params param_type;
202 static void Write(Message* m, const param_type& p);
203 static bool Read(const Message* m, void** iter, param_type* p);
204 static void Log(const param_type& p, std::string* l);
205 };
206
207 template <>
208 struct ParamTraits<IndexedDBHostMsg_ObjectStoreOpenCursor_Params> {
209 typedef IndexedDBHostMsg_ObjectStoreOpenCursor_Params param_type;
210 static void Write(Message* m, const param_type& p);
211 static bool Read(const Message* m, void** iter, param_type* p);
212 static void Log(const param_type& p, std::string* l);
213 };
214
215 template <>
216 struct ParamTraits<WebKit::WebIDBObjectStore::PutMode> {
217 typedef WebKit::WebIDBObjectStore::PutMode param_type;
218 static void Write(Message* m, const param_type& p);
219 static bool Read(const Message* m, void** iter, param_type* p);
220 static void Log(const param_type& p, std::string* l);
221 };
222
223 } // namespace IPC
224 128
225 // Indexed DB messages sent from the browser to the renderer. 129 // Indexed DB messages sent from the browser to the renderer.
226 130
227 // IDBCallback message handlers. 131 // IDBCallback message handlers.
228 IPC_MESSAGE_CONTROL2(IndexedDBMsg_CallbacksSuccessIDBCursor, 132 IPC_MESSAGE_CONTROL2(IndexedDBMsg_CallbacksSuccessIDBCursor,
229 int32 /* response_id */, 133 int32 /* response_id */,
230 int32 /* cursor_id */) 134 int32 /* cursor_id */)
231 IPC_MESSAGE_CONTROL2(IndexedDBMsg_CallbacksSuccessIDBDatabase, 135 IPC_MESSAGE_CONTROL2(IndexedDBMsg_CallbacksSuccessIDBDatabase,
232 int32 /* response_id */, 136 int32 /* response_id */,
233 int32 /* idb_database_id */) 137 int32 /* idb_database_id */)
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
494 int32 /* idb_transaction_id */) 398 int32 /* idb_transaction_id */)
495 399
496 // IDBTransaction::DidCompleteTaskEvents() message. 400 // IDBTransaction::DidCompleteTaskEvents() message.
497 IPC_MESSAGE_CONTROL1(IndexedDBHostMsg_TransactionDidCompleteTaskEvents, 401 IPC_MESSAGE_CONTROL1(IndexedDBHostMsg_TransactionDidCompleteTaskEvents,
498 int32 /* idb_transaction_id */) 402 int32 /* idb_transaction_id */)
499 403
500 // WebIDBTransaction::~WebIDBTransaction() message. 404 // WebIDBTransaction::~WebIDBTransaction() message.
501 IPC_MESSAGE_CONTROL1(IndexedDBHostMsg_TransactionDestroyed, 405 IPC_MESSAGE_CONTROL1(IndexedDBHostMsg_TransactionDestroyed,
502 int32 /* idb_transaction_id */) 406 int32 /* idb_transaction_id */)
503 407
504 #endif // CHROME_COMMON_INDEXED_DB_MESSAGES_H_ 408 #undef IPC_MESSAGE_START
jam 2011/02/10 00:22:19 this isn't be needed right?
409
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698