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

Issue 1809643002: Make native AwContents hold a reference to the WindowAndroidWrapper (Closed)

Created:
4 years, 9 months ago by Tobias Sargeant
Modified:
4 years, 9 months ago
Reviewers:
boliu, Torne
CC:
chromium-reviews, android-webview-reviews_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Ensure that native WindowAndroid outlives native AwContents. ContentViewCore holds a window pointer that is used during destruction of native AwContents to remove observers. However the current CleanupReference based finalization scheme does not enforce an ordering on the destruction of native WindowAndroid and AwContents instances. Satisfaction of the constraint that AwContents is destroyed before WindowAndroid is therefore dependent on the CleanupReference implementation, and possibly the implementation of the JVM as well. Making the AwContents DestroyRunnable strongly reference the associated WindowAndroidWrapper enforces the correct ordering. BUG=595336 Committed: https://crrev.com/81a813fcee09c1ed0f299aba3b589e3705238875 Cr-Commit-Position: refs/heads/master@{#381675}

Patch Set 1 #

Patch Set 2 : Hold the WindowAndroidWrapper reference on the Java side #

Unified diffs Side-by-side diffs Delta from patch set Stats (+6 lines, -2 lines) Patch
M android_webview/java/src/org/chromium/android_webview/AwContents.java View 1 2 chunks +6 lines, -2 lines 0 comments Download

Messages

Total messages: 29 (9 generated)
Tobias Sargeant
4 years, 9 months ago (2016-03-16 15:33:29 UTC) #3
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1809643002/1 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1809643002/1
4 years, 9 months ago (2016-03-16 15:33:36 UTC) #4
boliu
What if you kept the reference in DestroyRunnable instead?
4 years, 9 months ago (2016-03-16 15:45:37 UTC) #5
Tobias Sargeant
On 2016/03/16 15:45:37, boliu wrote: > What if you kept the reference in DestroyRunnable instead? ...
4 years, 9 months ago (2016-03-16 15:49:16 UTC) #6
boliu
On 2016/03/16 15:49:16, Tobias Sargeant wrote: > On 2016/03/16 15:45:37, boliu wrote: > > What ...
4 years, 9 months ago (2016-03-16 15:54:03 UTC) #7
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 9 months ago (2016-03-16 16:08:25 UTC) #9
Torne
On 2016/03/16 15:54:03, boliu wrote: > On 2016/03/16 15:49:16, Tobias Sargeant wrote: > > On ...
4 years, 9 months ago (2016-03-16 16:46:03 UTC) #10
Tobias Sargeant
I think given that neither approach can guarantee that holding on to a WindowAndroid instance ...
4 years, 9 months ago (2016-03-16 17:24:01 UTC) #11
boliu
On 2016/03/16 16:46:03, Torne wrote: > On 2016/03/16 15:54:03, boliu wrote: > > On 2016/03/16 ...
4 years, 9 months ago (2016-03-16 17:26:21 UTC) #14
Torne
On 2016/03/16 17:26:21, boliu wrote: > On 2016/03/16 16:46:03, Torne wrote: > > On 2016/03/16 ...
4 years, 9 months ago (2016-03-16 17:29:51 UTC) #15
boliu
On 2016/03/16 17:29:51, Torne wrote: > On 2016/03/16 17:26:21, boliu wrote: > > On 2016/03/16 ...
4 years, 9 months ago (2016-03-16 17:38:28 UTC) #16
boliu
On 2016/03/16 17:38:28, boliu wrote: > On 2016/03/16 17:29:51, Torne wrote: > > On 2016/03/16 ...
4 years, 9 months ago (2016-03-16 19:01:15 UTC) #17
boliu
Oh check it out. This affects M too: https://build.chromium.org/p/chromium.android/builders/Marshmallow%2064%20bit%20Tester/builds/1105 first failure of testCreateAndGcManyTimes contains my ...
4 years, 9 months ago (2016-03-16 20:53:08 UTC) #18
boliu
On 2016/03/16 20:53:08, boliu wrote: > Oh check it out. This affects M too: > ...
4 years, 9 months ago (2016-03-16 20:57:16 UTC) #19
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1809643002/20001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1809643002/20001
4 years, 9 months ago (2016-03-17 09:13:57 UTC) #22
commit-bot: I haz the power
Committed patchset #2 (id:20001)
4 years, 9 months ago (2016-03-17 09:43:49 UTC) #24
commit-bot: I haz the power
Patchset 2 (id:??) landed as https://crrev.com/81a813fcee09c1ed0f299aba3b589e3705238875 Cr-Commit-Position: refs/heads/master@{#381675}
4 years, 9 months ago (2016-03-17 09:45:05 UTC) #26
Torne
Change itself LGTM, for the record; both ways suck, and this is smaller, so hey. ...
4 years, 9 months ago (2016-03-17 10:21:41 UTC) #27
boliu
On 2016/03/17 10:21:41, Torne wrote: > Change itself LGTM, for the record; both ways suck, ...
4 years, 9 months ago (2016-03-17 14:16:55 UTC) #28
Torne
4 years, 9 months ago (2016-03-17 14:36:25 UTC) #29
Message was sent while issue was closed.
On 2016/03/17 14:16:55, boliu wrote:
> Oh I see. A dirty hack would be have WindowAndroid hold the CleanupReference
> after both are created. Maybe not as dirty as all the issues as I said
> previously..

Yeah.. really not sure what the ideal way to structure this is, all the options
seem pretty hacky in slightly different ways :(

Powered by Google App Engine
This is Rietveld 408576698