Chromium Code Reviews| 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() { | |
| 45 DCHECK(cursor_id_ != -1); | |
| 46 WebKit::WebIDBCursor* idb_cursor = dispatcher_host()->getCursorFromId( | |
| 47 cursor_id_); | |
| 48 | |
|
michaeln
2011/10/31 18:58:25
should we be more defensive here...
DCHECK(idb_cu
hans
2011/11/01 14:57:45
Yes, let's do this.
| |
| 49 dispatcher_host()->Send( | |
| 50 new IndexedDBMsg_CallbacksSuccessCursorContinue( | |
| 51 response_id(), | |
| 52 cursor_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 |