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

Issue 10532123: - Move the Timer interface to the dart:isolate library so that it (Closed)

Created:
8 years, 6 months ago by Ivan Posva
Modified:
8 years, 6 months ago
CC:
reviews_dartlang.org
Visibility:
Public.

Description

- Move the Timer interface to the dart:isolate library so that it is accessible from both client and standalone program. - Enable a way for the embedder to provide the implementation of the Timer interface. - Update tests. Committed: https://code.google.com/p/dart/source/detail?r=8987

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : #

Patch Set 4 : #

Patch Set 5 : #

Total comments: 5

Patch Set 6 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+113 lines, -48 lines) Patch
M lib/compiler/implementation/lib/io.dart View 1 2 3 4 5 1 chunk +0 lines, -1 line 0 comments Download
M lib/isolate/isolate_leg.dart View 1 2 3 4 5 1 chunk +2 lines, -0 lines 0 comments Download
A lib/isolate/timer.dart View 1 2 3 4 5 1 chunk +22 lines, -0 lines 0 comments Download
A lib/isolate/timer_hook.dart View 1 2 3 4 5 1 chunk +32 lines, -0 lines 0 comments Download
M runtime/bin/builtin.h View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M runtime/bin/builtin_natives.cc View 1 2 3 4 5 1 chunk +12 lines, -13 lines 0 comments Download
M runtime/bin/builtin_nolib.cc View 1 2 3 4 5 1 chunk +7 lines, -1 line 0 comments Download
M runtime/bin/io_sources.gypi View 1 2 3 4 5 1 chunk +0 lines, -1 line 0 comments Download
M runtime/bin/main.cc View 1 2 3 4 5 2 chunks +8 lines, -2 lines 0 comments Download
D runtime/bin/timer.dart View 1 2 3 4 5 1 chunk +0 lines, -23 lines 0 comments Download
M runtime/bin/timer_impl.dart View 1 2 3 4 5 1 chunk +12 lines, -0 lines 0 comments Download
M runtime/lib/isolate_sources.gypi View 1 2 3 4 5 1 chunk +2 lines, -0 lines 0 comments Download
M tests/standalone/io/multiple_timer_test.dart View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M tests/standalone/io/test_runner_test.dart View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download
M tests/standalone/io/timer_cancel1_test.dart View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M tests/standalone/io/timer_cancel2_test.dart View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M tests/standalone/io/timer_cancel_test.dart View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M tests/standalone/io/timer_repeat_test.dart View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M tests/standalone/io/timer_test.dart View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M tests/standalone/standalone.status View 1 2 3 4 5 1 chunk +6 lines, -0 lines 0 comments Download
M tools/testing/dart/test_runner.dart View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download
M utils/tests/pub/version_solver_test.dart View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 7 (0 generated)
Ivan Posva
8 years, 6 months ago (2012-06-13 12:04:01 UTC) #1
Mads Ager (google)
lgtm
8 years, 6 months ago (2012-06-13 13:07:52 UTC) #2
siva
LGTM with one comment regarding LoadLibrary https://chromiumcodereview.appspot.com/10532123/diff/1018/runtime/bin/builtin_natives.cc File runtime/bin/builtin_natives.cc (right): https://chromiumcodereview.appspot.com/10532123/diff/1018/runtime/bin/builtin_natives.cc#newcode142 runtime/bin/builtin_natives.cc:142: void Builtin::SetupIOLibrary(Dart_Handle io_lib) ...
8 years, 6 months ago (2012-06-13 17:05:23 UTC) #3
Siggi Cherem (dart-lang)
lgtm, a couple general comments - rename timer_api.dart to simply timer.dart? (in the case of ...
8 years, 6 months ago (2012-06-13 17:16:39 UTC) #4
Siggi Cherem (dart-lang)
https://chromiumcodereview.appspot.com/10532123/diff/1018/lib/isolate/timer_api.dart File lib/isolate/timer_api.dart (right): https://chromiumcodereview.appspot.com/10532123/diff/1018/lib/isolate/timer_api.dart#newcode28 lib/isolate/timer_api.dart:28: class _TimerFactory { can we split this file, moving ...
8 years, 6 months ago (2012-06-13 17:21:12 UTC) #5
Anton Muhin
lgtm
8 years, 6 months ago (2012-06-18 19:07:09 UTC) #6
Ivan Posva
8 years, 6 months ago (2012-06-21 16:17:06 UTC) #7
https://chromiumcodereview.appspot.com/10532123/diff/1018/runtime/bin/builtin...
File runtime/bin/builtin_natives.cc (right):

https://chromiumcodereview.appspot.com/10532123/diff/1018/runtime/bin/builtin...
runtime/bin/builtin_natives.cc:142: void Builtin::SetupIOLibrary(Dart_Handle
io_lib) {
On 2012/06/13 17:05:23, asiva wrote:
> The name SetupIOLibrary seems misleading as the function is not really setting
> up the IO library.
> 
> How about SetupTimerImpl(....) ?

I imagine that we will have more than Timer being hooked eventually.

https://chromiumcodereview.appspot.com/10532123/diff/1018/runtime/bin/main.cc
File runtime/bin/main.cc (right):

https://chromiumcodereview.appspot.com/10532123/diff/1018/runtime/bin/main.cc...
runtime/bin/main.cc:511: Builtin::kIOLibrary);
On 2012/06/13 17:05:23, asiva wrote:
> I would prefer if we did a Dart_LookupLibrary here instead
> of Builtin::LoadLibrary. We are expected to find the library here. If for some
> reason there is a bug in the snapshot generation we want to assert out when
the
> library is not found instead of silently loading it.

Agreed, but this needs a whole restructuring of the Builtin loading code which
is not part of this change. Also you currently get an assert within
Builtin::LoadLibrary if the library is not found, even if this is not
necessarily the way you wanted to.

If we want to make this change then it should come together with a change to
reduce the standalone snapshot size and making some of the non-critical
libraries loadable from source.

Powered by Google App Engine
This is Rietveld 408576698