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

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

Issue 10830173: JavaBridge should use Annotation (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add new line before private Created 8 years, 4 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 d66ac83c5bfbcd89138e2256b67af6688c2a1c41..63a051c67b62d8e160c091c458e1bbce3f2767d9 100644
--- a/content/browser/renderer_host/java/java_bound_object.h
+++ b/content/browser/renderer_host/java/java_bound_object.h
@@ -23,13 +23,14 @@
// created and destroyed on different threads.
class JavaBoundObject {
public:
- // 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.
+ // Takes a Java object and creates a JavaBoundObject around it. The
+ // |require_annotation| flag specifies whether or not only methods with the
+ // JavascriptInterface annotation are exposed to JavaScript. 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);
+ bool require_annotation);
virtual ~JavaBoundObject();
@@ -43,9 +44,11 @@ class JavaBoundObject {
bool Invoke(const std::string& name, const NPVariant* args, size_t arg_count,
NPVariant* result);
+ static bool RegisterJavaBoundObject(JNIEnv* env);
+
private:
explicit JavaBoundObject(const base::android::JavaRef<jobject>& object,
- bool allow_inherited_methods);
+ bool require_annotation);
void EnsureMethodsAreSetUp() const;
@@ -60,7 +63,7 @@ class JavaBoundObject {
mutable JavaMethodMap methods_;
mutable bool are_methods_set_up_;
- bool allow_inherited_methods_;
+ const bool require_annotation_;
DISALLOW_IMPLICIT_CONSTRUCTORS(JavaBoundObject);
};
« no previous file with comments | « content/browser/android/content_view_core_impl.cc ('k') | content/browser/renderer_host/java/java_bound_object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698