| 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 4073fc4e19a55503d22a8cc5019d6188e30b877c..a6d5da20033dcec019d432921dee52233a217a35 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
|
| @@ -41,7 +41,6 @@ import org.chromium.base.WeakContext;
|
| import org.chromium.content.app.AppResource;
|
| import org.chromium.content.browser.ContentViewGestureHandler.MotionEventDelegate;
|
| import org.chromium.content.browser.accessibility.AccessibilityInjector;
|
| -import org.chromium.content.common.CleanupReference;
|
| import org.chromium.content.common.TraceEvent;
|
| import org.chromium.ui.gfx.NativeWindow;
|
|
|
| @@ -133,19 +132,6 @@ public class ContentViewCore implements MotionEventDelegate {
|
| boolean super_awakenScrollBars(int startDelay, boolean invalidate);
|
| }
|
|
|
| - private static final class DestroyRunnable implements Runnable {
|
| - private final int mNativeContentViewCore;
|
| - private DestroyRunnable(int nativeContentViewCore) {
|
| - mNativeContentViewCore = nativeContentViewCore;
|
| - }
|
| - @Override
|
| - public void run() {
|
| - nativeDestroy(mNativeContentViewCore);
|
| - }
|
| - }
|
| -
|
| - private CleanupReference mCleanupReference;
|
| -
|
| private final Context mContext;
|
| private ViewGroup mContainerView;
|
| private InternalAccessDelegate mContainerViewInternals;
|
| @@ -455,8 +441,6 @@ public class ContentViewCore implements MotionEventDelegate {
|
| mContainerView = containerView;
|
| mNativeContentViewCore = nativeInit(mHardwareAccelerated, nativeWebContents,
|
| nativeWindow.getNativePointer());
|
| - mCleanupReference = new CleanupReference(
|
| - this, new DestroyRunnable(mNativeContentViewCore));
|
| mContentSettings = new ContentSettings(
|
| this, mNativeContentViewCore, isAccessFromFileURLsGrantedByDefault);
|
| initializeContainerView(internalDispatcher);
|
| @@ -483,6 +467,12 @@ public class ContentViewCore implements MotionEventDelegate {
|
| };
|
| }
|
|
|
| + @CalledByNative
|
| + void onNativeContentViewCoreDestroyed(int nativeContentViewCore) {
|
| + assert nativeContentViewCore == mNativeContentViewCore;
|
| + mNativeContentViewCore = 0;
|
| + }
|
| +
|
| /**
|
| * Initializes the View that will contain all Views created by the ContentViewCore.
|
| *
|
| @@ -571,7 +561,9 @@ public class ContentViewCore implements MotionEventDelegate {
|
| */
|
| public void destroy() {
|
| hidePopupDialog();
|
| - mCleanupReference.cleanupNow();
|
| + if (mNativeContentViewCore != 0) {
|
| + nativeOnJavaContentViewCoreDestroyed(mNativeContentViewCore);
|
| + }
|
| mNativeContentViewCore = 0;
|
| // Do not propagate the destroy() to settings, as the client may still hold a reference to
|
| // that and could still be using it.
|
| @@ -2100,7 +2092,7 @@ public class ContentViewCore implements MotionEventDelegate {
|
| private native int nativeInit(boolean hardwareAccelerated, int webContentsPtr,
|
| int windowAndroidPtr);
|
|
|
| - private static native void nativeDestroy(int nativeContentViewCore);
|
| + private native void nativeOnJavaContentViewCoreDestroyed(int nativeContentViewCoreImpl);
|
|
|
| private native void nativeLoadUrl(
|
| int nativeContentViewCoreImpl,
|
|
|