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

Issue 1810273002: Fix webview memory leak when keyboard was shown (Closed)

Created:
4 years, 9 months ago by Changwan Ryu
Modified:
4 years, 9 months ago
Reviewers:
CC:
chromium-reviews, darin-cc_chromium.org, jam, android-webview-reviews_chromium.org
Base URL:
https://chromium.googlesource.com/a/chromium/src.git@2661
Target Ref:
refs/pending/branch-heads/2661
Project:
chromium
Visibility:
Public.

Description

Fix webview memory leak when keyboard was shown Android framework does not seem to release ResultReceiver passed in InputMethodManager#showSoftInput() after use. As a result, WebView will not be garbage collected after it's removed, if keyboard shows up on the screen once. ResultReceiver cannot be avoided since we want to scroll to the editable node only after input method window shows up. This is a fix to weak-reference CVC object (and thus WebView as well) from ResultReceiver. Unfortunately, ResultReceiver will still be leaked, but the leak can be significantly reduced. A test is added to AwContentsGarbageCollectionTest to test that references to WebView can be removed even when showSoftInput() is called before garbage collection. Also, I've manually tested that the new test can catch the memory leak issue when we strong-reference CVC. BUG=595613 Review URL: https://codereview.chromium.org/1809013002 Cr-Commit-Position: refs/heads/master@{#381891} (cherry picked from commit fcc3fbf1652285b2a89eabd092d35d0fdf199ac2)

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+98 lines, -23 lines) Patch
M android_webview/javatests/src/org/chromium/android_webview/test/AwContentsGarbageCollectionTest.java View 3 chunks +40 lines, -3 lines 0 comments Download
M content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java View 4 chunks +58 lines, -20 lines 0 comments Download

Messages

Total messages: 1 (0 generated)
Changwan Ryu
4 years, 9 months ago (2016-03-18 05:34:59 UTC) #1
Message was sent while issue was closed.
Committed patchset #1 (id:1) to pending queue manually as
789e5bfa9b1e9b805a418a47316d00d5d0d5f1ee.

Powered by Google App Engine
This is Rietveld 408576698