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

Unified Diff: tools/dom/templates/html/impl/impl_Geolocation.darttemplate

Issue 14196003: Change StreamController constructor. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments and rebase. Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests/lib/async/stream_state_helper.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/dom/templates/html/impl/impl_Geolocation.darttemplate
diff --git a/tools/dom/templates/html/impl/impl_Geolocation.darttemplate b/tools/dom/templates/html/impl/impl_Geolocation.darttemplate
index 19447c27f7a833eece15178adbd5dbb54a6dcd99..c4fec21188aa25037d7711fa795c472c8a4b3870 100644
--- a/tools/dom/templates/html/impl/impl_Geolocation.darttemplate
+++ b/tools/dom/templates/html/impl/impl_Geolocation.darttemplate
@@ -54,21 +54,20 @@ $(ANNOTATIONS)class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC {
int watchId;
var controller;
controller = new StreamController<Geoposition>(
- onSubscriptionStateChange: () {
- if (controller.hasListener) {
- assert(watchId == null);
- watchId = $dom_watchPosition(
- (position) {
- controller.add(_ensurePosition(position));
- },
- (error) {
- controller.addError(error);
- },
- options);
- } else {
- assert(watchId != null);
- $dom_clearWatch(watchId);
- }
+ onListen: () {
+ assert(watchId == null);
+ watchId = $dom_watchPosition(
+ (position) {
+ controller.add(_ensurePosition(position));
+ },
+ (error) {
+ controller.addError(error);
+ },
+ options);
+ },
+ onCancel: () {
+ assert(watchId != null);
+ $dom_clearWatch(watchId);
});
return controller.stream;
« no previous file with comments | « tests/lib/async/stream_state_helper.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698