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

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

Issue 11048023: Browser Plugin: Implement terminate() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merged with ToT Created 8 years, 2 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
« no previous file with comments | « content/renderer/browser_plugin/browser_plugin.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 a9d5bb97b8666511ec7e5ba0ce2ff92c6d0f9437..68a206e1b68c33e9dd9ea897d1ca33599a2c0177 100644
--- a/content/renderer/browser_plugin/browser_plugin_bindings.cc
+++ b/content/renderer/browser_plugin/browser_plugin_bindings.cc
@@ -47,20 +47,13 @@ const char kReloadMethod[] = "reload";
const char kRemoveEventListener[] = "removeEventListener";
const char kSrcAttribute[] = "src";
const char kStopMethod[] = "stop";
+const char kTerminateMethod[] = "terminate";
BrowserPluginBindings* GetBindings(NPObject* object) {
return static_cast<BrowserPluginBindings::BrowserPluginNPObject*>(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;
}
@@ -73,24 +66,36 @@ bool IdentifierIsForwardMethod(NPIdentifier identifier) {
return WebBindings::getStringIdentifier(kForwardMethod) == identifier;
}
+bool IdentifierIsGetProcessID(NPIdentifier identifier) {
+ return WebBindings::getStringIdentifier(kGetProcessId) == identifier;
+}
+
bool IdentifierIsGoMethod(NPIdentifier identifier) {
return WebBindings::getStringIdentifier(kGoMethod) == identifier;
}
-bool IdentifierIsRemoveEventListener(NPIdentifier identifier) {
- return WebBindings::getStringIdentifier(kRemoveEventListener) == identifier;
+bool IdentifierIsPartitionAttribute(NPIdentifier identifier) {
+ return WebBindings::getStringIdentifier(kPartitionAttribute) == identifier;
}
-bool IdentifierIsGetProcessID(NPIdentifier identifier) {
- return WebBindings::getStringIdentifier(kGetProcessId) == identifier;
+bool IdentifierIsReload(NPIdentifier identifier) {
+ return WebBindings::getStringIdentifier(kReloadMethod) == identifier;
+}
+
+bool IdentifierIsRemoveEventListener(NPIdentifier identifier) {
+ return WebBindings::getStringIdentifier(kRemoveEventListener) == identifier;
}
bool IdentifierIsSrcAttribute(NPIdentifier identifier) {
return WebBindings::getStringIdentifier(kSrcAttribute) == identifier;
}
-bool IdentifierIsPartitionAttribute(NPIdentifier identifier) {
- return WebBindings::getStringIdentifier(kPartitionAttribute) == identifier;
+bool IdentifierIsStop(NPIdentifier identifier) {
+ return WebBindings::getStringIdentifier(kStopMethod) == identifier;
+}
+
+bool IdentifierIsTerminate(NPIdentifier identifier) {
+ return WebBindings::getStringIdentifier(kTerminateMethod) == identifier;
}
int Int32FromNPVariant(const NPVariant& variant) {
@@ -164,6 +169,9 @@ bool BrowserPluginBindingsHasMethod(NPObject* np_obj, NPIdentifier name) {
if (IdentifierIsStop(name))
return true;
+ if (IdentifierIsTerminate(name))
+ return true;
+
return false;
}
@@ -238,6 +246,10 @@ bool BrowserPluginBindingsInvoke(NPObject* np_obj, NPIdentifier name,
return true;
}
+ if (IdentifierIsTerminate(name)) {
+ bindings->instance()->TerminateGuest();
+ }
+
return false;
}
« no previous file with comments | « content/renderer/browser_plugin/browser_plugin.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698