Refactor http.Client and http.BaseClient to allow http.Client in type annotations.
Review URL: https://codereview.chromium.org//11308111
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15124 260f80e4-7a28-3924-810f-c04153c831b5
diff --git a/lib/src/authorization_code_grant.dart b/lib/src/authorization_code_grant.dart
index b4c50d9..dcb36d0 100644
--- a/lib/src/authorization_code_grant.dart
+++ b/lib/src/authorization_code_grant.dart
@@ -75,7 +75,7 @@
final Uri tokenEndpoint;
/// The HTTP client used to make HTTP requests.
- http.BaseClient _httpClient;
+ http.Client _httpClient;
/// The URL to which the resource owner will be redirected after they
/// authorize this client with the authorization server.
@@ -101,7 +101,7 @@
this.secret,
this.authorizationEndpoint,
this.tokenEndpoint,
- {http.BaseClient httpClient})
+ {http.Client httpClient})
: _httpClient = httpClient == null ? new http.Client() : httpClient;
/// Returns the URL to which the resource owner should be redirected to
diff --git a/lib/src/client.dart b/lib/src/client.dart
index dc71e40..7322afa 100644
--- a/lib/src/client.dart
+++ b/lib/src/client.dart
@@ -14,9 +14,8 @@
// TODO(nweiz): Add an onCredentialsRefreshed event once we have some event
// infrastructure.
-/// An OAuth2 client. This acts as a drop-in replacement for an
-/// [http.BaseClient], while sending OAuth2 authorization credentials along with
-/// each request.
+/// An OAuth2 client. This acts as a drop-in replacement for an [http.Client],
+/// while sending OAuth2 authorization credentials along with each request.
///
/// The client also automatically refreshes its credentials if possible. When it
/// makes a request, if its credentials are expired, it will first refresh them.
@@ -62,7 +61,7 @@
Credentials _credentials;
/// The underlying HTTP client.
- http.BaseClient _httpClient;
+ http.Client _httpClient;
/// Creates a new client from a pre-existing set of credentials. When
/// authorizing a client for the first time, you should use
@@ -74,7 +73,7 @@
this.identifier,
this.secret,
this._credentials,
- {http.BaseClient httpClient})
+ {http.Client httpClient})
: _httpClient = httpClient == null ? new http.Client() : httpClient;
/// Sends an HTTP request with OAuth2 authorization credentials attached. This
diff --git a/lib/src/credentials.dart b/lib/src/credentials.dart
index 1a35827..89af777 100644
--- a/lib/src/credentials.dart
+++ b/lib/src/credentials.dart
@@ -145,7 +145,7 @@
String identifier,
String secret,
{List<String> newScopes,
- http.BaseClient httpClient}) {
+ http.Client httpClient}) {
var scopes = this.scopes;
if (newScopes != null) scopes = newScopes;
if (scopes == null) scopes = <String>[];