Chromium Code Reviews| 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); |