| 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 | 7 |
| 8 #include "base/id_map.h" | 8 #include "base/id_map.h" |
| 9 #include "base/string16.h" | 9 #include "base/string16.h" |
| 10 #include "ipc/ipc_message.h" | 10 #include "ipc/ipc_message.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 | 23 |
| 24 // Called to possibly handle the incoming IPC message. Returns true if | 24 // Called to possibly handle the incoming IPC message. Returns true if |
| 25 // handled. | 25 // handled. |
| 26 bool OnMessageReceived(const IPC::Message& msg); | 26 bool OnMessageReceived(const IPC::Message& msg); |
| 27 | 27 |
| 28 void RequestIndexedDatabaseOpen( | 28 void RequestIndexedDatabaseOpen( |
| 29 const string16& name, const string16& description, | 29 const string16& name, const string16& description, |
| 30 WebKit::WebIDBCallbacks* callbacks, const string16& origin, | 30 WebKit::WebIDBCallbacks* callbacks, const string16& origin, |
| 31 WebKit::WebFrame* web_frame); | 31 WebKit::WebFrame* web_frame); |
| 32 | 32 |
| 33 void RequestIDBDatabaseCreateObjectStore( |
| 34 const string16& name, const string16& keypath, bool auto_increment, |
| 35 WebKit::WebIDBCallbacks* callbacks, int32 idb_database_id); |
| 36 |
| 33 private: | 37 private: |
| 34 // Message handlers. For each message we send, we need to handle both the | 38 // Message handlers. For each message we send, we need to handle both the |
| 35 // success and the error case. | 39 // success and the error case. |
| 36 void OnIndexedDatabaseOpenSuccess(int32 response_id, | 40 void OnIndexedDatabaseOpenSuccess(int32 response_id, |
| 37 int32 idb_database_id); | 41 int32 idb_database_id); |
| 38 void OnIndexedDatabaseOpenError(int32 response_id, int code, | 42 void OnIndexedDatabaseOpenError(int32 response_id, int code, |
| 39 const string16& message); | 43 const string16& message); |
| 44 void OnIDBDatabaseCreateObjectStoreSuccess(int32 response_id, |
| 45 int32 idb_object_store_id); |
| 46 void OnIDBDatabaseCreateObjectStoreError(int32 response_id, int code, |
| 47 const string16& message); |
| 40 | 48 |
| 41 // Careful! WebIDBCallbacks wraps non-threadsafe data types. It must be | 49 // Careful! WebIDBCallbacks wraps non-threadsafe data types. It must be |
| 42 // destroyed and used on the same thread it was created on. | 50 // destroyed and used on the same thread it was created on. |
| 43 IDMap<WebKit::WebIDBCallbacks, IDMapOwnPointer> | 51 IDMap<WebKit::WebIDBCallbacks, IDMapOwnPointer> |
| 44 indexed_database_open_callbacks_; | 52 indexed_database_open_callbacks_; |
| 53 IDMap<WebKit::WebIDBCallbacks, IDMapOwnPointer> |
| 54 idb_database_create_object_store_callbacks_; |
| 45 | 55 |
| 46 DISALLOW_COPY_AND_ASSIGN(IndexedDBDispatcher); | 56 DISALLOW_COPY_AND_ASSIGN(IndexedDBDispatcher); |
| 47 }; | 57 }; |
| 48 | 58 |
| 49 #endif // CHROME_RENDERER_INDEXED_DB_DISPATCHER_H_ | 59 #endif // CHROME_RENDERER_INDEXED_DB_DISPATCHER_H_ |
| OLD | NEW |