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

Side by Side Diff: pkg/oauth2/lib/src/credentials.dart

Issue 12052038: Rename new Uri.fromString to Uri.parse. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Reupload because of Error. 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library credentials; 5 library credentials;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:json' as JSON; 8 import 'dart:json' as JSON;
9 import 'dart:uri'; 9 import 'dart:uri';
10 10
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 validate(value == null || value is String, 98 validate(value == null || value is String,
99 'field "$stringField" was not a string, was "$value"'); 99 'field "$stringField" was not a string, was "$value"');
100 } 100 }
101 101
102 var scopes = parsed['scopes']; 102 var scopes = parsed['scopes'];
103 validate(scopes == null || scopes is List, 103 validate(scopes == null || scopes is List,
104 'field "scopes" was not a list, was "$scopes"'); 104 'field "scopes" was not a list, was "$scopes"');
105 105
106 var tokenEndpoint = parsed['tokenEndpoint']; 106 var tokenEndpoint = parsed['tokenEndpoint'];
107 if (tokenEndpoint != null) { 107 if (tokenEndpoint != null) {
108 tokenEndpoint = new Uri.fromString(tokenEndpoint); 108 tokenEndpoint = Uri.parse(tokenEndpoint);
109 } 109 }
110 var expiration = parsed['expiration']; 110 var expiration = parsed['expiration'];
111 if (expiration != null) { 111 if (expiration != null) {
112 validate(expiration is int, 112 validate(expiration is int,
113 'field "expiration" was not an int, was "$expiration"'); 113 'field "expiration" was not an int, was "$expiration"');
114 expiration = new Date.fromMillisecondsSinceEpoch(expiration); 114 expiration = new Date.fromMillisecondsSinceEpoch(expiration);
115 } 115 }
116 116
117 return new Credentials( 117 return new Credentials(
118 parsed['accessToken'], 118 parsed['accessToken'],
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 if (credentials.refreshToken != null) return credentials; 183 if (credentials.refreshToken != null) return credentials;
184 return new Credentials( 184 return new Credentials(
185 credentials.accessToken, 185 credentials.accessToken,
186 this.refreshToken, 186 this.refreshToken,
187 credentials.tokenEndpoint, 187 credentials.tokenEndpoint,
188 credentials.scopes, 188 credentials.scopes,
189 credentials.expiration); 189 credentials.expiration);
190 }); 190 });
191 } 191 }
192 } 192 }
OLDNEW
« 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