diff options
author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-06-09 21:11:51 +0000 |
---|---|---|
committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-06-09 21:11:51 +0000 |
commit | 373c1069852a133d823ddb417f18beaa840664e8 (patch) | |
tree | 34571462d893810b94d4cc965b8a505653eb161b /content/common | |
parent | db6831ad3a6ba65d881bedd504c92b219c8524da (diff) | |
download | chromium_src-373c1069852a133d823ddb417f18beaa840664e8.zip chromium_src-373c1069852a133d823ddb417f18beaa840664e8.tar.gz chromium_src-373c1069852a133d823ddb417f18beaa840664e8.tar.bz2 |
Move UtilityProcessHost to content and move the message sending/dispatching to the clients. This allows the content layer to use the class.
BUG=76697
Review URL: http://codereview.chromium.org/6995095
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@88586 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/common')
-rw-r--r-- | content/common/content_client.h | 7 | ||||
-rw-r--r-- | content/common/content_message_generator.h | 1 | ||||
-rw-r--r-- | content/common/utility_messages.h | 60 |
3 files changed, 67 insertions, 1 deletions
diff --git a/content/common/content_client.h b/content/common/content_client.h index 0b7bfce..0e57fd0 100644 --- a/content/common/content_client.h +++ b/content/common/content_client.h @@ -30,6 +30,7 @@ class ContentBrowserClient; class ContentClient; class ContentPluginClient; class ContentRendererClient; +class ContentUtilityClient; // Setter and getter for the client. The client should be set early, before any // content code is called. @@ -45,9 +46,11 @@ class ContentClient { ContentBrowserClient* browser() { return browser_; } void set_browser(ContentBrowserClient* c) { browser_ = c; } ContentPluginClient* plugin() { return plugin_; } - void set_plugin(ContentPluginClient* r) { plugin_ = r; } + void set_plugin(ContentPluginClient* p) { plugin_ = p; } ContentRendererClient* renderer() { return renderer_; } void set_renderer(ContentRendererClient* r) { renderer_ = r; } + ContentUtilityClient* utility() { return utility_; } + void set_utility(ContentUtilityClient* u) { utility_ = u; } // Sets the currently active URL. Use GURL() to clear the URL. virtual void SetActiveURL(const GURL& url) {} @@ -79,6 +82,8 @@ class ContentClient { ContentPluginClient* plugin_; // The embedder API for participating in renderer logic. ContentRendererClient* renderer_; + // The embedder API for participating in utility logic. + ContentUtilityClient* utility_; }; } // namespace content diff --git a/content/common/content_message_generator.h b/content/common/content_message_generator.h index 10659b8..2d3c07d 100644 --- a/content/common/content_message_generator.h +++ b/content/common/content_message_generator.h @@ -31,6 +31,7 @@ #include "content/common/resource_messages.h" #include "content/common/speech_input_messages.h" #include "content/common/socket_stream_messages.h" +#include "content/common/utility_messages.h" #include "content/common/video_capture_messages.h" #include "content/common/view_messages.h" #include "content/common/webblob_messages.h" diff --git a/content/common/utility_messages.h b/content/common/utility_messages.h new file mode 100644 index 0000000..9d7d78b --- /dev/null +++ b/content/common/utility_messages.h @@ -0,0 +1,60 @@ +// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Multiply-included message file, so no include guard. + +#include <string> +#include <vector> + +#include "base/basictypes.h" +#include "content/common/common_param_traits.h" +#include "content/common/indexed_db_key.h" +#include "content/common/indexed_db_param_traits.h" +#include "content/common/serialized_script_value.h" +#include "ipc/ipc_message_macros.h" + +#define IPC_MESSAGE_START UtilityMsgStart + +//------------------------------------------------------------------------------ +// Utility process messages: +// These are messages from the browser to the utility process. + +// Tell the utility process to extract the given IDBKeyPath from the +// SerializedScriptValue vector and reply with the corresponding IDBKeys. +IPC_MESSAGE_CONTROL3(UtilityMsg_IDBKeysFromValuesAndKeyPath, + int, // id + std::vector<SerializedScriptValue>, + string16) // IDBKeyPath + +IPC_MESSAGE_CONTROL3(UtilityMsg_InjectIDBKey, + IndexedDBKey /* key */, + SerializedScriptValue /* value */, + string16 /* key path*/) + +// Tells the utility process that it's running in batch mode. +IPC_MESSAGE_CONTROL0(UtilityMsg_BatchMode_Started) + +// Tells the utility process that it can shutdown. +IPC_MESSAGE_CONTROL0(UtilityMsg_BatchMode_Finished) + + +//------------------------------------------------------------------------------ +// Utility process host messages: +// These are messages from the utility process to the browser. + +// Reply when the utility process has succeeded in obtaining the value for +// IDBKeyPath. +IPC_MESSAGE_CONTROL2(UtilityHostMsg_IDBKeysFromValuesAndKeyPath_Succeeded, + int /* id */, + std::vector<IndexedDBKey> /* value */) + +// Reply when the utility process has failed in obtaining the value for +// IDBKeyPath. +IPC_MESSAGE_CONTROL1(UtilityHostMsg_IDBKeysFromValuesAndKeyPath_Failed, + int /* id */) + +// Reply when the utility process has finished injecting an IDBKey into +// a SerializedScriptValue. +IPC_MESSAGE_CONTROL1(UtilityHostMsg_InjectIDBKey_Finished, + SerializedScriptValue /* new value */) |