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/indexed_db/indexed_db_callbacks.h" | 5 #include "content/browser/indexed_db/indexed_db_callbacks.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
| 10 #include "content/browser/indexed_db/indexed_db_database_error.h" |
10 #include "content/browser/indexed_db/indexed_db_metadata.h" | 11 #include "content/browser/indexed_db/indexed_db_metadata.h" |
11 #include "content/browser/indexed_db/webidbdatabase_impl.h" | 12 #include "content/browser/indexed_db/webidbdatabase_impl.h" |
12 #include "content/common/indexed_db/indexed_db_messages.h" | 13 #include "content/common/indexed_db/indexed_db_messages.h" |
13 #include "webkit/browser/quota/quota_manager.h" | 14 #include "webkit/browser/quota/quota_manager.h" |
14 | 15 |
15 using WebKit::WebData; | |
16 using WebKit::WebIDBCallbacks; | 16 using WebKit::WebIDBCallbacks; |
17 using WebKit::WebString; | |
18 | 17 |
19 namespace content { | 18 namespace content { |
20 | 19 |
21 namespace { | 20 namespace { |
22 const int32 kDatabaseNotAdded = -1; | 21 const int32 kDatabaseNotAdded = -1; |
23 } | 22 } |
24 | 23 |
25 IndexedDBCallbacksBase::IndexedDBCallbacksBase( | 24 IndexedDBCallbacksBase::IndexedDBCallbacksBase( |
26 IndexedDBDispatcherHost* dispatcher_host, | 25 IndexedDBDispatcherHost* dispatcher_host, |
27 int32 ipc_thread_id, | 26 int32 ipc_thread_id, |
28 int32 ipc_callbacks_id) | 27 int32 ipc_callbacks_id) |
29 : dispatcher_host_(dispatcher_host), | 28 : dispatcher_host_(dispatcher_host), |
30 ipc_callbacks_id_(ipc_callbacks_id), | 29 ipc_callbacks_id_(ipc_callbacks_id), |
31 ipc_thread_id_(ipc_thread_id) {} | 30 ipc_thread_id_(ipc_thread_id) {} |
32 | 31 |
33 IndexedDBCallbacksBase::~IndexedDBCallbacksBase() {} | 32 IndexedDBCallbacksBase::~IndexedDBCallbacksBase() {} |
34 | 33 |
35 void IndexedDBCallbacksBase::onError(const WebKit::WebIDBDatabaseError& error) { | 34 void IndexedDBCallbacksBase::onError(const IndexedDBDatabaseError& error) { |
36 dispatcher_host_->Send(new IndexedDBMsg_CallbacksError( | 35 dispatcher_host_->Send(new IndexedDBMsg_CallbacksError( |
37 ipc_thread_id_, ipc_callbacks_id_, error.code(), error.message())); | 36 ipc_thread_id_, ipc_callbacks_id_, error.code(), error.message())); |
38 } | 37 } |
39 | 38 |
40 void IndexedDBCallbacksBase::onBlocked(long long old_version) { | 39 void IndexedDBCallbacksBase::onBlocked(long long old_version) { |
41 dispatcher_host_->Send(new IndexedDBMsg_CallbacksIntBlocked( | 40 dispatcher_host_->Send(new IndexedDBMsg_CallbacksIntBlocked( |
42 ipc_thread_id_, ipc_callbacks_id_, old_version)); | 41 ipc_thread_id_, ipc_callbacks_id_, old_version)); |
43 } | 42 } |
44 | 43 |
45 void IndexedDBCallbacksBase::onSuccess(const std::vector<string16>& value) { | 44 void IndexedDBCallbacksBase::onSuccess(const std::vector<string16>& value) { |
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
287 ipc_thread_id(), ipc_callbacks_id())); | 286 ipc_thread_id(), ipc_callbacks_id())); |
288 } | 287 } |
289 | 288 |
290 void IndexedDBCallbacks<std::vector<char> >::onSuccess( | 289 void IndexedDBCallbacks<std::vector<char> >::onSuccess( |
291 const IndexedDBKey& value) { | 290 const IndexedDBKey& value) { |
292 dispatcher_host()->Send(new IndexedDBMsg_CallbacksSuccessIndexedDBKey( | 291 dispatcher_host()->Send(new IndexedDBMsg_CallbacksSuccessIndexedDBKey( |
293 ipc_thread_id(), ipc_callbacks_id(), value)); | 292 ipc_thread_id(), ipc_callbacks_id(), value)); |
294 } | 293 } |
295 | 294 |
296 } // namespace content | 295 } // namespace content |
OLD | NEW |