| 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
" |
| 14 | 15 |
| 15 class IndexedDBKey; | 16 class IndexedDBKey; |
| 16 class SerializedScriptValue; | 17 class SerializedScriptValue; |
| 17 | 18 |
| 18 namespace WebKit { | 19 namespace WebKit { |
| 19 class WebFrame; | 20 class WebFrame; |
| 20 } | 21 } |
| 21 | 22 |
| 22 // Handle the indexed db related communication for this entire renderer. | 23 // Handle the indexed db related communication for this entire renderer. |
| 23 class IndexedDBDispatcher { | 24 class IndexedDBDispatcher { |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 int32 idb_object_store_id); | 58 int32 idb_object_store_id); |
| 58 | 59 |
| 59 void RequestIDBObjectStoreCreateIndex( | 60 void RequestIDBObjectStoreCreateIndex( |
| 60 const string16& name, const NullableString16& key_path, bool unique, | 61 const string16& name, const NullableString16& key_path, bool unique, |
| 61 WebKit::WebIDBCallbacks* callbacks, int32 idb_object_store_id); | 62 WebKit::WebIDBCallbacks* callbacks, int32 idb_object_store_id); |
| 62 | 63 |
| 63 void RequestIDBObjectStoreRemoveIndex( | 64 void RequestIDBObjectStoreRemoveIndex( |
| 64 const string16& name, WebKit::WebIDBCallbacks* callbacks, | 65 const string16& name, WebKit::WebIDBCallbacks* callbacks, |
| 65 int32 idb_object_store_id); | 66 int32 idb_object_store_id); |
| 66 | 67 |
| 68 void RequestIDBTransactionSetCallbacks( |
| 69 WebKit::WebIDBTransactionCallbacks* callbacks); |
| 70 |
| 67 private: | 71 private: |
| 68 // IDBCallback message handlers. | 72 // IDBCallback message handlers. |
| 69 void OnSuccessNull(int32 response_id); | 73 void OnSuccessNull(int32 response_id); |
| 70 void OnSuccessIDBDatabase(int32 response_id, int32 object_id); | 74 void OnSuccessIDBDatabase(int32 response_id, int32 object_id); |
| 71 void OnSuccessIndexedDBKey(int32 response_id, const IndexedDBKey& key); | 75 void OnSuccessIndexedDBKey(int32 response_id, const IndexedDBKey& key); |
| 72 void OnSuccessIDBObjectStore(int32 response_id, int32 object_id); | 76 void OnSuccessIDBObjectStore(int32 response_id, int32 object_id); |
| 73 void OnSuccessIDBIndex(int32 response_id, int32 object_id); | 77 void OnSuccessIDBIndex(int32 response_id, int32 object_id); |
| 74 void OnSuccessSerializedScriptValue(int32 response_id, | 78 void OnSuccessSerializedScriptValue(int32 response_id, |
| 75 const SerializedScriptValue& value); | 79 const SerializedScriptValue& value); |
| 76 void OnError(int32 response_id, int code, const string16& message); | 80 void OnError(int32 response_id, int code, const string16& message); |
| 81 void OnAbort(int transaction_id); |
| 77 | 82 |
| 78 // Careful! WebIDBCallbacks wraps non-threadsafe data types. It must be | 83 // Careful! WebIDBCallbacks wraps non-threadsafe data types. It must be |
| 79 // destroyed and used on the same thread it was created on. | 84 // destroyed and used on the same thread it was created on. |
| 80 IDMap<WebKit::WebIDBCallbacks, IDMapOwnPointer> pending_callbacks_; | 85 IDMap<WebKit::WebIDBCallbacks, IDMapOwnPointer> pending_callbacks_; |
| 86 IDMap<WebKit::WebIDBTransactionCallbacks, IDMapOwnPointer> |
| 87 pending_transaction_callbacks_; |
| 81 | 88 |
| 82 DISALLOW_COPY_AND_ASSIGN(IndexedDBDispatcher); | 89 DISALLOW_COPY_AND_ASSIGN(IndexedDBDispatcher); |
| 83 }; | 90 }; |
| 84 | 91 |
| 85 #endif // CHROME_RENDERER_INDEXED_DB_DISPATCHER_H_ | 92 #endif // CHROME_RENDERER_INDEXED_DB_DISPATCHER_H_ |
| OLD | NEW |