OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #ifndef CHROME_RENDERER_INDEXED_DB_DISPATCHER_H_ | 5 #ifndef CHROME_RENDERER_INDEXED_DB_DISPATCHER_H_ |
6 #define CHROME_RENDERER_INDEXED_DB_DISPATCHER_H_ | 6 #define CHROME_RENDERER_INDEXED_DB_DISPATCHER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/id_map.h" | 9 #include "base/id_map.h" |
10 #include "base/nullable_string16.h" | 10 #include "base/nullable_string16.h" |
11 #include "ipc/ipc_message.h" | 11 #include "ipc/ipc_message.h" |
12 #include "third_party/WebKit/WebKit/chromium/public/WebIDBCallbacks.h" | 12 #include "third_party/WebKit/WebKit/chromium/public/WebIDBCallbacks.h" |
13 #include "third_party/WebKit/WebKit/chromium/public/WebIDBDatabase.h" | 13 #include "third_party/WebKit/WebKit/chromium/public/WebIDBDatabase.h" |
14 #include "third_party/WebKit/WebKit/chromium/public/WebIDBTransactionCallbacks.h
" | |
15 | 14 |
16 class IndexedDBKey; | 15 class IndexedDBKey; |
17 class SerializedScriptValue; | 16 class SerializedScriptValue; |
18 | 17 |
19 namespace WebKit { | 18 namespace WebKit { |
20 class WebFrame; | 19 class WebFrame; |
21 class WebIDBKeyRange; | 20 class WebIDBKeyRange; |
22 } | 21 } |
23 | 22 |
24 // Handle the indexed db related communication for this entire renderer. | 23 // Handle the indexed db related communication for this entire renderer. |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 WebKit::WebIDBCallbacks* callbacks, int32 idb_object_store_id); | 62 WebKit::WebIDBCallbacks* callbacks, int32 idb_object_store_id); |
64 | 63 |
65 void RequestIDBObjectStoreRemoveIndex( | 64 void RequestIDBObjectStoreRemoveIndex( |
66 const string16& name, WebKit::WebIDBCallbacks* callbacks, | 65 const string16& name, WebKit::WebIDBCallbacks* callbacks, |
67 int32 idb_object_store_id); | 66 int32 idb_object_store_id); |
68 | 67 |
69 void RequestIDBObjectStoreOpenCursor( | 68 void RequestIDBObjectStoreOpenCursor( |
70 const WebKit::WebIDBKeyRange& idb_key_range, unsigned short direction, | 69 const WebKit::WebIDBKeyRange& idb_key_range, unsigned short direction, |
71 WebKit::WebIDBCallbacks* callbacks, int32 idb_object_store_id); | 70 WebKit::WebIDBCallbacks* callbacks, int32 idb_object_store_id); |
72 | 71 |
73 void RequestIDBTransactionSetCallbacks( | |
74 WebKit::WebIDBTransactionCallbacks* callbacks); | |
75 | |
76 private: | 72 private: |
77 // IDBCallback message handlers. | 73 // IDBCallback message handlers. |
78 void OnSuccessNull(int32 response_id); | 74 void OnSuccessNull(int32 response_id); |
79 void OnSuccessIDBDatabase(int32 response_id, int32 object_id); | 75 void OnSuccessIDBDatabase(int32 response_id, int32 object_id); |
80 void OnSuccessIndexedDBKey(int32 response_id, const IndexedDBKey& key); | 76 void OnSuccessIndexedDBKey(int32 response_id, const IndexedDBKey& key); |
81 void OnSuccessIDBObjectStore(int32 response_id, int32 object_id); | 77 void OnSuccessIDBObjectStore(int32 response_id, int32 object_id); |
82 void OnSuccessIDBIndex(int32 response_id, int32 object_id); | 78 void OnSuccessIDBIndex(int32 response_id, int32 object_id); |
83 void OnSuccessOpenCursor(int32 response_id, int32 object_id); | 79 void OnSuccessOpenCursor(int32 response_id, int32 object_id); |
84 void OnSuccessSerializedScriptValue(int32 response_id, | 80 void OnSuccessSerializedScriptValue(int32 response_id, |
85 const SerializedScriptValue& value); | 81 const SerializedScriptValue& value); |
86 void OnError(int32 response_id, int code, const string16& message); | 82 void OnError(int32 response_id, int code, const string16& message); |
87 void OnAbort(int transaction_id); | |
88 | 83 |
89 // Careful! WebIDBCallbacks wraps non-threadsafe data types. It must be | 84 // Careful! WebIDBCallbacks wraps non-threadsafe data types. It must be |
90 // destroyed and used on the same thread it was created on. | 85 // destroyed and used on the same thread it was created on. |
91 IDMap<WebKit::WebIDBCallbacks, IDMapOwnPointer> pending_callbacks_; | 86 IDMap<WebKit::WebIDBCallbacks, IDMapOwnPointer> pending_callbacks_; |
92 IDMap<WebKit::WebIDBTransactionCallbacks, IDMapOwnPointer> | |
93 pending_transaction_callbacks_; | |
94 | 87 |
95 DISALLOW_COPY_AND_ASSIGN(IndexedDBDispatcher); | 88 DISALLOW_COPY_AND_ASSIGN(IndexedDBDispatcher); |
96 }; | 89 }; |
97 | 90 |
98 #endif // CHROME_RENDERER_INDEXED_DB_DISPATCHER_H_ | 91 #endif // CHROME_RENDERER_INDEXED_DB_DISPATCHER_H_ |
OLD | NEW |