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

Side by Side Diff: content/browser/in_process_webkit/indexed_db_callbacks.cc

Issue 8662017: IndexedDB: Cursor pre-fetching. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix indentation Created 9 years 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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_callbacks.h" 5 #include "content/browser/in_process_webkit/indexed_db_callbacks.h"
6 6
7 #include "content/common/indexed_db_messages.h" 7 #include "content/common/indexed_db_messages.h"
8 #include "webkit/quota/quota_manager.h" 8 #include "webkit/quota/quota_manager.h"
9 9
10 IndexedDBCallbacksBase::IndexedDBCallbacksBase( 10 IndexedDBCallbacksBase::IndexedDBCallbacksBase(
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 52
53 dispatcher_host()->Send( 53 dispatcher_host()->Send(
54 new IndexedDBMsg_CallbacksSuccessCursorContinue( 54 new IndexedDBMsg_CallbacksSuccessCursorContinue(
55 response_id(), 55 response_id(),
56 cursor_id_, 56 cursor_id_,
57 IndexedDBKey(idb_cursor->key()), 57 IndexedDBKey(idb_cursor->key()),
58 IndexedDBKey(idb_cursor->primaryKey()), 58 IndexedDBKey(idb_cursor->primaryKey()),
59 content::SerializedScriptValue(idb_cursor->value()))); 59 content::SerializedScriptValue(idb_cursor->value())));
60 } 60 }
61 61
62 void IndexedDBCallbacks<WebKit::WebIDBCursor>::onSuccessWithPrefetch(
63 const WebKit::WebVector<WebKit::WebIDBKey>& keys,
64 const WebKit::WebVector<WebKit::WebIDBKey>& primaryKeys,
65 const WebKit::WebVector<WebKit::WebSerializedScriptValue>& values) {
66 DCHECK(cursor_id_ != -1);
67
68 std::vector<IndexedDBKey> msgKeys;
69 std::vector<IndexedDBKey> msgPrimaryKeys;
70 std::vector<content::SerializedScriptValue> msgValues;
71
72 for (size_t i = 0; i < keys.size(); ++i) {
73 msgKeys.push_back(IndexedDBKey(keys[i]));
74 msgPrimaryKeys.push_back(IndexedDBKey(primaryKeys[i]));
75 msgValues.push_back(content::SerializedScriptValue(values[i]));
76 }
77
78 dispatcher_host()->Send(
79 new IndexedDBMsg_CallbacksSuccessCursorPrefetch(
80 response_id(),
81 cursor_id_,
82 msgKeys,
83 msgPrimaryKeys,
84 msgValues));
85 }
86
62 void IndexedDBCallbacks<WebKit::WebIDBKey>::onSuccess( 87 void IndexedDBCallbacks<WebKit::WebIDBKey>::onSuccess(
63 const WebKit::WebIDBKey& value) { 88 const WebKit::WebIDBKey& value) {
64 dispatcher_host()->Send( 89 dispatcher_host()->Send(
65 new IndexedDBMsg_CallbacksSuccessIndexedDBKey( 90 new IndexedDBMsg_CallbacksSuccessIndexedDBKey(
66 response_id(), IndexedDBKey(value))); 91 response_id(), IndexedDBKey(value)));
67 } 92 }
68 93
69 void IndexedDBCallbacks<WebKit::WebDOMStringList>::onSuccess( 94 void IndexedDBCallbacks<WebKit::WebDOMStringList>::onSuccess(
70 const WebKit::WebDOMStringList& value) { 95 const WebKit::WebDOMStringList& value) {
71 96
72 std::vector<string16> list; 97 std::vector<string16> list;
73 for (unsigned i = 0; i < value.length(); ++i) 98 for (unsigned i = 0; i < value.length(); ++i)
74 list.push_back(value.item(i)); 99 list.push_back(value.item(i));
75 100
76 dispatcher_host()->Send( 101 dispatcher_host()->Send(
77 new IndexedDBMsg_CallbacksSuccessStringList( 102 new IndexedDBMsg_CallbacksSuccessStringList(
78 response_id(), list)); 103 response_id(), list));
79 } 104 }
80 105
81 void IndexedDBCallbacks<WebKit::WebSerializedScriptValue>::onSuccess( 106 void IndexedDBCallbacks<WebKit::WebSerializedScriptValue>::onSuccess(
82 const WebKit::WebSerializedScriptValue& value) { 107 const WebKit::WebSerializedScriptValue& value) {
83 dispatcher_host()->Send( 108 dispatcher_host()->Send(
84 new IndexedDBMsg_CallbacksSuccessSerializedScriptValue( 109 new IndexedDBMsg_CallbacksSuccessSerializedScriptValue(
85 response_id(), content::SerializedScriptValue(value))); 110 response_id(), content::SerializedScriptValue(value)));
86 } 111 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698