| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 package org.chromium.android_webview; | 5 package org.chromium.android_webview; |
| 6 | 6 |
| 7 import android.annotation.SuppressLint; | 7 import android.annotation.SuppressLint; |
| 8 import android.app.Activity; | 8 import android.app.Activity; |
| 9 import android.content.ComponentCallbacks2; | 9 import android.content.ComponentCallbacks2; |
| 10 import android.content.Context; | 10 import android.content.Context; |
| (...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 315 // Do not use directly, call isDestroyed() instead. | 315 // Do not use directly, call isDestroyed() instead. |
| 316 private boolean mIsDestroyed = false; | 316 private boolean mIsDestroyed = false; |
| 317 | 317 |
| 318 private static String sCurrentLocale = ""; | 318 private static String sCurrentLocale = ""; |
| 319 | 319 |
| 320 private static final class DestroyRunnable implements Runnable { | 320 private static final class DestroyRunnable implements Runnable { |
| 321 private final long mNativeAwContents; | 321 private final long mNativeAwContents; |
| 322 // Hold onto a reference to the window (via its wrapper), so that it is
not destroyed | 322 // Hold onto a reference to the window (via its wrapper), so that it is
not destroyed |
| 323 // until we are done here. | 323 // until we are done here. |
| 324 private final WindowAndroidWrapper mWindowAndroid; | 324 private final WindowAndroidWrapper mWindowAndroid; |
| 325 private final Runnable mAwGLFunctorDestroyRunnable; | 325 private final Object mAwGLFunctorNativeLifetimeObject; |
| 326 | 326 |
| 327 private DestroyRunnable(long nativeAwContents, WindowAndroidWrapper wind
owAndroid, | 327 private DestroyRunnable(long nativeAwContents, WindowAndroidWrapper wind
owAndroid, |
| 328 AwGLFunctor awGLFunctor) { | 328 AwGLFunctor awGLFunctor) { |
| 329 mNativeAwContents = nativeAwContents; | 329 mNativeAwContents = nativeAwContents; |
| 330 mWindowAndroid = windowAndroid; | 330 mWindowAndroid = windowAndroid; |
| 331 mAwGLFunctorDestroyRunnable = awGLFunctor.getDestroyRunnable(); | 331 mAwGLFunctorNativeLifetimeObject = awGLFunctor.getNativeLifetimeObje
ct(); |
| 332 } | 332 } |
| 333 @Override | 333 @Override |
| 334 public void run() { | 334 public void run() { |
| 335 nativeDestroy(mNativeAwContents); | 335 nativeDestroy(mNativeAwContents); |
| 336 mAwGLFunctorDestroyRunnable.run(); | |
| 337 } | 336 } |
| 338 } | 337 } |
| 339 | 338 |
| 340 /** | 339 /** |
| 341 * A class that stores the state needed to enter and exit fullscreen. | 340 * A class that stores the state needed to enter and exit fullscreen. |
| 342 */ | 341 */ |
| 343 private static class FullScreenTransitionsState { | 342 private static class FullScreenTransitionsState { |
| 344 private final ViewGroup mInitialContainerView; | 343 private final ViewGroup mInitialContainerView; |
| 345 private final InternalAccessDelegate mInitialInternalAccessAdapter; | 344 private final InternalAccessDelegate mInitialInternalAccessAdapter; |
| 346 private final AwViewMethods mInitialAwViewMethods; | 345 private final AwViewMethods mInitialAwViewMethods; |
| (...skipping 2949 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3296 long resources); | 3295 long resources); |
| 3297 | 3296 |
| 3298 private native void nativePostMessageToFrame(long nativeAwContents, String f
rameId, | 3297 private native void nativePostMessageToFrame(long nativeAwContents, String f
rameId, |
| 3299 String message, String targetOrigin, int[] msgPorts); | 3298 String message, String targetOrigin, int[] msgPorts); |
| 3300 | 3299 |
| 3301 private native void nativeCreateMessageChannel(long nativeAwContents, AwMess
agePort[] ports); | 3300 private native void nativeCreateMessageChannel(long nativeAwContents, AwMess
agePort[] ports); |
| 3302 | 3301 |
| 3303 private native void nativeGrantFileSchemeAccesstoChildProcess(long nativeAwC
ontents); | 3302 private native void nativeGrantFileSchemeAccesstoChildProcess(long nativeAwC
ontents); |
| 3304 private native void nativeResumeLoadingCreatedPopupWebContents(long nativeAw
Contents); | 3303 private native void nativeResumeLoadingCreatedPopupWebContents(long nativeAw
Contents); |
| 3305 } | 3304 } |
| OLD | NEW |