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

Unified Diff: content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java

Issue 10830173: JavaBridge should use Annotation (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
diff --git a/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java b/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
index f1c48e9e025930a3b84b746dcd86c47eb46d37e6..7336aa8455c052cd88d784707ec6e6a39fa045b9 100644
--- a/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
+++ b/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
@@ -26,6 +26,7 @@ import org.chromium.content.browser.ContentViewGestureHandler;
import org.chromium.content.browser.TouchPoint;
import org.chromium.content.browser.ZoomManager;
import org.chromium.content.common.CleanupReference;
+import org.chromium.content.common.JavaScriptInterface;
import org.chromium.content.common.TraceEvent;
import org.chromium.content.browser.accessibility.AccessibilityInjector;
@@ -609,7 +610,6 @@ public class ContentViewCore implements MotionEventDelegate {
*
* @return an id that is passed along in the asynchronous onJavaScriptEvaluationResult callback
* @throws IllegalStateException If the ContentView has been destroyed.
- * @hide
*/
public int evaluateJavaScript(String script) throws IllegalStateException {
checkIsAlive();
@@ -1030,13 +1030,13 @@ public class ContentViewCore implements MotionEventDelegate {
* @param object The Java object to inject into the ContentViewCore's
* JavaScript context. Null values are ignored.
* @param name The name used to expose the instance in JavaScript.
- * @param allowInheritedMethods Whether or not inherited methods may be
- * called from JavaScript.
+ * @param requireSafeAnnotation Restrict exposed methods to ones with the
+ * {@link JavaScriptInterface} annotation.
*/
- public void addJavascriptInterface(Object object, String name, boolean allowInheritedMethods) {
+ public void addJavascriptInterface(Object object, String name, boolean requireSafeAnnotation) {
if (mNativeContentViewCore != 0 && object != null) {
nativeAddJavascriptInterface(mNativeContentViewCore, object, name,
- allowInheritedMethods);
+ requireSafeAnnotation);
}
}
@@ -1200,7 +1200,7 @@ public class ContentViewCore implements MotionEventDelegate {
private native int nativeEvaluateJavaScript(String script);
private native void nativeAddJavascriptInterface(int nativeContentViewCoreImpl, Object object,
- String name, boolean allowInheritedMethods);
+ String name, boolean requireSafeAnnotation);
private native void nativeRemoveJavascriptInterface(int nativeContentViewCoreImpl, String name);
}

Powered by Google App Engine
This is Rietveld 408576698