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

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

Issue 11116003: browser-plugin: Refactor the code for binding methods on the plugin. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: tot-merge 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 | « no previous file | content/renderer/browser_plugin/browser_plugin_bindings.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/browser_plugin/browser_plugin_bindings.h
diff --git a/content/renderer/browser_plugin/browser_plugin_bindings.h b/content/renderer/browser_plugin/browser_plugin_bindings.h
index 2d9fa2d90aff5bf389b28fd8064b04f550321ac6..a84580f1498a8daaf4bf7be3a9aa065367e73bcf 100644
--- a/content/renderer/browser_plugin/browser_plugin_bindings.h
+++ b/content/renderer/browser_plugin/browser_plugin_bindings.h
@@ -5,6 +5,7 @@
#ifndef CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_BINDINGS_H__
#define CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_BINDINGS_H__
+#include "base/memory/scoped_vector.h"
#include "base/memory/weak_ptr.h"
#include "ppapi/shared_impl/resource.h"
#include "third_party/npapi/bindings/npruntime.h"
@@ -15,6 +16,10 @@ class WebSerializedScriptValue;
namespace content {
+namespace internal {
+class BrowserPluginMethodBinding;
+}
+
class BrowserPlugin;
class BrowserPluginBindings {
@@ -36,11 +41,21 @@ class BrowserPluginBindings {
NPObject* np_object() const { return np_object_; }
BrowserPlugin* instance() const { return instance_; }
+
+ bool HasMethod(NPIdentifier name) const;
+
+ bool InvokeMethod(NPIdentifier name,
+ const NPVariant* args,
+ uint32 arg_count,
+ NPVariant* result);
private:
BrowserPlugin* instance_;
// The NPObject we use to expose postMessage to JavaScript.
BrowserPluginNPObject* np_object_;
+ typedef ScopedVector<internal::BrowserPluginMethodBinding> BindingList;
+ BindingList method_bindings_;
+
// This is used to ensure pending tasks will not fire after this object is
// destroyed.
base::WeakPtrFactory<BrowserPluginBindings> weak_ptr_factory_;
« no previous file with comments | « no previous file | content/renderer/browser_plugin/browser_plugin_bindings.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698