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/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/indexed_db_messages.h" | 7 #include "content/common/indexed_db/indexed_db_messages.h" |
8 #include "webkit/quota/quota_manager.h" | 8 #include "webkit/quota/quota_manager.h" |
9 | 9 |
10 using content::IndexedDBKey; | 10 using content::IndexedDBKey; |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 object_id = dispatcher_host()->Add(idb_object, thread_id(), origin_url_); | 76 object_id = dispatcher_host()->Add(idb_object, thread_id(), origin_url_); |
77 } else { | 77 } else { |
78 // We already have this database and don't need a new copy of it. | 78 // We already have this database and don't need a new copy of it. |
79 delete idb_object; | 79 delete idb_object; |
80 } | 80 } |
81 dispatcher_host()->Send( | 81 dispatcher_host()->Send( |
82 new IndexedDBMsg_CallbacksSuccessIDBDatabase(thread_id(), response_id(), | 82 new IndexedDBMsg_CallbacksSuccessIDBDatabase(thread_id(), response_id(), |
83 object_id)); | 83 object_id)); |
84 } | 84 } |
85 | 85 |
| 86 void IndexedDBCallbacksDatabase::onSuccess() { |
| 87 dispatcher_host()->Send( |
| 88 new IndexedDBMsg_CallbacksSuccessIDBDatabaseDeleted( |
| 89 thread_id(), response_id(), database_id_)); |
| 90 } |
| 91 |
86 void IndexedDBCallbacksDatabase::onUpgradeNeeded( | 92 void IndexedDBCallbacksDatabase::onUpgradeNeeded( |
87 long long old_version, | 93 long long old_version, |
88 WebKit::WebIDBTransaction* transaction, | 94 WebKit::WebIDBTransaction* transaction, |
89 WebKit::WebIDBDatabase* database) { | 95 WebKit::WebIDBDatabase* database) { |
90 int32 transaction_id = dispatcher_host()->Add(transaction, thread_id(), | 96 int32 transaction_id = dispatcher_host()->Add(transaction, thread_id(), |
91 origin_url_); | 97 origin_url_); |
92 int32 database_id = dispatcher_host()->Add(database, thread_id(), | 98 int32 database_id = dispatcher_host()->Add(database, thread_id(), |
93 origin_url_); | 99 origin_url_); |
94 database_id_ = database_id; | 100 database_id_ = database_id; |
95 dispatcher_host()->Send( | 101 dispatcher_host()->Send( |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 | 204 |
199 void IndexedDBCallbacks<WebKit::WebSerializedScriptValue>::onSuccess( | 205 void IndexedDBCallbacks<WebKit::WebSerializedScriptValue>::onSuccess( |
200 const WebKit::WebSerializedScriptValue& value, | 206 const WebKit::WebSerializedScriptValue& value, |
201 const WebKit::WebIDBKey& primaryKey, | 207 const WebKit::WebIDBKey& primaryKey, |
202 const WebKit::WebIDBKeyPath& keyPath) { | 208 const WebKit::WebIDBKeyPath& keyPath) { |
203 dispatcher_host()->Send( | 209 dispatcher_host()->Send( |
204 new IndexedDBMsg_CallbacksSuccessSerializedScriptValueWithKey( | 210 new IndexedDBMsg_CallbacksSuccessSerializedScriptValueWithKey( |
205 thread_id(), response_id(), SerializedScriptValue(value), | 211 thread_id(), response_id(), SerializedScriptValue(value), |
206 IndexedDBKey(primaryKey), IndexedDBKeyPath(keyPath))); | 212 IndexedDBKey(primaryKey), IndexedDBKeyPath(keyPath))); |
207 } | 213 } |
| 214 |
| 215 void IndexedDBCallbacks<WebKit::WebSerializedScriptValue>::onSuccess( |
| 216 long long value) { |
| 217 dispatcher_host()->Send( |
| 218 new IndexedDBMsg_CallbacksSuccessInteger(thread_id(), |
| 219 response_id(), |
| 220 value)); |
| 221 } |
| 222 |
| 223 void IndexedDBCallbacks<WebKit::WebSerializedScriptValue>::onSuccess() { |
| 224 dispatcher_host()->Send( |
| 225 new IndexedDBMsg_CallbacksSuccessUndefined(thread_id(), |
| 226 response_id())); |
| 227 } |
OLD | NEW |