diff options
author | scottmg@chromium.org <scottmg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-01-18 22:00:44 +0000 |
---|---|---|
committer | scottmg@chromium.org <scottmg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-01-18 22:00:44 +0000 |
commit | 204c9f5f9b101f57292f445a9f980fb139e2a597 (patch) | |
tree | 032385893cde42f3073c0283a4a7f9e7e1296943 /content/public | |
parent | 6d3d54a2a280f0c63a0dde0db29788bd6cb19ea4 (diff) | |
download | chromium_src-204c9f5f9b101f57292f445a9f980fb139e2a597.zip chromium_src-204c9f5f9b101f57292f445a9f980fb139e2a597.tar.gz chromium_src-204c9f5f9b101f57292f445a9f980fb139e2a597.tar.bz2 |
Revert 177765
Failed compile on all Linux bots.
> [Android] Manage CVC's retained JS object set on the native side.
>
> Move management of the js retained object set to the native java
> bridge.
>
> Android only change, android bots green.
> NOTRY=true
> BUG=169228
>
>
> Review URL: https://chromiumcodereview.appspot.com/11817047
TBR=benm@chromium.org
Review URL: https://codereview.chromium.org/12018025
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@177770 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/public')
-rw-r--r-- | content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java | 20 |
1 files changed, 14 insertions, 6 deletions
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 78ad517..e1b3417 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 @@ -52,6 +52,7 @@ import org.chromium.ui.gfx.NativeWindow; import java.lang.annotation.Annotation; import java.util.HashMap; import java.util.Map; +import java.util.Set; import java.util.HashSet; /** @@ -99,9 +100,10 @@ public class ContentViewCore implements MotionEventDelegate, NavigationClient { // current page to ensure that they are not garbage collected until the page is // navigated. This includes interface objects that have been removed // via the removeJavaScriptInterface API and transient objects returned from methods - // on the interface object. Note we use HashSet rather than Set as the native side - // expects HashSet (no bindings for interfaces). - private HashSet<Object> mRetainedJavaScriptObjects = new HashSet<Object>(); + // on the interface object. + // TODO(benm): Implement the transient object retention - likely by moving the + // management of this set into the native Java bridge. (crbug/169228) (crbug/169228) + private Set<Object> mRetainedJavaScriptObjects = new HashSet<Object>(); /** * Interface that consumers of {@link ContentViewCore} must implement to allow the proper @@ -530,6 +532,10 @@ public class ContentViewCore implements MotionEventDelegate, NavigationClient { public void didStartLoading(String url) { hidePopupDialog(); resetGestureDetectors(); + // TODO(benm): This isn't quite the right place to do this. Management + // of this set should be moving into the native java bridge in crbug/169228 + // and until that's ready this will do. + mRetainedJavaScriptObjects.clear(); } }; } @@ -2255,8 +2261,7 @@ public class ContentViewCore implements MotionEventDelegate, NavigationClient { Class<? extends Annotation> requiredAnnotation) { if (mNativeContentViewCore != 0 && object != null) { mJavaScriptInterfaces.put(name, object); - nativeAddJavascriptInterface(mNativeContentViewCore, object, name, requiredAnnotation, - mRetainedJavaScriptObjects); + nativeAddJavascriptInterface(mNativeContentViewCore, object, name, requiredAnnotation); } } @@ -2266,6 +2271,9 @@ public class ContentViewCore implements MotionEventDelegate, NavigationClient { * @param name The name of the interface to remove. */ public void removeJavascriptInterface(String name) { + // TODO(benm): Move the management of this retained object set + // into the native java bridge. (crbug/169228) + mRetainedJavaScriptObjects.add(mJavaScriptInterfaces.get(name)); mJavaScriptInterfaces.remove(name); if (mNativeContentViewCore != 0) { nativeRemoveJavascriptInterface(mNativeContentViewCore, name); @@ -2592,7 +2600,7 @@ public class ContentViewCore implements MotionEventDelegate, NavigationClient { private native void nativeClearSslPreferences(int nativeContentViewCoreImpl); private native void nativeAddJavascriptInterface(int nativeContentViewCoreImpl, Object object, - String name, Class requiredAnnotation, HashSet<Object> retainedObjectSet); + String name, Class requiredAnnotation); private native void nativeRemoveJavascriptInterface(int nativeContentViewCoreImpl, String name); |