| 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 #ifndef CONTENT_BROWSER_IN_PROCESS_WEBKIT_INDEXED_DB_DISPATCHER_HOST_H_ | 5 #ifndef CONTENT_BROWSER_IN_PROCESS_WEBKIT_INDEXED_DB_DISPATCHER_HOST_H_ |
| 6 #define CONTENT_BROWSER_IN_PROCESS_WEBKIT_INDEXED_DB_DISPATCHER_HOST_H_ | 6 #define CONTENT_BROWSER_IN_PROCESS_WEBKIT_INDEXED_DB_DISPATCHER_HOST_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <map> | 9 #include <map> |
| 10 | 10 |
| 11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 12 #include "base/id_map.h" | 12 #include "base/id_map.h" |
| 13 #include "content/public/browser/browser_message_filter.h" | 13 #include "content/public/browser/browser_message_filter.h" |
| 14 #include "third_party/WebKit/Source/WebKit/chromium/public/WebExceptionCode.h" | 14 #include "third_party/WebKit/Source/WebKit/chromium/public/WebExceptionCode.h" |
| 15 | 15 |
| 16 class GURL; | 16 class GURL; |
| 17 class IndexedDBContextImpl; | 17 class IndexedDBContextImpl; |
| 18 class IndexedDBKey; | 18 class IndexedDBKey; |
| 19 class IndexedDBKeyRange; | 19 class IndexedDBKeyRange; |
| 20 class NullableString16; | |
| 21 struct IndexedDBHostMsg_DatabaseCreateObjectStore_Params; | 20 struct IndexedDBHostMsg_DatabaseCreateObjectStore_Params; |
| 22 struct IndexedDBHostMsg_FactoryDeleteDatabase_Params; | 21 struct IndexedDBHostMsg_FactoryDeleteDatabase_Params; |
| 23 struct IndexedDBHostMsg_FactoryGetDatabaseNames_Params; | 22 struct IndexedDBHostMsg_FactoryGetDatabaseNames_Params; |
| 24 struct IndexedDBHostMsg_FactoryOpen_Params; | 23 struct IndexedDBHostMsg_FactoryOpen_Params; |
| 25 struct IndexedDBHostMsg_IndexCount_Params; | 24 struct IndexedDBHostMsg_IndexCount_Params; |
| 26 struct IndexedDBHostMsg_IndexOpenCursor_Params; | 25 struct IndexedDBHostMsg_IndexOpenCursor_Params; |
| 27 struct IndexedDBHostMsg_ObjectStoreCount_Params; | 26 struct IndexedDBHostMsg_ObjectStoreCount_Params; |
| 28 struct IndexedDBHostMsg_ObjectStoreCreateIndex_Params; | 27 struct IndexedDBHostMsg_ObjectStoreCreateIndex_Params; |
| 29 struct IndexedDBHostMsg_ObjectStoreOpenCursor_Params; | 28 struct IndexedDBHostMsg_ObjectStoreOpenCursor_Params; |
| 30 struct IndexedDBHostMsg_ObjectStorePut_Params; | 29 struct IndexedDBHostMsg_ObjectStorePut_Params; |
| 31 | 30 |
| 32 namespace WebKit { | 31 namespace WebKit { |
| 33 class WebDOMStringList; | 32 class WebDOMStringList; |
| 34 class WebIDBCursor; | 33 class WebIDBCursor; |
| 35 class WebIDBDatabase; | 34 class WebIDBDatabase; |
| 36 class WebIDBIndex; | 35 class WebIDBIndex; |
| 37 class WebIDBObjectStore; | 36 class WebIDBObjectStore; |
| 38 class WebIDBTransaction; | 37 class WebIDBTransaction; |
| 39 } | 38 } |
| 40 | 39 |
| 41 namespace content { | 40 namespace content { |
| 41 class IndexedDBKeyPath; |
| 42 class SerializedScriptValue; | 42 class SerializedScriptValue; |
| 43 } | 43 } |
| 44 | 44 |
| 45 // Handles all IndexedDB related messages from a particular renderer process. | 45 // Handles all IndexedDB related messages from a particular renderer process. |
| 46 class IndexedDBDispatcherHost : public content::BrowserMessageFilter { | 46 class IndexedDBDispatcherHost : public content::BrowserMessageFilter { |
| 47 public: | 47 public: |
| 48 // Only call the constructor from the UI thread. | 48 // Only call the constructor from the UI thread. |
| 49 IndexedDBDispatcherHost(int process_id, | 49 IndexedDBDispatcherHost(int process_id, |
| 50 IndexedDBContextImpl* indexed_db_context); | 50 IndexedDBContextImpl* indexed_db_context); |
| 51 | 51 |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 class IndexDispatcherHost { | 149 class IndexDispatcherHost { |
| 150 public: | 150 public: |
| 151 explicit IndexDispatcherHost(IndexedDBDispatcherHost* parent); | 151 explicit IndexDispatcherHost(IndexedDBDispatcherHost* parent); |
| 152 ~IndexDispatcherHost(); | 152 ~IndexDispatcherHost(); |
| 153 | 153 |
| 154 bool OnMessageReceived(const IPC::Message& message, bool *msg_is_ok); | 154 bool OnMessageReceived(const IPC::Message& message, bool *msg_is_ok); |
| 155 void Send(IPC::Message* message); | 155 void Send(IPC::Message* message); |
| 156 | 156 |
| 157 void OnName(int32 idb_index_id, string16* name); | 157 void OnName(int32 idb_index_id, string16* name); |
| 158 void OnStoreName(int32 idb_index_id, string16* store_name); | 158 void OnStoreName(int32 idb_index_id, string16* store_name); |
| 159 void OnKeyPath(int32 idb_index_id, NullableString16* key_path); | 159 void OnKeyPath(int32 idb_index_id, content::IndexedDBKeyPath* key_path); |
| 160 void OnUnique(int32 idb_index_id, bool* unique); | 160 void OnUnique(int32 idb_index_id, bool* unique); |
| 161 void OnMultiEntry(int32 idb_index_id, bool* multi_entry); | 161 void OnMultiEntry(int32 idb_index_id, bool* multi_entry); |
| 162 void OnOpenObjectCursor( | 162 void OnOpenObjectCursor( |
| 163 const IndexedDBHostMsg_IndexOpenCursor_Params& params, | 163 const IndexedDBHostMsg_IndexOpenCursor_Params& params, |
| 164 WebKit::WebExceptionCode* ec); | 164 WebKit::WebExceptionCode* ec); |
| 165 void OnOpenKeyCursor(const IndexedDBHostMsg_IndexOpenCursor_Params& params, | 165 void OnOpenKeyCursor(const IndexedDBHostMsg_IndexOpenCursor_Params& params, |
| 166 WebKit::WebExceptionCode* ec); | 166 WebKit::WebExceptionCode* ec); |
| 167 void OnCount(const IndexedDBHostMsg_IndexCount_Params& params, | 167 void OnCount(const IndexedDBHostMsg_IndexCount_Params& params, |
| 168 WebKit::WebExceptionCode* ec); | 168 WebKit::WebExceptionCode* ec); |
| 169 void OnGetObject(int idb_index_id, | 169 void OnGetObject(int idb_index_id, |
| (...skipping 16 matching lines...) Expand all Loading... |
| 186 | 186 |
| 187 class ObjectStoreDispatcherHost { | 187 class ObjectStoreDispatcherHost { |
| 188 public: | 188 public: |
| 189 explicit ObjectStoreDispatcherHost(IndexedDBDispatcherHost* parent); | 189 explicit ObjectStoreDispatcherHost(IndexedDBDispatcherHost* parent); |
| 190 ~ObjectStoreDispatcherHost(); | 190 ~ObjectStoreDispatcherHost(); |
| 191 | 191 |
| 192 bool OnMessageReceived(const IPC::Message& message, bool *msg_is_ok); | 192 bool OnMessageReceived(const IPC::Message& message, bool *msg_is_ok); |
| 193 void Send(IPC::Message* message); | 193 void Send(IPC::Message* message); |
| 194 | 194 |
| 195 void OnName(int32 idb_object_store_id, string16* name); | 195 void OnName(int32 idb_object_store_id, string16* name); |
| 196 void OnKeyPath(int32 idb_object_store_id, NullableString16* keyPath); | 196 void OnKeyPath(int32 idb_object_store_id, |
| 197 content::IndexedDBKeyPath* keyPath); |
| 197 void OnIndexNames(int32 idb_object_store_id, | 198 void OnIndexNames(int32 idb_object_store_id, |
| 198 std::vector<string16>* index_names); | 199 std::vector<string16>* index_names); |
| 199 void OnGet(int idb_object_store_id, | 200 void OnGet(int idb_object_store_id, |
| 200 int32 thread_id, | 201 int32 thread_id, |
| 201 int32 response_id, | 202 int32 response_id, |
| 202 const IndexedDBKeyRange& key_range, | 203 const IndexedDBKeyRange& key_range, |
| 203 int32 transaction_id, | 204 int32 transaction_id, |
| 204 WebKit::WebExceptionCode* ec); | 205 WebKit::WebExceptionCode* ec); |
| 205 void OnPut(const IndexedDBHostMsg_ObjectStorePut_Params& params, | 206 void OnPut(const IndexedDBHostMsg_ObjectStorePut_Params& params, |
| 206 WebKit::WebExceptionCode* ec); | 207 WebKit::WebExceptionCode* ec); |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 323 scoped_ptr<CursorDispatcherHost> cursor_dispatcher_host_; | 324 scoped_ptr<CursorDispatcherHost> cursor_dispatcher_host_; |
| 324 scoped_ptr<TransactionDispatcherHost> transaction_dispatcher_host_; | 325 scoped_ptr<TransactionDispatcherHost> transaction_dispatcher_host_; |
| 325 | 326 |
| 326 // Used to dispatch messages to the correct view host. | 327 // Used to dispatch messages to the correct view host. |
| 327 int process_id_; | 328 int process_id_; |
| 328 | 329 |
| 329 DISALLOW_IMPLICIT_CONSTRUCTORS(IndexedDBDispatcherHost); | 330 DISALLOW_IMPLICIT_CONSTRUCTORS(IndexedDBDispatcherHost); |
| 330 }; | 331 }; |
| 331 | 332 |
| 332 #endif // CONTENT_BROWSER_IN_PROCESS_WEBKIT_INDEXED_DB_DISPATCHER_HOST_H_ | 333 #endif // CONTENT_BROWSER_IN_PROCESS_WEBKIT_INDEXED_DB_DISPATCHER_HOST_H_ |
| OLD | NEW |