| Index: chrome/browser/in_process_webkit/indexed_db_dispatcher_host.h
|
| ===================================================================
|
| --- chrome/browser/in_process_webkit/indexed_db_dispatcher_host.h (revision 68877)
|
| +++ chrome/browser/in_process_webkit/indexed_db_dispatcher_host.h (working copy)
|
| @@ -8,21 +8,19 @@
|
|
|
| #include "base/basictypes.h"
|
| #include "base/id_map.h"
|
| -#include "base/process.h"
|
| -#include "base/ref_counted.h"
|
| +#include "chrome/browser/browser_message_filter.h"
|
| #include "chrome/browser/in_process_webkit/webkit_context.h"
|
| -#include "ipc/ipc_message.h"
|
|
|
| class HostContentSettingsMap;
|
| class IndexedDBKey;
|
| class Profile;
|
| class SerializedScriptValue;
|
| -struct ViewHostMsg_IDBDatabaseCreateObjectStore_Params;
|
| -struct ViewHostMsg_IDBFactoryOpen_Params;
|
| -struct ViewHostMsg_IDBIndexOpenCursor_Params;
|
| -struct ViewHostMsg_IDBObjectStoreCreateIndex_Params;
|
| -struct ViewHostMsg_IDBObjectStoreOpenCursor_Params;
|
| -struct ViewHostMsg_IDBObjectStorePut_Params;
|
| +struct IndexedDBHostMsg_DatabaseCreateObjectStore_Params;
|
| +struct IndexedDBHostMsg_FactoryOpen_Params;
|
| +struct IndexedDBHostMsg_IndexOpenCursor_Params;
|
| +struct IndexedDBHostMsg_ObjectStoreCreateIndex_Params;
|
| +struct IndexedDBHostMsg_ObjectStoreOpenCursor_Params;
|
| +struct IndexedDBHostMsg_ObjectStorePut_Params;
|
|
|
| namespace WebKit {
|
| class WebIDBCursor;
|
| @@ -33,26 +31,18 @@
|
| }
|
|
|
| // Handles all IndexedDB related messages from a particular renderer process.
|
| -class IndexedDBDispatcherHost
|
| - : public base::RefCountedThreadSafe<IndexedDBDispatcherHost> {
|
| +class IndexedDBDispatcherHost : public BrowserMessageFilter {
|
| public:
|
| // Only call the constructor from the UI thread.
|
| - IndexedDBDispatcherHost(IPC::Message::Sender* sender, Profile* profile);
|
| + IndexedDBDispatcherHost(int process_id, Profile* profile);
|
|
|
| - // Only call from ResourceMessageFilter on the IO thread.
|
| - void Init(int process_id, base::ProcessHandle process_handle);
|
| + // BrowserMessageFilter implementation.
|
| + virtual void OnChannelClosing();
|
| + virtual void OverrideThreadForMessage(const IPC::Message& message,
|
| + BrowserThread::ID* thread);
|
| + virtual bool OnMessageReceived(const IPC::Message& message,
|
| + bool* message_was_ok);
|
|
|
| - // Only call from ResourceMessageFilter on the IO thread. Calls self on the
|
| - // WebKit thread in some cases.
|
| - void Shutdown();
|
| -
|
| - // Only call from ResourceMessageFilter on the IO thread.
|
| - bool OnMessageReceived(const IPC::Message& message);
|
| -
|
| - // Send a message to the renderer process associated with our sender_ via the
|
| - // IO thread. May be called from any thread.
|
| - void Send(IPC::Message* message);
|
| -
|
| // A shortcut for accessing our context.
|
| IndexedDBContext* Context() {
|
| return webkit_context_->indexed_db_context();
|
| @@ -67,13 +57,11 @@
|
| int32 Add(WebKit::WebIDBTransaction* idb_transaction);
|
|
|
| private:
|
| - friend class base::RefCountedThreadSafe<IndexedDBDispatcherHost>;
|
| ~IndexedDBDispatcherHost();
|
|
|
| // Message processing. Most of the work is delegated to the dispatcher hosts
|
| // below.
|
| - void OnMessageReceivedWebKit(const IPC::Message& message);
|
| - void OnIDBFactoryOpen(const ViewHostMsg_IDBFactoryOpen_Params& p);
|
| + void OnIDBFactoryOpen(const IndexedDBHostMsg_FactoryOpen_Params& p);
|
|
|
| // Helper templates.
|
| template <class ReturnType>
|
| @@ -102,7 +90,7 @@
|
| void OnVersion(int32 idb_database_id, IPC::Message* reply_msg);
|
| void OnObjectStoreNames(int32 idb_database_id, IPC::Message* reply_msg);
|
| void OnCreateObjectStore(
|
| - const ViewHostMsg_IDBDatabaseCreateObjectStore_Params& params,
|
| + const IndexedDBHostMsg_DatabaseCreateObjectStore_Params& params,
|
| IPC::Message* reply_msg);
|
| void OnDeleteObjectStore(int32 idb_database_id,
|
| const string16& name,
|
| @@ -135,9 +123,9 @@
|
| void OnKeyPath(int32 idb_index_id, IPC::Message* reply_msg);
|
| void OnUnique(int32 idb_index_id, IPC::Message* reply_msg);
|
| void OnOpenObjectCursor(
|
| - const ViewHostMsg_IDBIndexOpenCursor_Params& params,
|
| + const IndexedDBHostMsg_IndexOpenCursor_Params& params,
|
| IPC::Message* reply_msg);
|
| - void OnOpenKeyCursor(const ViewHostMsg_IDBIndexOpenCursor_Params& params,
|
| + void OnOpenKeyCursor(const IndexedDBHostMsg_IndexOpenCursor_Params& params,
|
| IPC::Message* reply_msg);
|
| void OnGetObject(int idb_index_id,
|
| int32 response_id,
|
| @@ -171,7 +159,7 @@
|
| const IndexedDBKey& key,
|
| int32 transaction_id,
|
| IPC::Message* reply_msg);
|
| - void OnPut(const ViewHostMsg_IDBObjectStorePut_Params& params,
|
| + void OnPut(const IndexedDBHostMsg_ObjectStorePut_Params& params,
|
| IPC::Message* reply_msg);
|
| void OnDelete(int idb_object_store_id,
|
| int32 response_id,
|
| @@ -179,7 +167,7 @@
|
| int32 transaction_id,
|
| IPC::Message* reply_msg);
|
| void OnCreateIndex(
|
| - const ViewHostMsg_IDBObjectStoreCreateIndex_Params& params,
|
| + const IndexedDBHostMsg_ObjectStoreCreateIndex_Params& params,
|
| IPC::Message* reply_msg);
|
| void OnIndex(int32 idb_object_store_id,
|
| const string16& name,
|
| @@ -189,7 +177,7 @@
|
| int32 transaction_id,
|
| IPC::Message* reply_msg);
|
| void OnOpenCursor(
|
| - const ViewHostMsg_IDBObjectStoreOpenCursor_Params& params,
|
| + const IndexedDBHostMsg_ObjectStoreOpenCursor_Params& params,
|
| IPC::Message* reply_msg);
|
| void OnDestroyed(int32 idb_object_store_id);
|
|
|
| @@ -247,9 +235,6 @@
|
| MapType map_;
|
| };
|
|
|
| - // Only use on the IO thread.
|
| - IPC::Message::Sender* sender_;
|
| -
|
| // Data shared between renderer processes with the same profile.
|
| scoped_refptr<WebKitContext> webkit_context_;
|
|
|
| @@ -263,10 +248,6 @@
|
| scoped_ptr<CursorDispatcherHost> cursor_dispatcher_host_;
|
| scoped_ptr<TransactionDispatcherHost> transaction_dispatcher_host_;
|
|
|
| - // If we get a corrupt message from a renderer, we need to kill it using this
|
| - // handle.
|
| - base::ProcessHandle process_handle_;
|
| -
|
| // Used to dispatch messages to the correct view host.
|
| int process_id_;
|
|
|
|
|