OLD | NEW |
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 #include "chrome/browser/in_process_webkit/indexed_db_dispatcher_host.h" | 5 #include "chrome/browser/in_process_webkit/indexed_db_dispatcher_host.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "chrome/browser/chrome_thread.h" | 8 #include "chrome/browser/chrome_thread.h" |
9 #include "chrome/browser/in_process_webkit/indexed_db_callbacks.h" | 9 #include "chrome/browser/in_process_webkit/indexed_db_callbacks.h" |
10 #include "chrome/browser/renderer_host/browser_render_process_host.h" | 10 #include "chrome/browser/renderer_host/browser_render_process_host.h" |
11 #include "chrome/browser/renderer_host/resource_message_filter.h" | 11 #include "chrome/browser/renderer_host/resource_message_filter.h" |
12 #include "chrome/common/chrome_switches.h" | 12 #include "chrome/common/chrome_switches.h" |
13 #include "chrome/common/render_messages.h" | 13 #include "chrome/common/render_messages.h" |
14 #include "third_party/WebKit/WebKit/chromium/public/WebDOMStringList.h" | 14 #include "third_party/WebKit/WebKit/chromium/public/WebDOMStringList.h" |
15 #include "third_party/WebKit/WebKit/chromium/public/WebIDBDatabase.h" | 15 #include "third_party/WebKit/WebKit/chromium/public/WebIDBDatabase.h" |
16 #include "third_party/WebKit/WebKit/chromium/public/WebIDBDatabaseError.h" | 16 #include "third_party/WebKit/WebKit/chromium/public/WebIDBDatabaseError.h" |
17 #include "third_party/WebKit/WebKit/chromium/public/WebIDBIndex.h" | 17 #include "third_party/WebKit/WebKit/chromium/public/WebIDBIndex.h" |
| 18 #include "third_party/WebKit/WebKit/chromium/public/WebIDBObjectStore.h" |
18 #include "third_party/WebKit/WebKit/chromium/public/WebIndexedDatabase.h" | 19 #include "third_party/WebKit/WebKit/chromium/public/WebIndexedDatabase.h" |
19 #include "third_party/WebKit/WebKit/chromium/public/WebSecurityOrigin.h" | 20 #include "third_party/WebKit/WebKit/chromium/public/WebSecurityOrigin.h" |
20 | 21 |
21 using WebKit::WebDOMStringList; | 22 using WebKit::WebDOMStringList; |
22 using WebKit::WebIDBDatabase; | 23 using WebKit::WebIDBDatabase; |
23 using WebKit::WebIDBDatabaseError; | 24 using WebKit::WebIDBDatabaseError; |
24 using WebKit::WebIDBIndex; | 25 using WebKit::WebIDBIndex; |
| 26 using WebKit::WebIDBObjectStore; |
25 using WebKit::WebSecurityOrigin; | 27 using WebKit::WebSecurityOrigin; |
26 | 28 |
27 IndexedDBDispatcherHost::IndexedDBDispatcherHost( | 29 IndexedDBDispatcherHost::IndexedDBDispatcherHost( |
28 IPC::Message::Sender* sender, WebKitContext* webkit_context) | 30 IPC::Message::Sender* sender, WebKitContext* webkit_context) |
29 : sender_(sender), | 31 : sender_(sender), |
30 webkit_context_(webkit_context), | 32 webkit_context_(webkit_context), |
31 ALLOW_THIS_IN_INITIALIZER_LIST(database_dispatcher_host_( | 33 ALLOW_THIS_IN_INITIALIZER_LIST(database_dispatcher_host_( |
32 new DatabaseDispatcherHost(this))), | 34 new DatabaseDispatcherHost(this))), |
33 ALLOW_THIS_IN_INITIALIZER_LIST(index_dispatcher_host_( | 35 ALLOW_THIS_IN_INITIALIZER_LIST(index_dispatcher_host_( |
34 new IndexDispatcherHost(this))), | 36 new IndexDispatcherHost(this))), |
| 37 ALLOW_THIS_IN_INITIALIZER_LIST(object_store_dispatcher_host_( |
| 38 new ObjectStoreDispatcherHost(this))), |
35 process_handle_(0) { | 39 process_handle_(0) { |
36 DCHECK(sender_); | 40 DCHECK(sender_); |
37 DCHECK(webkit_context_.get()); | 41 DCHECK(webkit_context_.get()); |
38 } | 42 } |
39 | 43 |
40 IndexedDBDispatcherHost::~IndexedDBDispatcherHost() { | 44 IndexedDBDispatcherHost::~IndexedDBDispatcherHost() { |
41 } | 45 } |
42 | 46 |
43 void IndexedDBDispatcherHost::Init(int process_id, | 47 void IndexedDBDispatcherHost::Init(int process_id, |
44 base::ProcessHandle process_handle) { | 48 base::ProcessHandle process_handle) { |
(...skipping 26 matching lines...) Expand all Loading... |
71 | 75 |
72 bool IndexedDBDispatcherHost::OnMessageReceived(const IPC::Message& message) { | 76 bool IndexedDBDispatcherHost::OnMessageReceived(const IPC::Message& message) { |
73 DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO)); | 77 DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO)); |
74 DCHECK(process_handle_); | 78 DCHECK(process_handle_); |
75 | 79 |
76 switch (message.type()) { | 80 switch (message.type()) { |
77 case ViewHostMsg_IndexedDatabaseOpen::ID: | 81 case ViewHostMsg_IndexedDatabaseOpen::ID: |
78 case ViewHostMsg_IDBDatabaseName::ID: | 82 case ViewHostMsg_IDBDatabaseName::ID: |
79 case ViewHostMsg_IDBDatabaseDescription::ID: | 83 case ViewHostMsg_IDBDatabaseDescription::ID: |
80 case ViewHostMsg_IDBDatabaseVersion::ID: | 84 case ViewHostMsg_IDBDatabaseVersion::ID: |
| 85 case ViewHostMsg_IDBDatabaseCreateObjectStore::ID: |
81 case ViewHostMsg_IDBDatabaseObjectStores::ID: | 86 case ViewHostMsg_IDBDatabaseObjectStores::ID: |
82 case ViewHostMsg_IDBDatabaseDestroyed::ID: | 87 case ViewHostMsg_IDBDatabaseDestroyed::ID: |
83 case ViewHostMsg_IDBIndexName::ID: | 88 case ViewHostMsg_IDBIndexName::ID: |
84 case ViewHostMsg_IDBIndexKeyPath::ID: | 89 case ViewHostMsg_IDBIndexKeyPath::ID: |
85 case ViewHostMsg_IDBIndexUnique::ID: | 90 case ViewHostMsg_IDBIndexUnique::ID: |
86 case ViewHostMsg_IDBIndexDestroyed::ID: | 91 case ViewHostMsg_IDBIndexDestroyed::ID: |
| 92 case ViewHostMsg_IDBObjectStoreName::ID: |
| 93 case ViewHostMsg_IDBObjectStoreKeyPath::ID: |
| 94 case ViewHostMsg_IDBObjectStoreDestroyed::ID: |
87 break; | 95 break; |
88 default: | 96 default: |
89 return false; | 97 return false; |
90 } | 98 } |
91 | 99 |
92 bool success = ChromeThread::PostTask( | 100 bool success = ChromeThread::PostTask( |
93 ChromeThread::WEBKIT, FROM_HERE, NewRunnableMethod( | 101 ChromeThread::WEBKIT, FROM_HERE, NewRunnableMethod( |
94 this, &IndexedDBDispatcherHost::OnMessageReceivedWebKit, message)); | 102 this, &IndexedDBDispatcherHost::OnMessageReceivedWebKit, message)); |
95 DCHECK(success); | 103 DCHECK(success); |
96 return true; | 104 return true; |
(...skipping 22 matching lines...) Expand all Loading... |
119 } | 127 } |
120 | 128 |
121 void IndexedDBDispatcherHost::OnMessageReceivedWebKit( | 129 void IndexedDBDispatcherHost::OnMessageReceivedWebKit( |
122 const IPC::Message& message) { | 130 const IPC::Message& message) { |
123 DCHECK(ChromeThread::CurrentlyOn(ChromeThread::WEBKIT)); | 131 DCHECK(ChromeThread::CurrentlyOn(ChromeThread::WEBKIT)); |
124 DCHECK(process_handle_); | 132 DCHECK(process_handle_); |
125 | 133 |
126 bool msg_is_ok = true; | 134 bool msg_is_ok = true; |
127 bool handled = | 135 bool handled = |
128 database_dispatcher_host_->OnMessageReceived(message, &msg_is_ok) || | 136 database_dispatcher_host_->OnMessageReceived(message, &msg_is_ok) || |
129 index_dispatcher_host_->OnMessageReceived(message, &msg_is_ok); | 137 index_dispatcher_host_->OnMessageReceived(message, &msg_is_ok) || |
| 138 object_store_dispatcher_host_->OnMessageReceived(message, &msg_is_ok); |
130 | 139 |
131 if (!handled) { | 140 if (!handled) { |
132 IPC_BEGIN_MESSAGE_MAP_EX(IndexedDBDispatcherHost, message, msg_is_ok) | 141 IPC_BEGIN_MESSAGE_MAP_EX(IndexedDBDispatcherHost, message, msg_is_ok) |
133 IPC_MESSAGE_HANDLER(ViewHostMsg_IndexedDatabaseOpen, | 142 IPC_MESSAGE_HANDLER(ViewHostMsg_IndexedDatabaseOpen, |
134 OnIndexedDatabaseOpen) | 143 OnIndexedDatabaseOpen) |
135 IPC_MESSAGE_UNHANDLED(handled = false) | 144 IPC_MESSAGE_UNHANDLED(handled = false) |
136 IPC_END_MESSAGE_MAP() | 145 IPC_END_MESSAGE_MAP() |
137 } | 146 } |
138 | 147 |
139 DCHECK(handled); | 148 DCHECK(handled); |
140 if (!msg_is_ok) { | 149 if (!msg_is_ok) { |
141 BrowserRenderProcessHost::BadMessageTerminateProcess(message.type(), | 150 BrowserRenderProcessHost::BadMessageTerminateProcess(message.type(), |
142 process_handle_); | 151 process_handle_); |
143 } | 152 } |
144 } | 153 } |
145 | 154 |
146 int32 IndexedDBDispatcherHost::AddIDBDatabase(WebIDBDatabase* idb_database) { | 155 int32 IndexedDBDispatcherHost::Add(WebIDBDatabase* idb_database) { |
147 return database_dispatcher_host_->map_.Add(idb_database); | 156 return database_dispatcher_host_->map_.Add(idb_database); |
148 } | 157 } |
149 | 158 |
150 class IndexedDatabaseOpenCallbacks : public IndexedDBCallbacks { | 159 int32 IndexedDBDispatcherHost::Add(WebIDBObjectStore* idb_object_store) { |
151 public: | 160 return object_store_dispatcher_host_->map_.Add(idb_object_store); |
152 IndexedDatabaseOpenCallbacks(IndexedDBDispatcherHost* parent, | 161 } |
153 int32 response_id) | |
154 : IndexedDBCallbacks(parent, response_id) { | |
155 } | |
156 | |
157 virtual void onError(const WebIDBDatabaseError& error) { | |
158 parent()->Send(new ViewMsg_IndexedDatabaseOpenError( | |
159 response_id(), error.code(), error.message())); | |
160 } | |
161 | |
162 virtual void onSuccess(WebIDBDatabase* idb_database) { | |
163 int32 idb_database_id = parent()->AddIDBDatabase(idb_database); | |
164 parent()->Send(new ViewMsg_IndexedDatabaseOpenSuccess(response_id(), | |
165 idb_database_id)); | |
166 } | |
167 }; | |
168 | 162 |
169 void IndexedDBDispatcherHost::OnIndexedDatabaseOpen( | 163 void IndexedDBDispatcherHost::OnIndexedDatabaseOpen( |
170 const ViewHostMsg_IndexedDatabaseOpen_Params& params) { | 164 const ViewHostMsg_IndexedDatabaseOpen_Params& params) { |
171 // TODO(jorlow): Check the content settings map and use params.routing_id_ | 165 // TODO(jorlow): Check the content settings map and use params.routing_id_ |
172 // if it's necessary to ask the user for permission. | 166 // if it's necessary to ask the user for permission. |
173 | 167 |
174 DCHECK(ChromeThread::CurrentlyOn(ChromeThread::WEBKIT)); | 168 DCHECK(ChromeThread::CurrentlyOn(ChromeThread::WEBKIT)); |
175 Context()->GetIndexedDatabase()->open( | 169 Context()->GetIndexedDatabase()->open( |
176 params.name_, params.description_, | 170 params.name_, params.description_, |
177 new IndexedDatabaseOpenCallbacks(this, params.response_id_), | 171 new IndexedDBCallbacks<WebIDBDatabase, |
| 172 ViewMsg_IndexedDatabaseOpenSuccess, |
| 173 ViewMsg_IndexedDatabaseOpenError>( |
| 174 this, params.response_id_), |
178 WebSecurityOrigin::createFromDatabaseIdentifier(params.origin_), NULL); | 175 WebSecurityOrigin::createFromDatabaseIdentifier(params.origin_), NULL); |
179 } | 176 } |
180 | 177 |
181 | 178 |
182 ////////////////////////////////////////////////////////////////////// | 179 ////////////////////////////////////////////////////////////////////// |
183 // Helper templates. | 180 // Helper templates. |
184 // | 181 // |
185 | 182 |
186 template <typename ObjectType> | 183 template <typename ObjectType> |
187 ObjectType* IndexedDBDispatcherHost::GetOrTerminateProcess( | 184 ObjectType* IndexedDBDispatcherHost::GetOrTerminateProcess( |
188 IDMap<ObjectType, IDMapOwnPointer>* map, int32 return_object_id, | 185 IDMap<ObjectType, IDMapOwnPointer>* map, int32 return_object_id, |
189 IPC::Message* reply_msg, uint32 message_type) { | 186 IPC::Message* reply_msg, uint32 message_type) { |
190 DCHECK(ChromeThread::CurrentlyOn(ChromeThread::WEBKIT)); | 187 DCHECK(ChromeThread::CurrentlyOn(ChromeThread::WEBKIT)); |
191 ObjectType* return_object = map->Lookup(return_object_id); | 188 ObjectType* return_object = map->Lookup(return_object_id); |
192 if (!return_object) { | 189 if (!return_object) { |
193 BrowserRenderProcessHost::BadMessageTerminateProcess(message_type, | 190 BrowserRenderProcessHost::BadMessageTerminateProcess(message_type, |
194 process_handle_); | 191 process_handle_); |
195 if (reply_msg) | 192 delete reply_msg; |
196 delete reply_msg; | |
197 } | 193 } |
198 return return_object; | 194 return return_object; |
199 } | 195 } |
200 | 196 |
201 template <typename ReplyType, typename MessageType, | 197 template <typename ReplyType, typename MessageType, |
202 typename MapObjectType, typename Method> | 198 typename MapObjectType, typename Method> |
203 void IndexedDBDispatcherHost::SyncGetter( | 199 void IndexedDBDispatcherHost::SyncGetter( |
204 IDMap<MapObjectType, IDMapOwnPointer>* map, int32 object_id, | 200 IDMap<MapObjectType, IDMapOwnPointer>* map, int32 object_id, |
205 IPC::Message* reply_msg, Method method) { | 201 IPC::Message* reply_msg, Method method) { |
206 MapObjectType* object = GetOrTerminateProcess(map, object_id, reply_msg, | 202 MapObjectType* object = GetOrTerminateProcess(map, object_id, reply_msg, |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
238 const IPC::Message& message, bool* msg_is_ok) { | 234 const IPC::Message& message, bool* msg_is_ok) { |
239 bool handled = true; | 235 bool handled = true; |
240 IPC_BEGIN_MESSAGE_MAP_EX(IndexedDBDispatcherHost::DatabaseDispatcherHost, | 236 IPC_BEGIN_MESSAGE_MAP_EX(IndexedDBDispatcherHost::DatabaseDispatcherHost, |
241 message, *msg_is_ok) | 237 message, *msg_is_ok) |
242 IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_IDBDatabaseName, OnName) | 238 IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_IDBDatabaseName, OnName) |
243 IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_IDBDatabaseDescription, | 239 IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_IDBDatabaseDescription, |
244 OnDescription) | 240 OnDescription) |
245 IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_IDBDatabaseVersion, OnVersion) | 241 IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_IDBDatabaseVersion, OnVersion) |
246 IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_IDBDatabaseObjectStores, | 242 IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_IDBDatabaseObjectStores, |
247 OnObjectStores) | 243 OnObjectStores) |
| 244 IPC_MESSAGE_HANDLER(ViewHostMsg_IDBDatabaseCreateObjectStore, |
| 245 OnCreateObjectStore) |
248 IPC_MESSAGE_HANDLER(ViewHostMsg_IDBDatabaseDestroyed, OnDestroyed) | 246 IPC_MESSAGE_HANDLER(ViewHostMsg_IDBDatabaseDestroyed, OnDestroyed) |
249 IPC_MESSAGE_UNHANDLED(handled = false) | 247 IPC_MESSAGE_UNHANDLED(handled = false) |
250 IPC_END_MESSAGE_MAP() | 248 IPC_END_MESSAGE_MAP() |
251 return handled; | 249 return handled; |
252 } | 250 } |
253 | 251 |
254 void IndexedDBDispatcherHost::DatabaseDispatcherHost::Send( | 252 void IndexedDBDispatcherHost::DatabaseDispatcherHost::Send( |
255 IPC::Message* message) { | 253 IPC::Message* message) { |
256 // The macro magic in OnMessageReceived requires this to link, but it should | 254 // The macro magic in OnMessageReceived requires this to link, but it should |
257 // never actually be called. | 255 // never actually be called. |
(...skipping 29 matching lines...) Expand all Loading... |
287 | 285 |
288 WebDOMStringList web_object_stores = idb_database->objectStores(); | 286 WebDOMStringList web_object_stores = idb_database->objectStores(); |
289 std::vector<string16> object_stores; | 287 std::vector<string16> object_stores; |
290 for (unsigned i = 0; i < web_object_stores.length(); ++i) | 288 for (unsigned i = 0; i < web_object_stores.length(); ++i) |
291 object_stores[i] = web_object_stores.item(i); | 289 object_stores[i] = web_object_stores.item(i); |
292 ViewHostMsg_IDBDatabaseObjectStores::WriteReplyParams(reply_msg, | 290 ViewHostMsg_IDBDatabaseObjectStores::WriteReplyParams(reply_msg, |
293 object_stores); | 291 object_stores); |
294 parent_->Send(reply_msg); | 292 parent_->Send(reply_msg); |
295 } | 293 } |
296 | 294 |
| 295 void IndexedDBDispatcherHost::DatabaseDispatcherHost::OnCreateObjectStore( |
| 296 const ViewHostMsg_IDBDatabaseCreateObjectStore_Params& params) { |
| 297 DCHECK(ChromeThread::CurrentlyOn(ChromeThread::WEBKIT)); |
| 298 WebIDBDatabase* idb_database = parent_->GetOrTerminateProcess( |
| 299 &map_, params.idb_database_id_, NULL, |
| 300 ViewHostMsg_IDBDatabaseObjectStores::ID); |
| 301 if (!idb_database) |
| 302 return; |
| 303 idb_database->createObjectStore( |
| 304 params.name_, params.keypath_, params.auto_increment_, |
| 305 new IndexedDBCallbacks<WebIDBObjectStore, |
| 306 ViewMsg_IDBDatabaseCreateObjectStoreSuccess, |
| 307 ViewMsg_IDBDatabaseCreateObjectStoreError>( |
| 308 parent_, params.response_id_)); |
| 309 } |
| 310 |
297 void IndexedDBDispatcherHost::DatabaseDispatcherHost::OnDestroyed( | 311 void IndexedDBDispatcherHost::DatabaseDispatcherHost::OnDestroyed( |
298 int32 object_id) { | 312 int32 object_id) { |
299 parent_->DestroyObject(&map_, object_id, | 313 parent_->DestroyObject(&map_, object_id, |
300 ViewHostMsg_IDBDatabaseDestroyed::ID); | 314 ViewHostMsg_IDBDatabaseDestroyed::ID); |
301 } | 315 } |
302 | 316 |
303 | 317 |
304 ////////////////////////////////////////////////////////////////////// | 318 ////////////////////////////////////////////////////////////////////// |
305 // IndexedDBDispatcherHost::IndexDispatcherHost | 319 // IndexedDBDispatcherHost::IndexDispatcherHost |
306 // | 320 // |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
350 void IndexedDBDispatcherHost::IndexDispatcherHost::OnUnique( | 364 void IndexedDBDispatcherHost::IndexDispatcherHost::OnUnique( |
351 int32 object_id, IPC::Message* reply_msg) { | 365 int32 object_id, IPC::Message* reply_msg) { |
352 parent_->SyncGetter<bool, ViewHostMsg_IDBIndexUnique>( | 366 parent_->SyncGetter<bool, ViewHostMsg_IDBIndexUnique>( |
353 &map_, object_id, reply_msg, &WebIDBIndex::unique); | 367 &map_, object_id, reply_msg, &WebIDBIndex::unique); |
354 } | 368 } |
355 | 369 |
356 void IndexedDBDispatcherHost::IndexDispatcherHost::OnDestroyed( | 370 void IndexedDBDispatcherHost::IndexDispatcherHost::OnDestroyed( |
357 int32 object_id) { | 371 int32 object_id) { |
358 parent_->DestroyObject(&map_, object_id, ViewHostMsg_IDBIndexDestroyed::ID); | 372 parent_->DestroyObject(&map_, object_id, ViewHostMsg_IDBIndexDestroyed::ID); |
359 } | 373 } |
| 374 |
| 375 ////////////////////////////////////////////////////////////////////// |
| 376 // IndexedDBDispatcherHost::ObjectStoreDispatcherHost |
| 377 // |
| 378 |
| 379 IndexedDBDispatcherHost::ObjectStoreDispatcherHost::ObjectStoreDispatcherHost( |
| 380 IndexedDBDispatcherHost* parent) |
| 381 : parent_(parent) { |
| 382 } |
| 383 |
| 384 IndexedDBDispatcherHost:: |
| 385 ObjectStoreDispatcherHost::~ObjectStoreDispatcherHost() { |
| 386 } |
| 387 |
| 388 bool IndexedDBDispatcherHost::ObjectStoreDispatcherHost::OnMessageReceived( |
| 389 const IPC::Message& message, bool* msg_is_ok) { |
| 390 bool handled = true; |
| 391 IPC_BEGIN_MESSAGE_MAP_EX(IndexedDBDispatcherHost::ObjectStoreDispatcherHost, |
| 392 message, *msg_is_ok) |
| 393 IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_IDBObjectStoreName, OnName) |
| 394 IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_IDBObjectStoreKeyPath, |
| 395 OnKeyPath) |
| 396 IPC_MESSAGE_HANDLER(ViewHostMsg_IDBObjectStoreDestroyed, OnDestroyed) |
| 397 IPC_MESSAGE_UNHANDLED(handled = false) |
| 398 IPC_END_MESSAGE_MAP() |
| 399 return handled; |
| 400 } |
| 401 |
| 402 void IndexedDBDispatcherHost::ObjectStoreDispatcherHost::Send( |
| 403 IPC::Message* message) { |
| 404 // The macro magic in OnMessageReceived requires this to link, but it should |
| 405 // never actually be called. |
| 406 NOTREACHED(); |
| 407 parent_->Send(message); |
| 408 } |
| 409 |
| 410 void IndexedDBDispatcherHost::ObjectStoreDispatcherHost::OnName( |
| 411 int32 object_id, IPC::Message* reply_msg) { |
| 412 parent_->SyncGetter<string16, ViewHostMsg_IDBObjectStoreName>( |
| 413 &map_, object_id, reply_msg, &WebIDBObjectStore::name); |
| 414 } |
| 415 |
| 416 void IndexedDBDispatcherHost::ObjectStoreDispatcherHost::OnKeyPath( |
| 417 int32 object_id, IPC::Message* reply_msg) { |
| 418 parent_->SyncGetter<string16, ViewHostMsg_IDBObjectStoreKeyPath>( |
| 419 &map_, object_id, reply_msg, &WebIDBObjectStore::keyPath); |
| 420 } |
| 421 |
| 422 void IndexedDBDispatcherHost::ObjectStoreDispatcherHost::OnDestroyed( |
| 423 int32 object_id) { |
| 424 parent_->DestroyObject( |
| 425 &map_, object_id, ViewHostMsg_IDBObjectStoreDestroyed::ID); |
| 426 } |
OLD | NEW |