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

Unified Diff: android_webview/java/src/org/chromium/android_webview/AwContents.java

Issue 972013003: [WebView] Add test for visual state API when view dettached. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 10 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: android_webview/java/src/org/chromium/android_webview/AwContents.java
diff --git a/android_webview/java/src/org/chromium/android_webview/AwContents.java b/android_webview/java/src/org/chromium/android_webview/AwContents.java
index 9661001334f919f008cfd384bbacae71d7cc8a0d..ed17155d3c399c7a8d3b320599323c2c0158b771 100644
--- a/android_webview/java/src/org/chromium/android_webview/AwContents.java
+++ b/android_webview/java/src/org/chromium/android_webview/AwContents.java
@@ -271,6 +271,8 @@ public class AwContents implements SmartClipProvider,
// when in this state.
private boolean mTemporarilyDetached;
+ private Handler mHandler;
+
// True when this AwContents has been destroyed.
// Do not use directly, call isDestroyed() instead.
private boolean mIsDestroyed = false;
@@ -603,6 +605,7 @@ public class AwContents implements SmartClipProvider,
mContainerView = containerView;
mContainerView.setWillNotDraw(false);
+ mHandler = new Handler();
mContext = context;
mInternalAccessAdapter = internalAccessAdapter;
mNativeGLDelegate = nativeGLDelegate;
@@ -941,7 +944,7 @@ public class AwContents implements SmartClipProvider,
nativeOnDetachedFromWindow(mNativeAwContents);
}
mIsDestroyed = true;
- new Handler().post(new Runnable() {
+ mHandler.post(new Runnable() {
@Override
public void run() {
destroyNatives();
@@ -2216,7 +2219,7 @@ public class AwContents implements SmartClipProvider,
final VisualStateCallback callback, final long requestId) {
// Posting avoids invoking the callback inside invoking_composite_
// (see synchronous_compositor_impl.cc and crbug/452530).
- mContainerView.getHandler().post(new Runnable() {
+ mHandler.post(new Runnable() {
hush (inactive) 2015/03/04 18:39:08 what's the difference between mContainerView.getHa
boliu 2015/03/04 19:16:43 mHandler is one we create. mContainerView.getHandl
hush (inactive) 2015/03/04 19:39:54 OK.
@Override
public void run() {
callback.onComplete(requestId);

Powered by Google App Engine
This is Rietveld 408576698