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

Issue 2537073002: Fix leaks in InputConnectionHandlerThread (Closed)

Created:
4 years ago by Changwan Ryu
Modified:
4 years ago
CC:
chromium-reviews, jam, darin-cc_chromium.org, agrieve+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Fix leaks in InputConnectionHandlerThread On destruction of ContentViewCore and on view detachment, we reset mHandler, allowing it a chance to be garbage-collected. BUG=668692 Committed: https://crrev.com/c703b49a25b8b279fe7cbd1fbfe7ff67493fbf7b Cr-Commit-Position: refs/heads/master@{#435136}

Patch Set 1 #

Total comments: 10

Patch Set 2 : fix tests #

Messages

Total messages: 38 (18 generated)
Changwan Ryu
PTAL
4 years ago (2016-11-29 08:02:36 UTC) #4
Torne
I have one major question: is it actually intended/required that there be one of these ...
4 years ago (2016-11-29 13:22:55 UTC) #8
Torne
OK. We need to get a fix for this in ASAP if we're going to ...
4 years ago (2016-11-29 18:12:25 UTC) #9
sgurun-gerrit only
On 2016/11/29 18:12:25, Torne wrote: > OK. We need to get a fix for this ...
4 years ago (2016-11-29 22:11:14 UTC) #12
sgurun-gerrit only
On 2016/11/29 22:11:14, sgurun wrote: > On 2016/11/29 18:12:25, Torne wrote: > > OK. We ...
4 years ago (2016-11-29 22:13:15 UTC) #13
Ted C
owners lgtm https://codereview.chromium.org/2537073002/diff/1/content/public/android/java/src/org/chromium/content/browser/input/ThreadedInputConnectionFactory.java File content/public/android/java/src/org/chromium/content/browser/input/ThreadedInputConnectionFactory.java (right): https://codereview.chromium.org/2537073002/diff/1/content/public/android/java/src/org/chromium/content/browser/input/ThreadedInputConnectionFactory.java#newcode289 content/public/android/java/src/org/chromium/content/browser/input/ThreadedInputConnectionFactory.java:289: public void destroy() { On 2016/11/29 13:22:55, ...
4 years ago (2016-11-29 22:32:16 UTC) #14
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2537073002/20001
4 years ago (2016-11-29 23:04:36 UTC) #18
Changwan Ryu
To torne@, I haven't looked into the possibility of keeping one global variable for the ...
4 years ago (2016-11-29 23:33:19 UTC) #19
commit-bot: I haz the power
Try jobs failed on following builders: blimp_linux_dbg on master.tryserver.chromium.linux (JOB_TIMED_OUT, no build URL) chromeos_daisy_chromium_compile_only_ng on ...
4 years ago (2016-11-30 01:06:40 UTC) #21
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2537073002/20001
4 years ago (2016-11-30 01:14:36 UTC) #23
commit-bot: I haz the power
Try jobs failed on following builders: blimp_linux_dbg on master.tryserver.chromium.linux (JOB_TIMED_OUT, no build URL) chromeos_x86-generic_chromium_compile_only_ng on ...
4 years ago (2016-11-30 03:16:23 UTC) #25
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2537073002/20001
4 years ago (2016-11-30 03:27:57 UTC) #27
commit-bot: I haz the power
Committed patchset #2 (id:20001)
4 years ago (2016-11-30 07:45:58 UTC) #30
commit-bot: I haz the power
Patchset 2 (id:??) landed as https://crrev.com/c703b49a25b8b279fe7cbd1fbfe7ff67493fbf7b Cr-Commit-Position: refs/heads/master@{#435136}
4 years ago (2016-11-30 07:49:56 UTC) #32
Torne
On 2016/11/29 23:33:19, Changwan Ryu wrote: > To torne@, I haven't looked into the possibility ...
4 years ago (2016-11-30 10:33:26 UTC) #33
Torne
https://codereview.chromium.org/2537073002/diff/1/content/public/android/java/src/org/chromium/content/browser/input/ThreadedInputConnectionFactory.java File content/public/android/java/src/org/chromium/content/browser/input/ThreadedInputConnectionFactory.java (right): https://codereview.chromium.org/2537073002/diff/1/content/public/android/java/src/org/chromium/content/browser/input/ThreadedInputConnectionFactory.java#newcode73 content/public/android/java/src/org/chromium/content/browser/input/ThreadedInputConnectionFactory.java:73: final Handler handler = mHandler; On 2016/11/29 23:33:18, Changwan ...
4 years ago (2016-11-30 10:33:35 UTC) #34
Changwan Ryu
On 2016/11/30 10:33:26, Torne wrote: > On 2016/11/29 23:33:19, Changwan Ryu wrote: > > To ...
4 years ago (2016-12-01 00:05:39 UTC) #35
Changwan Ryu
On 2016/12/01 00:05:39, Changwan Ryu wrote: > On 2016/11/30 10:33:26, Torne wrote: > > On ...
4 years ago (2016-12-01 00:51:33 UTC) #36
Changwan Ryu
A revert of this CL (patchset #2 id:20001) has been created in https://codereview.chromium.org/2546613002/ by changwan@chromium.org. ...
4 years ago (2016-12-01 00:53:51 UTC) #37
Torne
4 years ago (2016-12-01 10:40:16 UTC) #38
Message was sent while issue was closed.
On 2016/12/01 00:05:39, Changwan Ryu wrote:
> On 2016/11/30 10:33:26, Torne wrote:
> > Is there something specific you are concerned about with global variables?
I'm
> > not sure what you mean. We use lots of globals.
> 
> I was concerned about the scenario where an app creates a webview, uses it,
and
> removes it.
> Shouldn't we allow the webview to be garbage-collected in the middle of the
life
> cycle of the app?

> That's why I was curious about the case with # instance going from 1 to 0.
Maybe
> we should still
> quit the loop in this case...

I'm still not 100% sure I get what you mean, but: the instance of WebView
they've stopped using will be garbage collected. There's no reference from the
thread to anything else, right? It's just a standard android HandlerThread that
just runs whatever it's told to.

The chromium code is never unloaded, none of the Java classes can ever be be
garbage collected, none of the native C++ globals are ever cleaned up, and none
of the chromium threads ever exit. Chromium is not designed to have a clean
shutdown process that leaves the process in a state where chromium can be
started up again, and so we don't try - it would be of minimal benefit and just
another source of bugs.

The only property we're preserving is that all resources that are allocated to a
*specific* instance of WebView are cleaned up when that instance of WebView is
GCed. Having a single global thread for handling IME events means it doesn't
belong to any particular WebView and so there's no expected time for it to be
destroyed.

Powered by Google App Engine
This is Rietveld 408576698