summaryrefslogtreecommitdiffstats
path: root/chrome/browser/extensions/extension_message_service.h
diff options
context:
space:
mode:
authorjar@chromium.org <jar@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-19 02:51:42 +0000
committerjar@chromium.org <jar@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-19 02:51:42 +0000
commitd02982248bb68073e940deeec7e36f5c3aab9ee6 (patch)
treeed8f78c90e0a5c8a4af9d43d39ef0e84797939de /chrome/browser/extensions/extension_message_service.h
parent3332977cf064c71b0d25f83bc6e35d8856059d56 (diff)
downloadchromium_src-d02982248bb68073e940deeec7e36f5c3aab9ee6.zip
chromium_src-d02982248bb68073e940deeec7e36f5c3aab9ee6.tar.gz
chromium_src-d02982248bb68073e940deeec7e36f5c3aab9ee6.tar.bz2
Revert 18765 to try to repair perf regression
TBR=mpcomplete Review URL: http://codereview.chromium.org/131093 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18784 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/extension_message_service.h')
-rw-r--r--chrome/browser/extensions/extension_message_service.h37
1 files changed, 17 insertions, 20 deletions
diff --git a/chrome/browser/extensions/extension_message_service.h b/chrome/browser/extensions/extension_message_service.h
index f128103..dde7280 100644
--- a/chrome/browser/extensions/extension_message_service.h
+++ b/chrome/browser/extensions/extension_message_service.h
@@ -54,17 +54,22 @@ class ExtensionMessageService : public NotificationObserver {
void AddEventListener(std::string event_name, int render_process_id);
void RemoveEventListener(std::string event_name, int render_process_id);
- // Closes the message channel associated with the given port, and notifies
- // the other side.
- void CloseChannel(int port_id);
+ // Closes an extension channel for test automation.
+ void CloseAutomationChannel(int port_id);
// Sends a message from a renderer to the given port.
+ // TODO(mpcomplete): include the source tab.
void PostMessageFromRenderer(int port_id, const std::string& message);
// Send an event to every registered extension renderer.
void DispatchEventToRenderers(
const std::string& event_name, const std::string& event_args);
+ // NotificationObserver interface.
+ void Observe(NotificationType type,
+ const NotificationSource& source,
+ const NotificationDetails& details);
+
// Given an extension's ID, opens a channel between the given automation
// "port" and that extension. Returns a channel ID to be used for posting
// messages between the processes, or -1 if the extension doesn't exist.
@@ -73,11 +78,6 @@ class ExtensionMessageService : public NotificationObserver {
const std::string& extension_id,
IPC::Message::Sender* source);
- // NotificationObserver interface.
- void Observe(NotificationType type,
- const NotificationSource& source,
- const NotificationDetails& details);
-
// --- IO thread only:
// Given an extension's ID, opens a channel between the given renderer "port"
@@ -89,16 +89,6 @@ class ExtensionMessageService : public NotificationObserver {
ResourceMessageFilter* source);
private:
- // The connection between two ports. It is possible that both ports
- // refer to the same renderer.
- struct MessageChannel {
- IPC::Message::Sender* port1;
- IPC::Message::Sender* port2;
- };
-
- // A map of channel ID to its channel object.
- typedef std::map<int, MessageChannel> MessageChannelMap;
-
// Allocates a pair of port ids.
// NOTE: this can be called from any thread.
void AllocatePortIdPair(int* port1, int* port2);
@@ -107,8 +97,6 @@ class ExtensionMessageService : public NotificationObserver {
// NOTE: this can be called from any thread.
int GetProcessIdForExtension(const std::string& extension_id);
- void CloseChannelImpl(MessageChannelMap::iterator channel_iter, int port_id);
-
int OpenChannelToExtensionImpl(const std::string& extension_id,
IPC::Message::Sender* source);
@@ -148,6 +136,15 @@ class ExtensionMessageService : public NotificationObserver {
int source_routing_id, int source_port_id, IPC::Message::Sender* source,
int dest_port_id, int dest_process_id, int source_process_id);
+ // The connection between two ports. It is possible that both ports
+ // refer to the same renderer.
+ struct MessageChannel {
+ IPC::Message::Sender* port1;
+ IPC::Message::Sender* port2;
+ };
+
+ // A map of channel ID to its channel object.
+ typedef std::map<int, MessageChannel> MessageChannelMap;
MessageChannelMap channels_;
// True if Init has been called.