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

Unified Diff: pkg/polymer/lib/src/job.dart

Issue 41293002: Fixes from polymer.dart API review (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Made Job a part of polymer Created 7 years, 2 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
Index: pkg/polymer/lib/src/job.dart
diff --git a/pkg/polymer/lib/job.dart b/pkg/polymer/lib/src/job.dart
similarity index 73%
rename from pkg/polymer/lib/job.dart
rename to pkg/polymer/lib/src/job.dart
index e8a4fa625ec6cd302d8d0ace480e91914e72b28f..5ba818fd3231f1e04686810919fb01e550325a79 100644
--- a/pkg/polymer/lib/job.dart
+++ b/pkg/polymer/lib/src/job.dart
@@ -2,9 +2,7 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-library polymer.job;
-
-import 'dart:async' show Timer;
+part of polymer;
/**
* Invoke [callback] in [wait], unless the job is re-registered,
@@ -15,21 +13,19 @@ import 'dart:async' show Timer;
* Returns a job handle which can be used to re-register a job.
*/
// Dart note: renamed to runJob to avoid conflict with instance member "job".
-Job runJob(Job job, void callback(), Duration wait) {
+_Job _runJob(_Job job, void callback(), Duration wait) {
if (job != null) {
job.stop();
} else {
- job = new Job();
+ job = new _Job();
}
job.go(callback, wait);
return job;
}
-// TODO(jmesserly): it isn't clear to me what is supposed to be public API here.
-// Or what name we should use. "Job" is awfully generic.
-// (The type itself is not exported in Polymer.)
-// Remove this type in favor of Timer?
-class Job {
+// Public in Polymer.js but private as not sure it's the correct API for Dart.
+// Switch to Timer when 14414 is addressed.
+class _Job {
Function _callback;
Timer _timer;

Powered by Google App Engine
This is Rietveld 408576698