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>::onSuccessWithContinuation() { |
| 45 DCHECK(cursor_id_ != -1); |
| 46 WebKit::WebIDBCursor* idb_cursor = dispatcher_host()->GetCursorFromId( |
| 47 cursor_id_); |
| 48 |
| 49 DCHECK(idb_cursor); |
| 50 if (!idb_cursor) |
| 51 return; |
| 52 |
| 53 dispatcher_host()->Send( |
| 54 new IndexedDBMsg_CallbacksSuccessCursorContinue( |
| 55 response_id(), |
| 56 cursor_id_, |
| 57 IndexedDBKey(idb_cursor->key()), |
| 58 IndexedDBKey(idb_cursor->primaryKey()), |
| 59 content::SerializedScriptValue(idb_cursor->value()))); |
| 60 } |
| 61 |
44 void IndexedDBCallbacks<WebKit::WebIDBKey>::onSuccess( | 62 void IndexedDBCallbacks<WebKit::WebIDBKey>::onSuccess( |
45 const WebKit::WebIDBKey& value) { | 63 const WebKit::WebIDBKey& value) { |
46 dispatcher_host()->Send( | 64 dispatcher_host()->Send( |
47 new IndexedDBMsg_CallbacksSuccessIndexedDBKey( | 65 new IndexedDBMsg_CallbacksSuccessIndexedDBKey( |
48 response_id(), IndexedDBKey(value))); | 66 response_id(), IndexedDBKey(value))); |
49 } | 67 } |
50 | 68 |
51 void IndexedDBCallbacks<WebKit::WebDOMStringList>::onSuccess( | 69 void IndexedDBCallbacks<WebKit::WebDOMStringList>::onSuccess( |
52 const WebKit::WebDOMStringList& value) { | 70 const WebKit::WebDOMStringList& value) { |
53 | 71 |
54 std::vector<string16> list; | 72 std::vector<string16> list; |
55 for (unsigned i = 0; i < value.length(); ++i) | 73 for (unsigned i = 0; i < value.length(); ++i) |
56 list.push_back(value.item(i)); | 74 list.push_back(value.item(i)); |
57 | 75 |
58 dispatcher_host()->Send( | 76 dispatcher_host()->Send( |
59 new IndexedDBMsg_CallbacksSuccessStringList( | 77 new IndexedDBMsg_CallbacksSuccessStringList( |
60 response_id(), list)); | 78 response_id(), list)); |
61 } | 79 } |
62 | 80 |
63 void IndexedDBCallbacks<WebKit::WebSerializedScriptValue>::onSuccess( | 81 void IndexedDBCallbacks<WebKit::WebSerializedScriptValue>::onSuccess( |
64 const WebKit::WebSerializedScriptValue& value) { | 82 const WebKit::WebSerializedScriptValue& value) { |
65 dispatcher_host()->Send( | 83 dispatcher_host()->Send( |
66 new IndexedDBMsg_CallbacksSuccessSerializedScriptValue( | 84 new IndexedDBMsg_CallbacksSuccessSerializedScriptValue( |
67 response_id(), content::SerializedScriptValue(value))); | 85 response_id(), content::SerializedScriptValue(value))); |
68 } | 86 } |
OLD | NEW |