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/common/indexed_db/indexed_db_dispatcher.h" | 5 #include "content/common/indexed_db/indexed_db_dispatcher.h" |
6 | 6 |
7 #include "base/lazy_instance.h" | 7 #include "base/lazy_instance.h" |
8 #include "base/threading/thread_local.h" | 8 #include "base/threading/thread_local.h" |
9 #include "content/common/child_thread.h" | 9 #include "content/common/child_thread.h" |
10 #include "content/common/indexed_db/indexed_db_messages.h" | 10 #include "content/common/indexed_db/indexed_db_messages.h" |
11 #include "content/common/indexed_db/proxy_webidbcursor_impl.h" | 11 #include "content/common/indexed_db/proxy_webidbcursor_impl.h" |
12 #include "content/common/indexed_db/proxy_webidbdatabase_impl.h" | 12 #include "content/common/indexed_db/proxy_webidbdatabase_impl.h" |
13 #include "ipc/ipc_channel.h" | 13 #include "ipc/ipc_channel.h" |
14 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" | 14 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" |
15 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBDatabaseCallbac
ks.h" | 15 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBDatabaseCallbac
ks.h" |
16 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBDatabaseError.h
" | 16 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBDatabaseError.h
" |
17 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBDatabaseExcepti
on.h" | 17 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBDatabaseExcepti
on.h" |
18 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBKeyRange.h" | 18 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBKeyRange.h" |
| 19 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSerializedScriptVa
lue.h" |
19 | 20 |
20 using WebKit::WebDOMStringList; | 21 using WebKit::WebDOMStringList; |
21 using WebKit::WebData; | 22 using WebKit::WebData; |
22 using WebKit::WebExceptionCode; | 23 using WebKit::WebExceptionCode; |
23 using WebKit::WebFrame; | 24 using WebKit::WebFrame; |
24 using WebKit::WebIDBCallbacks; | 25 using WebKit::WebIDBCallbacks; |
25 using WebKit::WebIDBDatabase; | 26 using WebKit::WebIDBDatabase; |
26 using WebKit::WebIDBDatabaseCallbacks; | 27 using WebKit::WebIDBDatabaseCallbacks; |
27 using WebKit::WebIDBDatabaseError; | 28 using WebKit::WebIDBDatabaseError; |
28 using WebKit::WebIDBKey; | 29 using WebKit::WebIDBKey; |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 web_index_metadata.multiEntry = idb_index_metadata.multiEntry; | 122 web_index_metadata.multiEntry = idb_index_metadata.multiEntry; |
122 } | 123 } |
123 } | 124 } |
124 | 125 |
125 return web_metadata; | 126 return web_metadata; |
126 } | 127 } |
127 | 128 |
128 void IndexedDBDispatcher::OnMessageReceived(const IPC::Message& msg) { | 129 void IndexedDBDispatcher::OnMessageReceived(const IPC::Message& msg) { |
129 bool handled = true; | 130 bool handled = true; |
130 IPC_BEGIN_MESSAGE_MAP(IndexedDBDispatcher, msg) | 131 IPC_BEGIN_MESSAGE_MAP(IndexedDBDispatcher, msg) |
| 132 IPC_MESSAGE_HANDLER(IndexedDBMsg_CallbacksSuccessIDBCursorOld, |
| 133 OnSuccessOpenCursorOld) |
131 IPC_MESSAGE_HANDLER(IndexedDBMsg_CallbacksSuccessIDBCursor, | 134 IPC_MESSAGE_HANDLER(IndexedDBMsg_CallbacksSuccessIDBCursor, |
132 OnSuccessOpenCursor) | 135 OnSuccessOpenCursor) |
| 136 IPC_MESSAGE_HANDLER(IndexedDBMsg_CallbacksSuccessCursorAdvanceOld, |
| 137 OnSuccessCursorContinueOld) |
133 IPC_MESSAGE_HANDLER(IndexedDBMsg_CallbacksSuccessCursorAdvance, | 138 IPC_MESSAGE_HANDLER(IndexedDBMsg_CallbacksSuccessCursorAdvance, |
134 OnSuccessCursorContinue) | 139 OnSuccessCursorContinue) |
| 140 IPC_MESSAGE_HANDLER(IndexedDBMsg_CallbacksSuccessCursorContinueOld, |
| 141 OnSuccessCursorContinueOld) |
135 IPC_MESSAGE_HANDLER(IndexedDBMsg_CallbacksSuccessCursorContinue, | 142 IPC_MESSAGE_HANDLER(IndexedDBMsg_CallbacksSuccessCursorContinue, |
136 OnSuccessCursorContinue) | 143 OnSuccessCursorContinue) |
| 144 IPC_MESSAGE_HANDLER(IndexedDBMsg_CallbacksSuccessCursorPrefetchOld, |
| 145 OnSuccessCursorPrefetchOld) |
137 IPC_MESSAGE_HANDLER(IndexedDBMsg_CallbacksSuccessCursorPrefetch, | 146 IPC_MESSAGE_HANDLER(IndexedDBMsg_CallbacksSuccessCursorPrefetch, |
138 OnSuccessCursorPrefetch) | 147 OnSuccessCursorPrefetch) |
139 IPC_MESSAGE_HANDLER(IndexedDBMsg_CallbacksSuccessIDBDatabase, | 148 IPC_MESSAGE_HANDLER(IndexedDBMsg_CallbacksSuccessIDBDatabase, |
140 OnSuccessIDBDatabase) | 149 OnSuccessIDBDatabase) |
141 IPC_MESSAGE_HANDLER(IndexedDBMsg_CallbacksSuccessIndexedDBKey, | 150 IPC_MESSAGE_HANDLER(IndexedDBMsg_CallbacksSuccessIndexedDBKey, |
142 OnSuccessIndexedDBKey) | 151 OnSuccessIndexedDBKey) |
143 IPC_MESSAGE_HANDLER(IndexedDBMsg_CallbacksSuccessStringList, | 152 IPC_MESSAGE_HANDLER(IndexedDBMsg_CallbacksSuccessStringList, |
144 OnSuccessStringList) | 153 OnSuccessStringList) |
145 IPC_MESSAGE_HANDLER(IndexedDBMsg_CallbacksSuccessSerializedScriptValue, | 154 IPC_MESSAGE_HANDLER(IndexedDBMsg_CallbacksSuccessSerializedScriptValue, |
146 OnSuccessSerializedScriptValue) | 155 OnSuccessSerializedScriptValue) |
| 156 IPC_MESSAGE_HANDLER(IndexedDBMsg_CallbacksSuccessValue, |
| 157 OnSuccessValue) |
147 IPC_MESSAGE_HANDLER(IndexedDBMsg_CallbacksSuccessSerializedScriptValueWithKe
y, | 158 IPC_MESSAGE_HANDLER(IndexedDBMsg_CallbacksSuccessSerializedScriptValueWithKe
y, |
148 OnSuccessSerializedScriptValueWithKey) | 159 OnSuccessSerializedScriptValueWithKey) |
| 160 IPC_MESSAGE_HANDLER(IndexedDBMsg_CallbacksSuccessValueWithKey, |
| 161 OnSuccessValueWithKey) |
149 IPC_MESSAGE_HANDLER(IndexedDBMsg_CallbacksSuccessInteger, | 162 IPC_MESSAGE_HANDLER(IndexedDBMsg_CallbacksSuccessInteger, |
150 OnSuccessInteger) | 163 OnSuccessInteger) |
151 IPC_MESSAGE_HANDLER(IndexedDBMsg_CallbacksSuccessUndefined, | 164 IPC_MESSAGE_HANDLER(IndexedDBMsg_CallbacksSuccessUndefined, |
152 OnSuccessUndefined) | 165 OnSuccessUndefined) |
153 IPC_MESSAGE_HANDLER(IndexedDBMsg_CallbacksError, OnError) | 166 IPC_MESSAGE_HANDLER(IndexedDBMsg_CallbacksError, OnError) |
154 IPC_MESSAGE_HANDLER(IndexedDBMsg_CallbacksIntBlocked, OnIntBlocked) | 167 IPC_MESSAGE_HANDLER(IndexedDBMsg_CallbacksIntBlocked, OnIntBlocked) |
155 IPC_MESSAGE_HANDLER(IndexedDBMsg_CallbacksUpgradeNeeded, OnUpgradeNeeded) | 168 IPC_MESSAGE_HANDLER(IndexedDBMsg_CallbacksUpgradeNeeded, OnUpgradeNeeded) |
156 IPC_MESSAGE_HANDLER(IndexedDBMsg_DatabaseCallbacksForcedClose, | 169 IPC_MESSAGE_HANDLER(IndexedDBMsg_DatabaseCallbacksForcedClose, |
157 OnForcedClose) | 170 OnForcedClose) |
158 IPC_MESSAGE_HANDLER(IndexedDBMsg_DatabaseCallbacksIntVersionChange, | 171 IPC_MESSAGE_HANDLER(IndexedDBMsg_DatabaseCallbacksIntVersionChange, |
(...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
554 int32 ipc_thread_id, int32 ipc_response_id, | 567 int32 ipc_thread_id, int32 ipc_response_id, |
555 const SerializedScriptValue& value) { | 568 const SerializedScriptValue& value) { |
556 DCHECK_EQ(ipc_thread_id, CurrentWorkerId()); | 569 DCHECK_EQ(ipc_thread_id, CurrentWorkerId()); |
557 WebIDBCallbacks* callbacks = pending_callbacks_.Lookup(ipc_response_id); | 570 WebIDBCallbacks* callbacks = pending_callbacks_.Lookup(ipc_response_id); |
558 if (!callbacks) | 571 if (!callbacks) |
559 return; | 572 return; |
560 callbacks->onSuccess(WebSerializedScriptValue(value)); | 573 callbacks->onSuccess(WebSerializedScriptValue(value)); |
561 pending_callbacks_.Remove(ipc_response_id); | 574 pending_callbacks_.Remove(ipc_response_id); |
562 } | 575 } |
563 | 576 |
| 577 void IndexedDBDispatcher::OnSuccessValue( |
| 578 int32 ipc_thread_id, int32 ipc_response_id, |
| 579 const std::vector<char>& value) { |
| 580 DCHECK_EQ(ipc_thread_id, CurrentWorkerId()); |
| 581 WebIDBCallbacks* callbacks = pending_callbacks_.Lookup(ipc_response_id); |
| 582 if (!callbacks) |
| 583 return; |
| 584 WebData web_value; |
| 585 if (value.size()) |
| 586 web_value.assign(&value.front(), value.size()); |
| 587 callbacks->onSuccess(web_value); |
| 588 pending_callbacks_.Remove(ipc_response_id); |
| 589 } |
| 590 |
564 void IndexedDBDispatcher::OnSuccessSerializedScriptValueWithKey( | 591 void IndexedDBDispatcher::OnSuccessSerializedScriptValueWithKey( |
565 int32 ipc_thread_id, int32 ipc_response_id, | 592 int32 ipc_thread_id, int32 ipc_response_id, |
566 const SerializedScriptValue& value, | 593 const SerializedScriptValue& value, |
567 const IndexedDBKey& primary_key, | 594 const IndexedDBKey& primary_key, |
568 const IndexedDBKeyPath& key_path) { | 595 const IndexedDBKeyPath& key_path) { |
569 DCHECK_EQ(ipc_thread_id, CurrentWorkerId()); | 596 DCHECK_EQ(ipc_thread_id, CurrentWorkerId()); |
570 WebIDBCallbacks* callbacks = pending_callbacks_.Lookup(ipc_response_id); | 597 WebIDBCallbacks* callbacks = pending_callbacks_.Lookup(ipc_response_id); |
571 if (!callbacks) | 598 if (!callbacks) |
572 return; | 599 return; |
573 callbacks->onSuccess(WebSerializedScriptValue(value), | 600 callbacks->onSuccess(WebSerializedScriptValue(value), |
574 primary_key, key_path); | 601 primary_key, key_path); |
575 pending_callbacks_.Remove(ipc_response_id); | 602 pending_callbacks_.Remove(ipc_response_id); |
576 } | 603 } |
577 | 604 |
| 605 void IndexedDBDispatcher::OnSuccessValueWithKey( |
| 606 int32 ipc_thread_id, int32 ipc_response_id, |
| 607 const std::vector<char>& value, |
| 608 const IndexedDBKey& primary_key, |
| 609 const IndexedDBKeyPath& key_path) { |
| 610 DCHECK_EQ(ipc_thread_id, CurrentWorkerId()); |
| 611 WebIDBCallbacks* callbacks = pending_callbacks_.Lookup(ipc_response_id); |
| 612 if (!callbacks) |
| 613 return; |
| 614 WebData web_value; |
| 615 if (value.size()) |
| 616 web_value.assign(&value.front(), value.size()); |
| 617 callbacks->onSuccess(web_value, |
| 618 primary_key, key_path); |
| 619 pending_callbacks_.Remove(ipc_response_id); |
| 620 } |
| 621 |
578 void IndexedDBDispatcher::OnSuccessInteger( | 622 void IndexedDBDispatcher::OnSuccessInteger( |
579 int32 ipc_thread_id, int32 ipc_response_id, int64 value) { | 623 int32 ipc_thread_id, int32 ipc_response_id, int64 value) { |
580 DCHECK_EQ(ipc_thread_id, CurrentWorkerId()); | 624 DCHECK_EQ(ipc_thread_id, CurrentWorkerId()); |
581 WebIDBCallbacks* callbacks = pending_callbacks_.Lookup(ipc_response_id); | 625 WebIDBCallbacks* callbacks = pending_callbacks_.Lookup(ipc_response_id); |
582 if (!callbacks) | 626 if (!callbacks) |
583 return; | 627 return; |
584 callbacks->onSuccess(value); | 628 callbacks->onSuccess(value); |
585 pending_callbacks_.Remove(ipc_response_id); | 629 pending_callbacks_.Remove(ipc_response_id); |
586 } | 630 } |
587 | 631 |
588 void IndexedDBDispatcher::OnSuccessUndefined( | 632 void IndexedDBDispatcher::OnSuccessUndefined( |
589 int32 ipc_thread_id, int32 ipc_response_id) { | 633 int32 ipc_thread_id, int32 ipc_response_id) { |
590 DCHECK_EQ(ipc_thread_id, CurrentWorkerId()); | 634 DCHECK_EQ(ipc_thread_id, CurrentWorkerId()); |
591 WebIDBCallbacks* callbacks = pending_callbacks_.Lookup(ipc_response_id); | 635 WebIDBCallbacks* callbacks = pending_callbacks_.Lookup(ipc_response_id); |
592 if (!callbacks) | 636 if (!callbacks) |
593 return; | 637 return; |
594 callbacks->onSuccess(); | 638 callbacks->onSuccess(); |
595 pending_callbacks_.Remove(ipc_response_id); | 639 pending_callbacks_.Remove(ipc_response_id); |
596 } | 640 } |
597 | 641 |
598 void IndexedDBDispatcher::OnSuccessOpenCursor( | 642 void IndexedDBDispatcher::OnSuccessOpenCursorOld( |
599 const IndexedDBMsg_CallbacksSuccessIDBCursor_Params& p) { | 643 const IndexedDBMsg_CallbacksSuccessIDBCursorOld_Params& p) { |
600 DCHECK_EQ(p.ipc_thread_id, CurrentWorkerId()); | 644 DCHECK_EQ(p.ipc_thread_id, CurrentWorkerId()); |
601 int32 ipc_response_id = p.ipc_response_id; | 645 int32 ipc_response_id = p.ipc_response_id; |
602 int32 ipc_object_id = p.ipc_cursor_id; | 646 int32 ipc_object_id = p.ipc_cursor_id; |
603 const IndexedDBKey& key = p.key; | 647 const IndexedDBKey& key = p.key; |
604 const IndexedDBKey& primary_key = p.primary_key; | 648 const IndexedDBKey& primary_key = p.primary_key; |
605 const SerializedScriptValue& value = p.serialized_value; | 649 const SerializedScriptValue& value = p.serialized_value; |
606 | 650 |
607 WebIDBCallbacks* callbacks = | 651 WebIDBCallbacks* callbacks = |
608 pending_callbacks_.Lookup(ipc_response_id); | 652 pending_callbacks_.Lookup(ipc_response_id); |
609 if (!callbacks) | 653 if (!callbacks) |
610 return; | 654 return; |
611 | 655 |
612 RendererWebIDBCursorImpl* cursor = | 656 RendererWebIDBCursorImpl* cursor = |
613 new RendererWebIDBCursorImpl(ipc_object_id); | 657 new RendererWebIDBCursorImpl(ipc_object_id); |
614 cursors_[ipc_object_id] = cursor; | 658 cursors_[ipc_object_id] = cursor; |
615 callbacks->onSuccess(cursor, key, primary_key, | 659 callbacks->onSuccess(cursor, key, primary_key, |
616 WebSerializedScriptValue(value)); | 660 WebSerializedScriptValue(value)); |
617 | 661 |
618 pending_callbacks_.Remove(ipc_response_id); | 662 pending_callbacks_.Remove(ipc_response_id); |
619 } | 663 } |
620 | 664 |
621 void IndexedDBDispatcher::OnSuccessCursorContinue( | 665 void IndexedDBDispatcher::OnSuccessOpenCursor( |
622 const IndexedDBMsg_CallbacksSuccessCursorContinue_Params& p) { | 666 const IndexedDBMsg_CallbacksSuccessIDBCursor_Params& p) { |
| 667 DCHECK_EQ(p.ipc_thread_id, CurrentWorkerId()); |
| 668 int32 ipc_response_id = p.ipc_response_id; |
| 669 int32 ipc_object_id = p.ipc_cursor_id; |
| 670 const IndexedDBKey& key = p.key; |
| 671 const IndexedDBKey& primary_key = p.primary_key; |
| 672 WebData value; |
| 673 if (p.value.size()) |
| 674 value.assign(&p.value.front(), p.value.size()); |
| 675 |
| 676 WebIDBCallbacks* callbacks = |
| 677 pending_callbacks_.Lookup(ipc_response_id); |
| 678 if (!callbacks) |
| 679 return; |
| 680 |
| 681 RendererWebIDBCursorImpl* cursor = |
| 682 new RendererWebIDBCursorImpl(ipc_object_id); |
| 683 cursors_[ipc_object_id] = cursor; |
| 684 callbacks->onSuccess(cursor, key, primary_key, value); |
| 685 |
| 686 pending_callbacks_.Remove(ipc_response_id); |
| 687 } |
| 688 |
| 689 void IndexedDBDispatcher::OnSuccessCursorContinueOld( |
| 690 const IndexedDBMsg_CallbacksSuccessCursorContinueOld_Params& p) { |
623 DCHECK_EQ(p.ipc_thread_id, CurrentWorkerId()); | 691 DCHECK_EQ(p.ipc_thread_id, CurrentWorkerId()); |
624 int32 ipc_response_id = p.ipc_response_id; | 692 int32 ipc_response_id = p.ipc_response_id; |
625 int32 ipc_cursor_id = p.ipc_cursor_id; | 693 int32 ipc_cursor_id = p.ipc_cursor_id; |
626 const IndexedDBKey& key = p.key; | 694 const IndexedDBKey& key = p.key; |
627 const IndexedDBKey& primary_key = p.primary_key; | 695 const IndexedDBKey& primary_key = p.primary_key; |
628 const SerializedScriptValue& value = p.serialized_value; | 696 const SerializedScriptValue& value = p.serialized_value; |
629 | 697 |
630 RendererWebIDBCursorImpl* cursor = cursors_[ipc_cursor_id]; | 698 RendererWebIDBCursorImpl* cursor = cursors_[ipc_cursor_id]; |
631 DCHECK(cursor); | 699 DCHECK(cursor); |
632 | 700 |
633 WebIDBCallbacks* callbacks = pending_callbacks_.Lookup(ipc_response_id); | 701 WebIDBCallbacks* callbacks = pending_callbacks_.Lookup(ipc_response_id); |
634 if (!callbacks) | 702 if (!callbacks) |
635 return; | 703 return; |
636 | 704 |
637 callbacks->onSuccess(key, primary_key, | 705 callbacks->onSuccess(key, primary_key, |
638 WebSerializedScriptValue(value)); | 706 WebSerializedScriptValue(value)); |
639 | 707 |
640 pending_callbacks_.Remove(ipc_response_id); | 708 pending_callbacks_.Remove(ipc_response_id); |
641 } | 709 } |
642 | 710 |
| 711 void IndexedDBDispatcher::OnSuccessCursorContinue( |
| 712 const IndexedDBMsg_CallbacksSuccessCursorContinue_Params& p) { |
| 713 DCHECK_EQ(p.ipc_thread_id, CurrentWorkerId()); |
| 714 int32 ipc_response_id = p.ipc_response_id; |
| 715 int32 ipc_cursor_id = p.ipc_cursor_id; |
| 716 const IndexedDBKey& key = p.key; |
| 717 const IndexedDBKey& primary_key = p.primary_key; |
| 718 const std::vector<char>& value = p.value; |
| 719 |
| 720 RendererWebIDBCursorImpl* cursor = cursors_[ipc_cursor_id]; |
| 721 DCHECK(cursor); |
| 722 |
| 723 WebIDBCallbacks* callbacks = pending_callbacks_.Lookup(ipc_response_id); |
| 724 if (!callbacks) |
| 725 return; |
| 726 |
| 727 callbacks->onSuccess(key, primary_key, value); |
| 728 |
| 729 pending_callbacks_.Remove(ipc_response_id); |
| 730 } |
| 731 |
| 732 void IndexedDBDispatcher::OnSuccessCursorPrefetchOld( |
| 733 const IndexedDBMsg_CallbacksSuccessCursorPrefetchOld_Params& p) { |
| 734 DCHECK_EQ(p.ipc_thread_id, CurrentWorkerId()); |
| 735 int32 ipc_response_id = p.ipc_response_id; |
| 736 int32 ipc_cursor_id = p.ipc_cursor_id; |
| 737 const std::vector<IndexedDBKey>& keys = p.keys; |
| 738 const std::vector<IndexedDBKey>& primary_keys = p.primary_keys; |
| 739 const std::vector<SerializedScriptValue>& values = p.values; |
| 740 RendererWebIDBCursorImpl* cursor = cursors_[ipc_cursor_id]; |
| 741 DCHECK(cursor); |
| 742 cursor->SetPrefetchDataOld(keys, primary_keys, values); |
| 743 |
| 744 WebIDBCallbacks* callbacks = pending_callbacks_.Lookup(ipc_response_id); |
| 745 DCHECK(callbacks); |
| 746 cursor->CachedContinue(callbacks); |
| 747 pending_callbacks_.Remove(ipc_response_id); |
| 748 } |
| 749 |
643 void IndexedDBDispatcher::OnSuccessCursorPrefetch( | 750 void IndexedDBDispatcher::OnSuccessCursorPrefetch( |
644 const IndexedDBMsg_CallbacksSuccessCursorPrefetch_Params& p) { | 751 const IndexedDBMsg_CallbacksSuccessCursorPrefetch_Params& p) { |
645 DCHECK_EQ(p.ipc_thread_id, CurrentWorkerId()); | 752 DCHECK_EQ(p.ipc_thread_id, CurrentWorkerId()); |
646 int32 ipc_response_id = p.ipc_response_id; | 753 int32 ipc_response_id = p.ipc_response_id; |
647 int32 ipc_cursor_id = p.ipc_cursor_id; | 754 int32 ipc_cursor_id = p.ipc_cursor_id; |
648 const std::vector<IndexedDBKey>& keys = p.keys; | 755 const std::vector<IndexedDBKey>& keys = p.keys; |
649 const std::vector<IndexedDBKey>& primary_keys = p.primary_keys; | 756 const std::vector<IndexedDBKey>& primary_keys = p.primary_keys; |
650 const std::vector<SerializedScriptValue>& values = p.values; | 757 std::vector<WebData> values(p.values.size()); |
| 758 for (size_t i = 0; i < p.values.size(); ++i) { |
| 759 if (p.values[i].size()) |
| 760 values[i].assign(&p.values[i].front(), p.values[i].size()); |
| 761 } |
651 RendererWebIDBCursorImpl* cursor = cursors_[ipc_cursor_id]; | 762 RendererWebIDBCursorImpl* cursor = cursors_[ipc_cursor_id]; |
652 DCHECK(cursor); | 763 DCHECK(cursor); |
653 cursor->SetPrefetchData(keys, primary_keys, values); | 764 cursor->SetPrefetchData(keys, primary_keys, values); |
654 | 765 |
655 WebIDBCallbacks* callbacks = pending_callbacks_.Lookup(ipc_response_id); | 766 WebIDBCallbacks* callbacks = pending_callbacks_.Lookup(ipc_response_id); |
656 DCHECK(callbacks); | 767 DCHECK(callbacks); |
657 cursor->CachedContinue(callbacks); | 768 cursor->CachedContinue(callbacks); |
658 pending_callbacks_.Remove(ipc_response_id); | 769 pending_callbacks_.Remove(ipc_response_id); |
659 } | 770 } |
660 | 771 |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
759 int32 ipc_exception_cursor_id) { | 870 int32 ipc_exception_cursor_id) { |
760 typedef std::map<int32, RendererWebIDBCursorImpl*>::iterator Iterator; | 871 typedef std::map<int32, RendererWebIDBCursorImpl*>::iterator Iterator; |
761 for (Iterator i = cursors_.begin(); i != cursors_.end(); ++i) { | 872 for (Iterator i = cursors_.begin(); i != cursors_.end(); ++i) { |
762 if (i->first == ipc_exception_cursor_id) | 873 if (i->first == ipc_exception_cursor_id) |
763 continue; | 874 continue; |
764 i->second->ResetPrefetchCache(); | 875 i->second->ResetPrefetchCache(); |
765 } | 876 } |
766 } | 877 } |
767 | 878 |
768 } // namespace content | 879 } // namespace content |
OLD | NEW |