diff options
author | mpcomplete@chromium.org <mpcomplete@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-20 21:05:37 +0000 |
---|---|---|
committer | mpcomplete@chromium.org <mpcomplete@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-20 21:05:37 +0000 |
commit | 7120f1327bcd3f0c33a983ee4a61c277747bb566 (patch) | |
tree | da00ed514530587dd14f76941063d34a4afcda88 /chrome/browser/automation | |
parent | 6d33519bd4d811112cef3d64d9c346531d65ab9b (diff) | |
download | chromium_src-7120f1327bcd3f0c33a983ee4a61c277747bb566.zip chromium_src-7120f1327bcd3f0c33a983ee4a61c277747bb566.tar.gz chromium_src-7120f1327bcd3f0c33a983ee4a61c277747bb566.tar.bz2 |
Changed the extension.connect() API not to broadcast to all tabs. Added a
more specific tabs.connect(tabId) API to connect to a specific tab.
Also changed the ExtensionMessageService from a singleton to a Profile-owned object.
BUG=12461
TEST=no
Review URL: http://codereview.chromium.org/155707
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21102 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/automation')
-rw-r--r-- | chrome/browser/automation/automation_provider.cc | 6 | ||||
-rw-r--r-- | chrome/browser/automation/extension_port_container.cc | 3 | ||||
-rw-r--r-- | chrome/browser/automation/extension_port_container.h | 3 |
3 files changed, 7 insertions, 5 deletions
diff --git a/chrome/browser/automation/automation_provider.cc b/chrome/browser/automation/automation_provider.cc index ed4fd46..1ce2c87 100644 --- a/chrome/browser/automation/automation_provider.cc +++ b/chrome/browser/automation/automation_provider.cc @@ -2730,8 +2730,10 @@ bool AutomationProvider::InterceptBrowserEventMessageFromExternalHost( return false; } - ExtensionMessageService::GetInstance(profile()->GetRequestContext())-> - DispatchEventToRenderers(event_name.c_str(), json_args); + if (profile()->GetExtensionMessageService()) { + profile()->GetExtensionMessageService()-> + DispatchEventToRenderers(event_name.c_str(), json_args); + } return true; } diff --git a/chrome/browser/automation/extension_port_container.cc b/chrome/browser/automation/extension_port_container.cc index 581da75..e814fcc 100644 --- a/chrome/browser/automation/extension_port_container.cc +++ b/chrome/browser/automation/extension_port_container.cc @@ -25,8 +25,7 @@ ExtensionPortContainer::ExtensionPortContainer(AutomationProvider* automation, int tab_handle) : automation_(automation), service_(NULL), port_id_(-1), tab_handle_(tab_handle) { - URLRequestContext* context = automation_->profile()->GetRequestContext(); - service_ = ExtensionMessageService::GetInstance(context); + service_ = automation_->profile()->GetExtensionMessageService();; DCHECK(service_); } diff --git a/chrome/browser/automation/extension_port_container.h b/chrome/browser/automation/extension_port_container.h index d9244b0..8eedd09 100644 --- a/chrome/browser/automation/extension_port_container.h +++ b/chrome/browser/automation/extension_port_container.h @@ -8,6 +8,7 @@ #include <string> #include "base/basictypes.h" +#include "base/ref_counted.h" #include "chrome/common/ipc_message.h" class AutomationProvider; @@ -66,7 +67,7 @@ class ExtensionPortContainer : public IPC::Message::Sender { AutomationProvider* automation_; // The extension message service. - ExtensionMessageService* service_; + scoped_refptr<ExtensionMessageService> service_; // Our assigned port id. int port_id_; |