Index: content/renderer/browser_plugin/browser_plugin_bindings.cc |
diff --git a/content/renderer/browser_plugin/browser_plugin_bindings.cc b/content/renderer/browser_plugin/browser_plugin_bindings.cc |
index d8c75ad5bece01eaafc258f690db6a230278023b..4cb9bd09ef32b056cd8a114509d023708612a8d5 100644 |
--- a/content/renderer/browser_plugin/browser_plugin_bindings.cc |
+++ b/content/renderer/browser_plugin/browser_plugin_bindings.cc |
@@ -40,6 +40,8 @@ namespace { |
const char kAddEventListener[] = "addEventListener"; |
const char kRemoveEventListener[] = "removeEventListener"; |
+const char kReloadMethod[] = "reload"; |
+const char kStopMethod[] = "stop"; |
const char kSrcAttribute[] = "src"; |
BrowserPluginBindings* GetBindings(NPObject* object) { |
@@ -47,6 +49,14 @@ BrowserPluginBindings* GetBindings(NPObject* object) { |
message_channel; |
} |
+bool IdentifierIsReload(NPIdentifier identifier) { |
+ return WebBindings::getStringIdentifier(kReloadMethod) == identifier; |
+} |
+ |
+bool IdentifierIsStop(NPIdentifier identifier) { |
+ return WebBindings::getStringIdentifier(kStopMethod) == identifier; |
+} |
+ |
bool IdentifierIsAddEventListener(NPIdentifier identifier) { |
return WebBindings::getStringIdentifier(kAddEventListener) == identifier; |
} |
@@ -112,6 +122,12 @@ bool BrowserPluginBindingsHasMethod(NPObject* np_obj, NPIdentifier name) { |
if (IdentifierIsRemoveEventListener(name)) |
return true; |
+ if (IdentifierIsStop(name)) |
+ return true; |
+ |
+ if (IdentifierIsReload(name)) |
+ return true; |
+ |
return false; |
} |
@@ -154,6 +170,15 @@ bool BrowserPluginBindingsInvoke(NPObject* np_obj, NPIdentifier name, |
return bindings->instance()->RemoveEventListener(event_name, function); |
} |
+ if (IdentifierIsStop(name) && arg_count == 0) { |
lazyboy
2012/09/13 19:14:15
nit here and below: !arg_count
Also why would we c
Fady Samuel
2012/09/19 14:38:09
Done.
In response to your question: Do we really
lazyboy
2012/09/19 15:06:06
I don't know what the regular take on this is. I h
|
+ bindings->instance()->Stop(); |
+ return true; |
+ } |
+ |
+ if (IdentifierIsReload(name) && arg_count == 0) { |
+ bindings->instance()->Reload(); |
+ } |
+ |
return false; |
} |