| 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/indexed_db/indexed_db_dispatcher_host.h" | 5 #include "content/browser/indexed_db/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/files/file_path.h" | 9 #include "base/files/file_path.h" |
| 10 #include "base/memory/scoped_vector.h" |
| 10 #include "base/process/process.h" | 11 #include "base/process/process.h" |
| 11 #include "base/stl_util.h" | 12 #include "base/stl_util.h" |
| 12 #include "base/strings/utf_string_conversions.h" | 13 #include "base/strings/utf_string_conversions.h" |
| 14 #include "content/browser/child_process_security_policy_impl.h" |
| 13 #include "content/browser/indexed_db/indexed_db_callbacks.h" | 15 #include "content/browser/indexed_db/indexed_db_callbacks.h" |
| 14 #include "content/browser/indexed_db/indexed_db_connection.h" | 16 #include "content/browser/indexed_db/indexed_db_connection.h" |
| 15 #include "content/browser/indexed_db/indexed_db_context_impl.h" | 17 #include "content/browser/indexed_db/indexed_db_context_impl.h" |
| 16 #include "content/browser/indexed_db/indexed_db_cursor.h" | 18 #include "content/browser/indexed_db/indexed_db_cursor.h" |
| 17 #include "content/browser/indexed_db/indexed_db_database_callbacks.h" | 19 #include "content/browser/indexed_db/indexed_db_database_callbacks.h" |
| 18 #include "content/browser/indexed_db/indexed_db_metadata.h" | 20 #include "content/browser/indexed_db/indexed_db_metadata.h" |
| 19 #include "content/browser/indexed_db/indexed_db_pending_connection.h" | 21 #include "content/browser/indexed_db/indexed_db_pending_connection.h" |
| 20 #include "content/browser/indexed_db/indexed_db_value.h" | 22 #include "content/browser/indexed_db/indexed_db_value.h" |
| 21 #include "content/browser/renderer_host/render_message_filter.h" | 23 #include "content/browser/renderer_host/render_message_filter.h" |
| 22 #include "content/common/indexed_db/indexed_db_messages.h" | 24 #include "content/common/indexed_db/indexed_db_messages.h" |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 // Note that we explicitly separate CloseAll() from destruction of the | 111 // Note that we explicitly separate CloseAll() from destruction of the |
| 110 // DatabaseDispatcherHost, since CloseAll() can invoke callbacks which need to | 112 // DatabaseDispatcherHost, since CloseAll() can invoke callbacks which need to |
| 111 // be dispatched through database_dispatcher_host_. | 113 // be dispatched through database_dispatcher_host_. |
| 112 database_dispatcher_host_->CloseAll(); | 114 database_dispatcher_host_->CloseAll(); |
| 113 database_dispatcher_host_.reset(); | 115 database_dispatcher_host_.reset(); |
| 114 cursor_dispatcher_host_.reset(); | 116 cursor_dispatcher_host_.reset(); |
| 115 } | 117 } |
| 116 | 118 |
| 117 base::TaskRunner* IndexedDBDispatcherHost::OverrideTaskRunnerForMessage( | 119 base::TaskRunner* IndexedDBDispatcherHost::OverrideTaskRunnerForMessage( |
| 118 const IPC::Message& message) { | 120 const IPC::Message& message) { |
| 119 if (IPC_MESSAGE_CLASS(message) == IndexedDBMsgStart) | 121 if (IPC_MESSAGE_CLASS(message) == IndexedDBMsgStart && |
| 122 message.type() != IndexedDBHostMsg_DatabasePut::ID) |
| 120 return indexed_db_context_->TaskRunner(); | 123 return indexed_db_context_->TaskRunner(); |
| 121 return NULL; | 124 return NULL; |
| 122 } | 125 } |
| 123 | 126 |
| 124 bool IndexedDBDispatcherHost::OnMessageReceived(const IPC::Message& message, | 127 bool IndexedDBDispatcherHost::OnMessageReceived(const IPC::Message& message, |
| 125 bool* message_was_ok) { | 128 bool* message_was_ok) { |
| 126 if (IPC_MESSAGE_CLASS(message) != IndexedDBMsgStart) | 129 if (IPC_MESSAGE_CLASS(message) != IndexedDBMsgStart) |
| 127 return false; | 130 return false; |
| 128 | 131 |
| 129 DCHECK(indexed_db_context_->TaskRunner()->RunsTasksOnCurrentThread()); | 132 DCHECK(indexed_db_context_->TaskRunner()->RunsTasksOnCurrentThread() || |
| 133 message.type() == IndexedDBHostMsg_DatabasePut::ID); |
| 130 | 134 |
| 131 bool handled = | 135 bool handled = |
| 132 database_dispatcher_host_->OnMessageReceived(message, message_was_ok) || | 136 database_dispatcher_host_->OnMessageReceived(message, message_was_ok) || |
| 133 cursor_dispatcher_host_->OnMessageReceived(message, message_was_ok); | 137 cursor_dispatcher_host_->OnMessageReceived(message, message_was_ok); |
| 134 | 138 |
| 135 if (!handled) { | 139 if (!handled) { |
| 136 handled = true; | 140 handled = true; |
| 137 IPC_BEGIN_MESSAGE_MAP_EX(IndexedDBDispatcherHost, message, *message_was_ok) | 141 IPC_BEGIN_MESSAGE_MAP_EX(IndexedDBDispatcherHost, message, *message_was_ok) |
| 138 IPC_MESSAGE_HANDLER(IndexedDBHostMsg_FactoryGetDatabaseNames, | 142 IPC_MESSAGE_HANDLER(IndexedDBHostMsg_FactoryGetDatabaseNames, |
| 139 OnIDBFactoryGetDatabaseNames) | 143 OnIDBFactoryGetDatabaseNames) |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 327 DCHECK(request_context_); | 331 DCHECK(request_context_); |
| 328 Context()->GetIDBFactory()->DeleteDatabase( | 332 Context()->GetIDBFactory()->DeleteDatabase( |
| 329 params.name, | 333 params.name, |
| 330 request_context_, | 334 request_context_, |
| 331 new IndexedDBCallbacks( | 335 new IndexedDBCallbacks( |
| 332 this, params.ipc_thread_id, params.ipc_callbacks_id), | 336 this, params.ipc_thread_id, params.ipc_callbacks_id), |
| 333 origin_url, | 337 origin_url, |
| 334 indexed_db_path); | 338 indexed_db_path); |
| 335 } | 339 } |
| 336 | 340 |
| 341 // OnPutHelper exists only to allow us to hop threads while holding a reference |
| 342 // to the IndexedDBDispatcherHost. |
| 343 void IndexedDBDispatcherHost::OnPutHelper( |
| 344 const IndexedDBHostMsg_DatabasePut_Params& params, |
| 345 std::vector<webkit_blob::BlobDataHandle*> handles) { |
| 346 database_dispatcher_host_->OnPut(params, handles); |
| 347 } |
| 348 |
| 337 void IndexedDBDispatcherHost::OnAckReceivedBlobs( | 349 void IndexedDBDispatcherHost::OnAckReceivedBlobs( |
| 338 const std::vector<std::string>& uuids) { | 350 const std::vector<std::string>& uuids) { |
| 339 DCHECK(indexed_db_context_->TaskRunner()->RunsTasksOnCurrentThread()); | 351 DCHECK(indexed_db_context_->TaskRunner()->RunsTasksOnCurrentThread()); |
| 340 std::vector<std::string>::const_iterator iter; | 352 std::vector<std::string>::const_iterator iter; |
| 341 for (iter = uuids.begin(); iter != uuids.end(); ++iter) | 353 for (iter = uuids.begin(); iter != uuids.end(); ++iter) |
| 342 DropBlobDataHandle(*iter); | 354 DropBlobDataHandle(*iter); |
| 343 } | 355 } |
| 344 | 356 |
| 345 void IndexedDBDispatcherHost::FinishTransaction(int64 host_transaction_id, | 357 void IndexedDBDispatcherHost::FinishTransaction(int64 host_transaction_id, |
| 346 bool committed) { | 358 bool committed) { |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 444 if (connection && connection->IsConnected()) { | 456 if (connection && connection->IsConnected()) { |
| 445 connection->Close(); | 457 connection->Close(); |
| 446 parent_->Context()->ConnectionClosed(iter->second, connection); | 458 parent_->Context()->ConnectionClosed(iter->second, connection); |
| 447 } | 459 } |
| 448 } | 460 } |
| 449 } | 461 } |
| 450 | 462 |
| 451 bool IndexedDBDispatcherHost::DatabaseDispatcherHost::OnMessageReceived( | 463 bool IndexedDBDispatcherHost::DatabaseDispatcherHost::OnMessageReceived( |
| 452 const IPC::Message& message, | 464 const IPC::Message& message, |
| 453 bool* msg_is_ok) { | 465 bool* msg_is_ok) { |
| 466 |
| 454 DCHECK( | 467 DCHECK( |
| 468 (message.type() == IndexedDBHostMsg_DatabasePut::ID) || |
| 455 parent_->indexed_db_context_->TaskRunner()->RunsTasksOnCurrentThread()); | 469 parent_->indexed_db_context_->TaskRunner()->RunsTasksOnCurrentThread()); |
| 470 |
| 456 bool handled = true; | 471 bool handled = true; |
| 457 IPC_BEGIN_MESSAGE_MAP_EX( | 472 IPC_BEGIN_MESSAGE_MAP_EX( |
| 458 IndexedDBDispatcherHost::DatabaseDispatcherHost, message, *msg_is_ok) | 473 IndexedDBDispatcherHost::DatabaseDispatcherHost, message, *msg_is_ok) |
| 459 IPC_MESSAGE_HANDLER(IndexedDBHostMsg_DatabaseCreateObjectStore, | 474 IPC_MESSAGE_HANDLER(IndexedDBHostMsg_DatabaseCreateObjectStore, |
| 460 OnCreateObjectStore) | 475 OnCreateObjectStore) |
| 461 IPC_MESSAGE_HANDLER(IndexedDBHostMsg_DatabaseDeleteObjectStore, | 476 IPC_MESSAGE_HANDLER(IndexedDBHostMsg_DatabaseDeleteObjectStore, |
| 462 OnDeleteObjectStore) | 477 OnDeleteObjectStore) |
| 463 IPC_MESSAGE_HANDLER(IndexedDBHostMsg_DatabaseCreateTransaction, | 478 IPC_MESSAGE_HANDLER(IndexedDBHostMsg_DatabaseCreateTransaction, |
| 464 OnCreateTransaction) | 479 OnCreateTransaction) |
| 465 IPC_MESSAGE_HANDLER(IndexedDBHostMsg_DatabaseClose, OnClose) | 480 IPC_MESSAGE_HANDLER(IndexedDBHostMsg_DatabaseClose, OnClose) |
| 466 IPC_MESSAGE_HANDLER(IndexedDBHostMsg_DatabaseDestroyed, OnDestroyed) | 481 IPC_MESSAGE_HANDLER(IndexedDBHostMsg_DatabaseDestroyed, OnDestroyed) |
| 467 IPC_MESSAGE_HANDLER(IndexedDBHostMsg_DatabaseGet, OnGet) | 482 IPC_MESSAGE_HANDLER(IndexedDBHostMsg_DatabaseGet, OnGet) |
| 468 IPC_MESSAGE_HANDLER(IndexedDBHostMsg_DatabasePut, OnPut) | 483 IPC_MESSAGE_HANDLER(IndexedDBHostMsg_DatabasePut, OnPutWrapper) |
| 469 IPC_MESSAGE_HANDLER(IndexedDBHostMsg_DatabaseSetIndexKeys, OnSetIndexKeys) | 484 IPC_MESSAGE_HANDLER(IndexedDBHostMsg_DatabaseSetIndexKeys, OnSetIndexKeys) |
| 470 IPC_MESSAGE_HANDLER(IndexedDBHostMsg_DatabaseSetIndexesReady, | 485 IPC_MESSAGE_HANDLER(IndexedDBHostMsg_DatabaseSetIndexesReady, |
| 471 OnSetIndexesReady) | 486 OnSetIndexesReady) |
| 472 IPC_MESSAGE_HANDLER(IndexedDBHostMsg_DatabaseOpenCursor, OnOpenCursor) | 487 IPC_MESSAGE_HANDLER(IndexedDBHostMsg_DatabaseOpenCursor, OnOpenCursor) |
| 473 IPC_MESSAGE_HANDLER(IndexedDBHostMsg_DatabaseCount, OnCount) | 488 IPC_MESSAGE_HANDLER(IndexedDBHostMsg_DatabaseCount, OnCount) |
| 474 IPC_MESSAGE_HANDLER(IndexedDBHostMsg_DatabaseDeleteRange, OnDeleteRange) | 489 IPC_MESSAGE_HANDLER(IndexedDBHostMsg_DatabaseDeleteRange, OnDeleteRange) |
| 475 IPC_MESSAGE_HANDLER(IndexedDBHostMsg_DatabaseClear, OnClear) | 490 IPC_MESSAGE_HANDLER(IndexedDBHostMsg_DatabaseClear, OnClear) |
| 476 IPC_MESSAGE_HANDLER(IndexedDBHostMsg_DatabaseCreateIndex, OnCreateIndex) | 491 IPC_MESSAGE_HANDLER(IndexedDBHostMsg_DatabaseCreateIndex, OnCreateIndex) |
| 477 IPC_MESSAGE_HANDLER(IndexedDBHostMsg_DatabaseDeleteIndex, OnDeleteIndex) | 492 IPC_MESSAGE_HANDLER(IndexedDBHostMsg_DatabaseDeleteIndex, OnDeleteIndex) |
| 478 IPC_MESSAGE_HANDLER(IndexedDBHostMsg_DatabaseAbort, OnAbort) | 493 IPC_MESSAGE_HANDLER(IndexedDBHostMsg_DatabaseAbort, OnAbort) |
| 479 IPC_MESSAGE_HANDLER(IndexedDBHostMsg_DatabaseCommit, OnCommit) | 494 IPC_MESSAGE_HANDLER(IndexedDBHostMsg_DatabaseCommit, OnCommit) |
| 480 IPC_MESSAGE_UNHANDLED(handled = false) | 495 IPC_MESSAGE_UNHANDLED(handled = false) |
| 481 IPC_END_MESSAGE_MAP() | 496 IPC_END_MESSAGE_MAP() |
| 497 |
| 482 return handled; | 498 return handled; |
| 483 } | 499 } |
| 484 | 500 |
| 485 void IndexedDBDispatcherHost::DatabaseDispatcherHost::OnCreateObjectStore( | 501 void IndexedDBDispatcherHost::DatabaseDispatcherHost::OnCreateObjectStore( |
| 486 const IndexedDBHostMsg_DatabaseCreateObjectStore_Params& params) { | 502 const IndexedDBHostMsg_DatabaseCreateObjectStore_Params& params) { |
| 487 DCHECK( | 503 DCHECK( |
| 488 parent_->indexed_db_context_->TaskRunner()->RunsTasksOnCurrentThread()); | 504 parent_->indexed_db_context_->TaskRunner()->RunsTasksOnCurrentThread()); |
| 489 IndexedDBConnection* connection = | 505 IndexedDBConnection* connection = |
| 490 parent_->GetOrTerminateProcess(&map_, params.ipc_database_id); | 506 parent_->GetOrTerminateProcess(&map_, params.ipc_database_id); |
| 491 if (!connection || !connection->IsConnected()) | 507 if (!connection || !connection->IsConnected()) |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 581 parent_, params.ipc_thread_id, params.ipc_callbacks_id)); | 597 parent_, params.ipc_thread_id, params.ipc_callbacks_id)); |
| 582 connection->database()->Get( | 598 connection->database()->Get( |
| 583 parent_->HostTransactionId(params.transaction_id), | 599 parent_->HostTransactionId(params.transaction_id), |
| 584 params.object_store_id, | 600 params.object_store_id, |
| 585 params.index_id, | 601 params.index_id, |
| 586 make_scoped_ptr(new IndexedDBKeyRange(params.key_range)), | 602 make_scoped_ptr(new IndexedDBKeyRange(params.key_range)), |
| 587 params.key_only, | 603 params.key_only, |
| 588 callbacks); | 604 callbacks); |
| 589 } | 605 } |
| 590 | 606 |
| 607 void IndexedDBDispatcherHost::DatabaseDispatcherHost::OnPutWrapper( |
| 608 const IndexedDBHostMsg_DatabasePut_Params& params) { |
| 609 std::vector<webkit_blob::BlobDataHandle*> handles; |
| 610 for (size_t i = 0; i < params.blob_or_file_info.size(); ++i) { |
| 611 const IndexedDBMsg_BlobOrFileInfo& info = params.blob_or_file_info[i]; |
| 612 handles.push_back(parent_->blob_storage_context_->context() |
| 613 ->GetBlobDataFromUUID(info.uuid) |
| 614 .release()); |
| 615 } |
| 616 parent_->indexed_db_context_->TaskRunner()->PostTask( |
| 617 FROM_HERE, |
| 618 base::Bind( |
| 619 &IndexedDBDispatcherHost::OnPutHelper, parent_, params, handles)); |
| 620 } |
| 621 |
| 591 void IndexedDBDispatcherHost::DatabaseDispatcherHost::OnPut( | 622 void IndexedDBDispatcherHost::DatabaseDispatcherHost::OnPut( |
| 592 const IndexedDBHostMsg_DatabasePut_Params& params) { | 623 const IndexedDBHostMsg_DatabasePut_Params& params, |
| 624 std::vector<webkit_blob::BlobDataHandle*> handles) { |
| 625 |
| 593 DCHECK( | 626 DCHECK( |
| 594 parent_->indexed_db_context_->TaskRunner()->RunsTasksOnCurrentThread()); | 627 parent_->indexed_db_context_->TaskRunner()->RunsTasksOnCurrentThread()); |
| 595 | 628 |
| 629 ScopedVector<webkit_blob::BlobDataHandle> scoped_handles; |
| 630 scoped_handles.swap(handles); |
| 631 |
| 596 IndexedDBConnection* connection = | 632 IndexedDBConnection* connection = |
| 597 parent_->GetOrTerminateProcess(&map_, params.ipc_database_id); | 633 parent_->GetOrTerminateProcess(&map_, params.ipc_database_id); |
| 598 if (!connection || !connection->IsConnected()) | 634 if (!connection || !connection->IsConnected()) |
| 599 return; | 635 return; |
| 600 scoped_refptr<IndexedDBCallbacks> callbacks(new IndexedDBCallbacks( | 636 scoped_refptr<IndexedDBCallbacks> callbacks(new IndexedDBCallbacks( |
| 601 parent_, params.ipc_thread_id, params.ipc_callbacks_id)); | 637 parent_, params.ipc_thread_id, params.ipc_callbacks_id)); |
| 602 | 638 |
| 603 int64 host_transaction_id = parent_->HostTransactionId(params.transaction_id); | 639 int64 host_transaction_id = parent_->HostTransactionId(params.transaction_id); |
| 640 |
| 641 std::vector<IndexedDBBlobInfo> blob_info(params.blob_or_file_info.size()); |
| 642 |
| 643 ChildProcessSecurityPolicyImpl* policy = |
| 644 ChildProcessSecurityPolicyImpl::GetInstance(); |
| 645 |
| 646 for (size_t i = 0; i < params.blob_or_file_info.size(); ++i) { |
| 647 const IndexedDBMsg_BlobOrFileInfo& info = params.blob_or_file_info[i]; |
| 648 if (info.is_file) { |
| 649 base::FilePath path = base::FilePath::FromUTF16Unsafe(info.file_path); |
| 650 if (!policy->CanReadFile(parent_->ipc_process_id_, path)) { |
| 651 parent_->BadMessageReceived(); |
| 652 return; |
| 653 } |
| 654 blob_info[i] = IndexedDBBlobInfo(path, info.file_name, info.mime_type); |
| 655 } else { |
| 656 blob_info[i] = IndexedDBBlobInfo(info.uuid, info.mime_type, info.size); |
| 657 } |
| 658 } |
| 659 |
| 604 // TODO(alecflett): Avoid a copy here. | 660 // TODO(alecflett): Avoid a copy here. |
| 605 IndexedDBValue value; | 661 IndexedDBValue value; |
| 606 value.bits = params.value; | 662 value.bits = params.value; |
| 663 value.blob_info.swap(blob_info); |
| 607 connection->database()->Put( | 664 connection->database()->Put( |
| 608 host_transaction_id, | 665 host_transaction_id, |
| 609 params.object_store_id, | 666 params.object_store_id, |
| 610 &value, | 667 &value, |
| 668 &scoped_handles, |
| 611 make_scoped_ptr(new IndexedDBKey(params.key)), | 669 make_scoped_ptr(new IndexedDBKey(params.key)), |
| 612 static_cast<IndexedDBDatabase::PutMode>(params.put_mode), | 670 static_cast<IndexedDBDatabase::PutMode>(params.put_mode), |
| 613 callbacks, | 671 callbacks, |
| 614 params.index_keys); | 672 params.index_keys); |
| 615 TransactionIDToSizeMap* map = | 673 TransactionIDToSizeMap* map = |
| 616 &parent_->database_dispatcher_host_->transaction_size_map_; | 674 &parent_->database_dispatcher_host_->transaction_size_map_; |
| 617 // Size can't be big enough to overflow because it represents the | 675 // Size can't be big enough to overflow because it represents the |
| 618 // actual bytes passed through IPC. | 676 // actual bytes passed through IPC. |
| 619 (*map)[host_transaction_id] += params.value.size(); | 677 (*map)[host_transaction_id] += params.value.size(); |
| 620 } | 678 } |
| (...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 817 IndexedDBDispatcherHost* parent) | 875 IndexedDBDispatcherHost* parent) |
| 818 : parent_(parent) { | 876 : parent_(parent) { |
| 819 map_.set_check_on_null_data(true); | 877 map_.set_check_on_null_data(true); |
| 820 } | 878 } |
| 821 | 879 |
| 822 IndexedDBDispatcherHost::CursorDispatcherHost::~CursorDispatcherHost() {} | 880 IndexedDBDispatcherHost::CursorDispatcherHost::~CursorDispatcherHost() {} |
| 823 | 881 |
| 824 bool IndexedDBDispatcherHost::CursorDispatcherHost::OnMessageReceived( | 882 bool IndexedDBDispatcherHost::CursorDispatcherHost::OnMessageReceived( |
| 825 const IPC::Message& message, | 883 const IPC::Message& message, |
| 826 bool* msg_is_ok) { | 884 bool* msg_is_ok) { |
| 827 DCHECK( | |
| 828 parent_->indexed_db_context_->TaskRunner()->RunsTasksOnCurrentThread()); | |
| 829 | |
| 830 bool handled = true; | 885 bool handled = true; |
| 831 IPC_BEGIN_MESSAGE_MAP_EX( | 886 IPC_BEGIN_MESSAGE_MAP_EX( |
| 832 IndexedDBDispatcherHost::CursorDispatcherHost, message, *msg_is_ok) | 887 IndexedDBDispatcherHost::CursorDispatcherHost, message, *msg_is_ok) |
| 833 IPC_MESSAGE_HANDLER(IndexedDBHostMsg_CursorAdvance, OnAdvance) | 888 IPC_MESSAGE_HANDLER(IndexedDBHostMsg_CursorAdvance, OnAdvance) |
| 834 IPC_MESSAGE_HANDLER(IndexedDBHostMsg_CursorContinue, OnContinue) | 889 IPC_MESSAGE_HANDLER(IndexedDBHostMsg_CursorContinue, OnContinue) |
| 835 IPC_MESSAGE_HANDLER(IndexedDBHostMsg_CursorPrefetch, OnPrefetch) | 890 IPC_MESSAGE_HANDLER(IndexedDBHostMsg_CursorPrefetch, OnPrefetch) |
| 836 IPC_MESSAGE_HANDLER(IndexedDBHostMsg_CursorPrefetchReset, OnPrefetchReset) | 891 IPC_MESSAGE_HANDLER(IndexedDBHostMsg_CursorPrefetchReset, OnPrefetchReset) |
| 837 IPC_MESSAGE_HANDLER(IndexedDBHostMsg_CursorDestroyed, OnDestroyed) | 892 IPC_MESSAGE_HANDLER(IndexedDBHostMsg_CursorDestroyed, OnDestroyed) |
| 838 IPC_MESSAGE_UNHANDLED(handled = false) | 893 IPC_MESSAGE_UNHANDLED(handled = false) |
| 839 IPC_END_MESSAGE_MAP() | 894 IPC_END_MESSAGE_MAP() |
| 895 |
| 896 DCHECK( |
| 897 !handled || |
| 898 parent_->indexed_db_context_->TaskRunner()->RunsTasksOnCurrentThread()); |
| 899 |
| 840 return handled; | 900 return handled; |
| 841 } | 901 } |
| 842 | 902 |
| 843 void IndexedDBDispatcherHost::CursorDispatcherHost::OnAdvance( | 903 void IndexedDBDispatcherHost::CursorDispatcherHost::OnAdvance( |
| 844 int32 ipc_cursor_id, | 904 int32 ipc_cursor_id, |
| 845 int32 ipc_thread_id, | 905 int32 ipc_thread_id, |
| 846 int32 ipc_callbacks_id, | 906 int32 ipc_callbacks_id, |
| 847 unsigned long count) { | 907 unsigned long count) { |
| 848 DCHECK( | 908 DCHECK( |
| 849 parent_->indexed_db_context_->TaskRunner()->RunsTasksOnCurrentThread()); | 909 parent_->indexed_db_context_->TaskRunner()->RunsTasksOnCurrentThread()); |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 917 } | 977 } |
| 918 | 978 |
| 919 void IndexedDBDispatcherHost::CursorDispatcherHost::OnDestroyed( | 979 void IndexedDBDispatcherHost::CursorDispatcherHost::OnDestroyed( |
| 920 int32 ipc_object_id) { | 980 int32 ipc_object_id) { |
| 921 DCHECK( | 981 DCHECK( |
| 922 parent_->indexed_db_context_->TaskRunner()->RunsTasksOnCurrentThread()); | 982 parent_->indexed_db_context_->TaskRunner()->RunsTasksOnCurrentThread()); |
| 923 parent_->DestroyObject(&map_, ipc_object_id); | 983 parent_->DestroyObject(&map_, ipc_object_id); |
| 924 } | 984 } |
| 925 | 985 |
| 926 } // namespace content | 986 } // namespace content |
| OLD | NEW |