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

Issue 10689120: Add test for garbage collected window event listeners issue. (Closed)

Created:
8 years, 5 months ago by podivilov
Modified:
8 years, 5 months ago
Reviewers:
Anton Muhin
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Add test for garbage collected window event listeners issue. R=antonm@google.com Committed: https://code.google.com/p/dart/source/detail?r=9497

Patch Set 1 #

Total comments: 2

Patch Set 2 : . #

Total comments: 6
Unified diffs Side-by-side diffs Delta from patch set Stats (+20 lines, -0 lines) Patch
M tests/html/native_gc_test.dart View 1 1 chunk +20 lines, -0 lines 6 comments Download

Messages

Total messages: 8 (0 generated)
podivilov
8 years, 5 months ago (2012-07-06 14:02:02 UTC) #1
Anton Muhin
https://chromiumcodereview.appspot.com/10689120/diff/1/tests/html/native_gc_test.dart File tests/html/native_gc_test.dart (right): https://chromiumcodereview.appspot.com/10689120/diff/1/tests/html/native_gc_test.dart#newcode40 tests/html/native_gc_test.dart:40: testDiv.on.click.add(expectAsync1((e) {})); isn't it too fragile to depend on ...
8 years, 5 months ago (2012-07-06 15:06:15 UTC) #2
podivilov
https://chromiumcodereview.appspot.com/10689120/diff/1/tests/html/native_gc_test.dart File tests/html/native_gc_test.dart (right): https://chromiumcodereview.appspot.com/10689120/diff/1/tests/html/native_gc_test.dart#newcode40 tests/html/native_gc_test.dart:40: testDiv.on.click.add(expectAsync1((e) {})); On 2012/07/06 15:06:15, antonmuhin wrote: > isn't ...
8 years, 5 months ago (2012-07-06 16:08:19 UTC) #3
Anton Muhin
lgtm https://chromiumcodereview.appspot.com/10689120/diff/5001/tests/html/native_gc_test.dart File tests/html/native_gc_test.dart (right): https://chromiumcodereview.appspot.com/10689120/diff/5001/tests/html/native_gc_test.dart#newcode50 tests/html/native_gc_test.dart:50: List list = new List(1000000); somewhat fragile, but, ...
8 years, 5 months ago (2012-07-06 16:17:01 UTC) #4
podivilov
https://chromiumcodereview.appspot.com/10689120/diff/5001/tests/html/native_gc_test.dart File tests/html/native_gc_test.dart (right): https://chromiumcodereview.appspot.com/10689120/diff/5001/tests/html/native_gc_test.dart#newcode52 tests/html/native_gc_test.dart:52: div.on.click.add((e) => print(list[0])); On 2012/07/06 16:17:01, antonmuhin wrote: > ...
8 years, 5 months ago (2012-07-10 08:33:52 UTC) #5
Anton Muhin
https://chromiumcodereview.appspot.com/10689120/diff/5001/tests/html/native_gc_test.dart File tests/html/native_gc_test.dart (right): https://chromiumcodereview.appspot.com/10689120/diff/5001/tests/html/native_gc_test.dart#newcode52 tests/html/native_gc_test.dart:52: div.on.click.add((e) => print(list[0])); It's not obvious why code which ...
8 years, 5 months ago (2012-07-10 08:41:38 UTC) #6
podivilov
https://chromiumcodereview.appspot.com/10689120/diff/5001/tests/html/native_gc_test.dart File tests/html/native_gc_test.dart (right): https://chromiumcodereview.appspot.com/10689120/diff/5001/tests/html/native_gc_test.dart#newcode52 tests/html/native_gc_test.dart:52: div.on.click.add((e) => print(list[0])); On 2012/07/10 08:41:38, antonmuhin wrote: > ...
8 years, 5 months ago (2012-07-10 11:03:47 UTC) #7
Anton Muhin
8 years, 5 months ago (2012-07-10 11:36:16 UTC) #8
https://chromiumcodereview.appspot.com/10689120/diff/5001/tests/html/native_g...
File tests/html/native_gc_test.dart (right):

https://chromiumcodereview.appspot.com/10689120/diff/5001/tests/html/native_g...
tests/html/native_gc_test.dart:52: div.on.click.add((e) => print(list[0]));
That's a good point, but in this case you'd better store into some global state,
as GC should collect div element, and therefore its closure and this reference
too.

But up to you.

On 2012/07/10 11:03:47, podivilov wrote:
> On 2012/07/10 08:41:38, antonmuhin wrote:
> > It's not obvious why code which promises to trigger GC needs to install any
> > event listeners.
> > 
> 
> Is it possible that void foo() { List list = new List(1000000); } will be
> compiled into no-op?
> And shouldn't we somehow retain this list from embedder's code to make sure it
> won't be collected on minor GC?
>

Powered by Google App Engine
This is Rietveld 408576698