Commit 628fa785 authored by koz@chromium.org's avatar koz@chromium.org

Revert "Make EventBindings use static routed methods." (r145634)

The crashes that it was hoped this patch would prevent didn't stop, and the actual bug was fixed in r145842.

BUG=136232
TBR=kalman@chomium.org

Review URL: https://chromiumcodereview.appspot.com/10701134

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@146012 0039d316-1c4b-4281-b951-d872f2087c98
parent 21e096c7
...@@ -20,7 +20,8 @@ class Extension; ...@@ -20,7 +20,8 @@ class Extension;
// This class deals with the javascript bindings related to Event objects. // This class deals with the javascript bindings related to Event objects.
class EventBindings { class EventBindings {
public: public:
static ChromeV8Extension* Get(ExtensionDispatcher* dispatcher); static ChromeV8Extension* Get(ExtensionDispatcher* dispatcher,
extensions::EventFilter* event_filter);
}; };
#endif // CHROME_RENDERER_EXTENSIONS_EVENT_BINDINGS_H_ #endif // CHROME_RENDERER_EXTENSIONS_EVENT_BINDINGS_H_
...@@ -237,7 +237,8 @@ ExtensionDispatcher::ExtensionDispatcher() ...@@ -237,7 +237,8 @@ ExtensionDispatcher::ExtensionDispatcher()
webrequest_adblock_plus_(false), webrequest_adblock_plus_(false),
webrequest_other_(false), webrequest_other_(false),
source_map_(&ResourceBundle::GetSharedInstance()), source_map_(&ResourceBundle::GetSharedInstance()),
chrome_channel_(chrome::VersionInfo::CHANNEL_UNKNOWN) { chrome_channel_(chrome::VersionInfo::CHANNEL_UNKNOWN),
event_filter_(new extensions::EventFilter) {
const CommandLine& command_line = *(CommandLine::ForCurrentProcess()); const CommandLine& command_line = *(CommandLine::ForCurrentProcess());
is_extension_process_ = is_extension_process_ =
command_line.HasSwitch(switches::kExtensionProcess) || command_line.HasSwitch(switches::kExtensionProcess) ||
...@@ -494,7 +495,7 @@ bool ExtensionDispatcher::AllowScriptExtension( ...@@ -494,7 +495,7 @@ bool ExtensionDispatcher::AllowScriptExtension(
void ExtensionDispatcher::RegisterNativeHandlers(ModuleSystem* module_system, void ExtensionDispatcher::RegisterNativeHandlers(ModuleSystem* module_system,
ChromeV8Context* context) { ChromeV8Context* context) {
module_system->RegisterNativeHandler("event_bindings", module_system->RegisterNativeHandler("event_bindings",
scoped_ptr<NativeHandler>(EventBindings::Get(this))); scoped_ptr<NativeHandler>(EventBindings::Get(this, event_filter_.get())));
module_system->RegisterNativeHandler("miscellaneous_bindings", module_system->RegisterNativeHandler("miscellaneous_bindings",
scoped_ptr<NativeHandler>(MiscellaneousBindings::Get(this))); scoped_ptr<NativeHandler>(MiscellaneousBindings::Get(this)));
module_system->RegisterNativeHandler("apiDefinitions", module_system->RegisterNativeHandler("apiDefinitions",
......
...@@ -263,6 +263,10 @@ class ExtensionDispatcher : public content::RenderProcessObserver { ...@@ -263,6 +263,10 @@ class ExtensionDispatcher : public content::RenderProcessObserver {
// TODO(aa): Remove when we can restrict non-permission APIs to dev-only. // TODO(aa): Remove when we can restrict non-permission APIs to dev-only.
int chrome_channel_; int chrome_channel_;
// Routes events to the appropriate listener taking into consideration event
// filters.
scoped_ptr<extensions::EventFilter> event_filter_;
DISALLOW_COPY_AND_ASSIGN(ExtensionDispatcher); DISALLOW_COPY_AND_ASSIGN(ExtensionDispatcher);
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment