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

Unified Diff: content/browser/renderer_host/java/java_bound_object.h

Issue 10793035: Add flag to Java -> JavaScript to disable exposing inherited methods. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed commit description. Rebased. Created 8 years, 5 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/browser/renderer_host/java/java_bound_object.h
diff --git a/content/browser/renderer_host/java/java_bound_object.h b/content/browser/renderer_host/java/java_bound_object.h
index cf0c403adf894236a47d09ef42daa51d06c06ef0..d66ac83c5bfbcd89138e2256b67af6688c2a1c41 100644
--- a/content/browser/renderer_host/java/java_bound_object.h
+++ b/content/browser/renderer_host/java/java_bound_object.h
@@ -23,9 +23,13 @@
// created and destroyed on different threads.
class JavaBoundObject {
public:
- // Takes a Java object and creates a JavaBoundObject around it. Returns an
- // NPObject with a ref count of one which owns the JavaBoundObject.
- static NPObject* Create(const base::android::JavaRef<jobject>& object);
+ // Takes a Java object and creates a JavaBoundObject around it. Also takes
+ // a boolean that determines whether or not inherited methods are allowed
+ // to be called as well. This property propagates to all Objects that get
+ // implicitly exposed as return values as well. Returns an NPObject with
+ // a ref count of one which owns the JavaBoundObject.
+ static NPObject* Create(const base::android::JavaRef<jobject>& object,
+ bool allow_inherited_methods);
virtual ~JavaBoundObject();
@@ -40,7 +44,8 @@ class JavaBoundObject {
NPVariant* result);
private:
- explicit JavaBoundObject(const base::android::JavaRef<jobject>& object);
+ explicit JavaBoundObject(const base::android::JavaRef<jobject>& object,
+ bool allow_inherited_methods);
void EnsureMethodsAreSetUp() const;
@@ -53,6 +58,9 @@ class JavaBoundObject {
// scoped_ptr in STL containers as we can't copy it.
typedef std::multimap<std::string, linked_ptr<JavaMethod> > JavaMethodMap;
mutable JavaMethodMap methods_;
+ mutable bool are_methods_set_up_;
+
+ bool allow_inherited_methods_;
DISALLOW_IMPLICIT_CONSTRUCTORS(JavaBoundObject);
};

Powered by Google App Engine
This is Rietveld 408576698