Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1604)

Unified Diff: content/renderer/browser_plugin/browser_plugin_bindings.cc

Issue 10917225: Browser Plugin: Reload and Stop operations (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Updated Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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;
}

Powered by Google App Engine
This is Rietveld 408576698