OLD | NEW |
---|---|
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 23 matching lines...) Expand all Loading... | |
34 content::SerializedScriptValue(idb_object->value()))); | 34 content::SerializedScriptValue(idb_object->value()))); |
35 } | 35 } |
36 | 36 |
37 void IndexedDBCallbacks<WebKit::WebIDBCursor>::onSuccess( | 37 void IndexedDBCallbacks<WebKit::WebIDBCursor>::onSuccess( |
38 const WebKit::WebSerializedScriptValue& value) { | 38 const WebKit::WebSerializedScriptValue& value) { |
39 dispatcher_host()->Send( | 39 dispatcher_host()->Send( |
40 new IndexedDBMsg_CallbacksSuccessSerializedScriptValue( | 40 new IndexedDBMsg_CallbacksSuccessSerializedScriptValue( |
41 response_id(), content::SerializedScriptValue(value))); | 41 response_id(), content::SerializedScriptValue(value))); |
42 } | 42 } |
43 | 43 |
44 void IndexedDBCallbacks<WebKit::WebIDBCursor>::onSuccessCursorContinue() { | |
michaeln
2011/10/30 21:54:06
Would it make sense to pass the WebIDBCursor as a
hans
2011/10/31 16:11:52
Can't change the function's signature since it's a
| |
45 int32 cursor_id = dispatcher_host()->GetAndConsumeCursorIdForPendingContinue( | |
46 response_id()); | |
47 WebKit::WebIDBCursor* idb_cursor = dispatcher_host()->getCursorFromId( | |
48 cursor_id); | |
49 | |
michaeln
2011/10/30 21:54:06
What ensures that the idb_cursor isn't deleted bet
hans
2011/10/31 16:11:52
It's not synchronous.
It's actually the idb_curso
michaeln
2011/10/31 18:58:25
That comment isn't so reassuring since there are n
| |
50 dispatcher_host()->Send( | |
51 new IndexedDBMsg_CallbacksSuccessCursorContinue( | |
52 response_id(), | |
53 IndexedDBKey(idb_cursor->key()), | |
54 IndexedDBKey(idb_cursor->primaryKey()), | |
55 content::SerializedScriptValue(idb_cursor->value()))); | |
56 } | |
57 | |
44 void IndexedDBCallbacks<WebKit::WebIDBKey>::onSuccess( | 58 void IndexedDBCallbacks<WebKit::WebIDBKey>::onSuccess( |
45 const WebKit::WebIDBKey& value) { | 59 const WebKit::WebIDBKey& value) { |
46 dispatcher_host()->Send( | 60 dispatcher_host()->Send( |
47 new IndexedDBMsg_CallbacksSuccessIndexedDBKey( | 61 new IndexedDBMsg_CallbacksSuccessIndexedDBKey( |
48 response_id(), IndexedDBKey(value))); | 62 response_id(), IndexedDBKey(value))); |
49 } | 63 } |
50 | 64 |
51 void IndexedDBCallbacks<WebKit::WebDOMStringList>::onSuccess( | 65 void IndexedDBCallbacks<WebKit::WebDOMStringList>::onSuccess( |
52 const WebKit::WebDOMStringList& value) { | 66 const WebKit::WebDOMStringList& value) { |
53 | 67 |
54 std::vector<string16> list; | 68 std::vector<string16> list; |
55 for (unsigned i = 0; i < value.length(); ++i) | 69 for (unsigned i = 0; i < value.length(); ++i) |
56 list.push_back(value.item(i)); | 70 list.push_back(value.item(i)); |
57 | 71 |
58 dispatcher_host()->Send( | 72 dispatcher_host()->Send( |
59 new IndexedDBMsg_CallbacksSuccessStringList( | 73 new IndexedDBMsg_CallbacksSuccessStringList( |
60 response_id(), list)); | 74 response_id(), list)); |
61 } | 75 } |
62 | 76 |
63 void IndexedDBCallbacks<WebKit::WebSerializedScriptValue>::onSuccess( | 77 void IndexedDBCallbacks<WebKit::WebSerializedScriptValue>::onSuccess( |
64 const WebKit::WebSerializedScriptValue& value) { | 78 const WebKit::WebSerializedScriptValue& value) { |
65 dispatcher_host()->Send( | 79 dispatcher_host()->Send( |
66 new IndexedDBMsg_CallbacksSuccessSerializedScriptValue( | 80 new IndexedDBMsg_CallbacksSuccessSerializedScriptValue( |
67 response_id(), content::SerializedScriptValue(value))); | 81 response_id(), content::SerializedScriptValue(value))); |
68 } | 82 } |
OLD | NEW |