OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/browser/in_process_webkit/indexed_db_dispatcher_host.h" | 5 #include "content/browser/in_process_webkit/indexed_db_dispatcher_host.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
10 #include "content/browser/in_process_webkit/indexed_db_callbacks.h" | 10 #include "content/browser/in_process_webkit/indexed_db_callbacks.h" |
(...skipping 485 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
496 | 496 |
497 IndexedDBDispatcherHost::IndexDispatcherHost::~IndexDispatcherHost() { | 497 IndexedDBDispatcherHost::IndexDispatcherHost::~IndexDispatcherHost() { |
498 } | 498 } |
499 | 499 |
500 bool IndexedDBDispatcherHost::IndexDispatcherHost::OnMessageReceived( | 500 bool IndexedDBDispatcherHost::IndexDispatcherHost::OnMessageReceived( |
501 const IPC::Message& message, bool* msg_is_ok) { | 501 const IPC::Message& message, bool* msg_is_ok) { |
502 bool handled = true; | 502 bool handled = true; |
503 IPC_BEGIN_MESSAGE_MAP_EX(IndexedDBDispatcherHost::IndexDispatcherHost, | 503 IPC_BEGIN_MESSAGE_MAP_EX(IndexedDBDispatcherHost::IndexDispatcherHost, |
504 message, *msg_is_ok) | 504 message, *msg_is_ok) |
505 IPC_MESSAGE_HANDLER(IndexedDBHostMsg_IndexName, OnName) | 505 IPC_MESSAGE_HANDLER(IndexedDBHostMsg_IndexName, OnName) |
506 IPC_MESSAGE_HANDLER(IndexedDBHostMsg_IndexStoreName, OnStoreName) | |
507 IPC_MESSAGE_HANDLER(IndexedDBHostMsg_IndexKeyPath, OnKeyPath) | 506 IPC_MESSAGE_HANDLER(IndexedDBHostMsg_IndexKeyPath, OnKeyPath) |
508 IPC_MESSAGE_HANDLER(IndexedDBHostMsg_IndexUnique, OnUnique) | 507 IPC_MESSAGE_HANDLER(IndexedDBHostMsg_IndexUnique, OnUnique) |
509 IPC_MESSAGE_HANDLER(IndexedDBHostMsg_IndexMultiEntry, OnMultiEntry) | 508 IPC_MESSAGE_HANDLER(IndexedDBHostMsg_IndexMultiEntry, OnMultiEntry) |
510 IPC_MESSAGE_HANDLER(IndexedDBHostMsg_IndexOpenObjectCursor, | 509 IPC_MESSAGE_HANDLER(IndexedDBHostMsg_IndexOpenObjectCursor, |
511 OnOpenObjectCursor) | 510 OnOpenObjectCursor) |
512 IPC_MESSAGE_HANDLER(IndexedDBHostMsg_IndexOpenKeyCursor, OnOpenKeyCursor) | 511 IPC_MESSAGE_HANDLER(IndexedDBHostMsg_IndexOpenKeyCursor, OnOpenKeyCursor) |
513 IPC_MESSAGE_HANDLER(IndexedDBHostMsg_IndexCount, OnCount) | 512 IPC_MESSAGE_HANDLER(IndexedDBHostMsg_IndexCount, OnCount) |
514 IPC_MESSAGE_HANDLER(IndexedDBHostMsg_IndexGetObject, OnGetObject) | 513 IPC_MESSAGE_HANDLER(IndexedDBHostMsg_IndexGetObject, OnGetObject) |
515 IPC_MESSAGE_HANDLER(IndexedDBHostMsg_IndexGetKey, OnGetKey) | 514 IPC_MESSAGE_HANDLER(IndexedDBHostMsg_IndexGetKey, OnGetKey) |
516 IPC_MESSAGE_HANDLER(IndexedDBHostMsg_IndexDestroyed, OnDestroyed) | 515 IPC_MESSAGE_HANDLER(IndexedDBHostMsg_IndexDestroyed, OnDestroyed) |
517 IPC_MESSAGE_UNHANDLED(handled = false) | 516 IPC_MESSAGE_UNHANDLED(handled = false) |
518 IPC_END_MESSAGE_MAP() | 517 IPC_END_MESSAGE_MAP() |
519 return handled; | 518 return handled; |
520 } | 519 } |
521 | 520 |
522 void IndexedDBDispatcherHost::IndexDispatcherHost::Send( | 521 void IndexedDBDispatcherHost::IndexDispatcherHost::Send( |
523 IPC::Message* message) { | 522 IPC::Message* message) { |
524 parent_->Send(message); | 523 parent_->Send(message); |
525 } | 524 } |
526 | 525 |
527 void IndexedDBDispatcherHost::IndexDispatcherHost::OnName( | 526 void IndexedDBDispatcherHost::IndexDispatcherHost::OnName( |
528 int32 object_id, string16* name) { | 527 int32 object_id, string16* name) { |
529 parent_->SyncGetter<string16>(&map_, object_id, name, &WebIDBIndex::name); | 528 parent_->SyncGetter<string16>(&map_, object_id, name, &WebIDBIndex::name); |
530 } | 529 } |
531 | 530 |
532 void IndexedDBDispatcherHost::IndexDispatcherHost::OnStoreName( | |
533 int32 object_id, string16* store_name) { | |
534 parent_->SyncGetter<string16>( | |
535 &map_, object_id, store_name, &WebIDBIndex::storeName); | |
536 } | |
537 | |
538 void IndexedDBDispatcherHost::IndexDispatcherHost::OnKeyPath( | 531 void IndexedDBDispatcherHost::IndexDispatcherHost::OnKeyPath( |
539 int32 object_id, IndexedDBKeyPath* key_path) { | 532 int32 object_id, IndexedDBKeyPath* key_path) { |
540 WebIDBIndex* idb_index = parent_->GetOrTerminateProcess(&map_, object_id); | 533 WebIDBIndex* idb_index = parent_->GetOrTerminateProcess(&map_, object_id); |
541 if (!idb_index) | 534 if (!idb_index) |
542 return; | 535 return; |
543 | 536 |
544 *key_path = IndexedDBKeyPath(idb_index->keyPath()); | 537 *key_path = IndexedDBKeyPath(idb_index->keyPath()); |
545 } | 538 } |
546 | 539 |
547 void IndexedDBDispatcherHost::IndexDispatcherHost::OnUnique( | 540 void IndexedDBDispatcherHost::IndexDispatcherHost::OnUnique( |
(...skipping 672 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1220 } | 1213 } |
1221 idb_transaction->didCompleteTaskEvents(); | 1214 idb_transaction->didCompleteTaskEvents(); |
1222 } | 1215 } |
1223 | 1216 |
1224 void IndexedDBDispatcherHost::TransactionDispatcherHost::OnDestroyed( | 1217 void IndexedDBDispatcherHost::TransactionDispatcherHost::OnDestroyed( |
1225 int32 object_id) { | 1218 int32 object_id) { |
1226 transaction_size_map_.erase(object_id); | 1219 transaction_size_map_.erase(object_id); |
1227 transaction_url_map_.erase(object_id); | 1220 transaction_url_map_.erase(object_id); |
1228 parent_->DestroyObject(&map_, object_id); | 1221 parent_->DestroyObject(&map_, object_id); |
1229 } | 1222 } |
OLD | NEW |