Chromium Code Reviews| Index: android_webview/glue/java/src/com/android/webview/chromium/WebViewContentsClientAdapter.java |
| diff --git a/android_webview/glue/java/src/com/android/webview/chromium/WebViewContentsClientAdapter.java b/android_webview/glue/java/src/com/android/webview/chromium/WebViewContentsClientAdapter.java |
| index 1d28526a597de73ef6dfc7c835b0da7b1f81f555..32dfc46a9ba20a91c287ef3024db66e8814a973c 100644 |
| --- a/android_webview/glue/java/src/com/android/webview/chromium/WebViewContentsClientAdapter.java |
| +++ b/android_webview/glue/java/src/com/android/webview/chromium/WebViewContentsClientAdapter.java |
| @@ -4,6 +4,7 @@ |
| package com.android.webview.chromium; |
| +import android.annotation.SuppressLint; |
| import android.annotation.TargetApi; |
| import android.content.Context; |
| import android.graphics.Bitmap; |
| @@ -110,6 +111,16 @@ public class WebViewContentsClientAdapter extends AwContentsClient { |
| private WeakHashMap<AwPermissionRequest, WeakReference<PermissionRequestAdapter>> |
| mOngoingPermissionRequests; |
| + |
| + // Suppress the handler leak lint warning because: |
| + // 1. the handler does not get GC'ed when there are still pending messages, which does |
| + // not happen when there are no delayed messages. |
| + // 2. If the app returns true for WebChromeClient#onCreateWindow callback but |
| + // does not reply to the message with the WebView instance for the popup, then the |
| + // static handler + weak reference pattern will have to deal with the case where the |
| + // original webview instance being GC'ed by the time NEW_WEBVIEW_CREATED is sent by the |
| + // app. Too much complexity for little gain. |
| + @SuppressLint("HandlerLeak") |
|
boliu
2016/08/24 21:25:43
I say don't bother with the comment. it's bound to
hush (inactive)
2016/08/30 21:58:17
Done.
|
| /** |
| * Adapter constructor. |
| * |