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

Unified Diff: pkg/oauth2/lib/src/credentials.dart

Issue 11770004: Rename Date to DateTime. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments and keep Backwards-compatibility class Date. Created 7 years, 11 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/oauth2/lib/src/credentials.dart
diff --git a/pkg/oauth2/lib/src/credentials.dart b/pkg/oauth2/lib/src/credentials.dart
index 12a0be8fd82f816133bc8c9346903c2643c72c1e..d476e78f94d7b9dda15d1408486ab688768c0300 100644
--- a/pkg/oauth2/lib/src/credentials.dart
+++ b/pkg/oauth2/lib/src/credentials.dart
@@ -44,13 +44,13 @@ class Credentials {
/// The date at which these credentials will expire. This is likely to be a
/// few seconds earlier than the server's idea of the expiration date.
- final Date expiration;
+ final DateTime expiration;
/// Whether or not these credentials have expired. Note that it's possible the
/// credentials will expire shortly after this is called. However, since the
/// client's expiration date is kept a few seconds earlier than the server's,
/// there should be enough leeway to rely on this.
- bool get isExpired => expiration != null && new Date.now() > expiration;
+ bool get isExpired => expiration != null && new DateTime.now() > expiration;
/// Whether it's possible to refresh these credentials.
bool get canRefresh => refreshToken != null && tokenEndpoint != null;
@@ -111,7 +111,7 @@ class Credentials {
if (expiration != null) {
validate(expiration is int,
'field "expiration" was not an int, was "$expiration"');
- expiration = new Date.fromMillisecondsSinceEpoch(expiration);
+ expiration = new DateTime.fromMillisecondsSinceEpoch(expiration);
}
return new Credentials(
@@ -152,7 +152,7 @@ class Credentials {
if (scopes == null) scopes = <String>[];
if (httpClient == null) httpClient = new http.Client();
- var startTime = new Date.now();
+ var startTime = new DateTime.now();
return async.then((_) {
if (refreshToken == null) {
throw new StateError("Can't refresh credentials without a refresh "
« no previous file with comments | « pkg/oauth2/lib/src/authorization_code_grant.dart ('k') | pkg/oauth2/lib/src/handle_access_token_response.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698