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

Unified Diff: google_apis/gaia/oauth2_access_token_fetcher_impl.cc

Issue 1117703002: Adjust URLFetcher::Create API so that object is returned as scoped_ptr. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove unneeded Pass() calls Created 5 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
Index: google_apis/gaia/oauth2_access_token_fetcher_impl.cc
diff --git a/google_apis/gaia/oauth2_access_token_fetcher_impl.cc b/google_apis/gaia/oauth2_access_token_fetcher_impl.cc
index 08e45d2e18b423b0458a6e85eed6fe6907ec7b46..1d5980e4e9ba0bcff6aaea32d9895548991f4414 100644
--- a/google_apis/gaia/oauth2_access_token_fetcher_impl.cc
+++ b/google_apis/gaia/oauth2_access_token_fetcher_impl.cc
@@ -90,12 +90,12 @@ static GoogleServiceAuthError CreateAuthError(URLRequestStatus status) {
}
}
-static URLFetcher* CreateFetcher(URLRequestContextGetter* getter,
- const GURL& url,
- const std::string& body,
- URLFetcherDelegate* delegate) {
+static scoped_ptr<URLFetcher> CreateFetcher(URLRequestContextGetter* getter,
+ const GURL& url,
+ const std::string& body,
+ URLFetcherDelegate* delegate) {
bool empty_body = body.empty();
- URLFetcher* result = net::URLFetcher::Create(
+ scoped_ptr<URLFetcher> result = net::URLFetcher::Create(
0, url, empty_body ? URLFetcher::GET : URLFetcher::POST, delegate);
result->SetRequestContext(getter);
@@ -155,12 +155,10 @@ void OAuth2AccessTokenFetcherImpl::Start(
void OAuth2AccessTokenFetcherImpl::StartGetAccessToken() {
CHECK_EQ(INITIAL, state_);
state_ = GET_ACCESS_TOKEN_STARTED;
- fetcher_.reset(
- CreateFetcher(getter_,
- MakeGetAccessTokenUrl(),
- MakeGetAccessTokenBody(
- client_id_, client_secret_, refresh_token_, scopes_),
- this));
+ fetcher_ = CreateFetcher(getter_, MakeGetAccessTokenUrl(),
+ MakeGetAccessTokenBody(client_id_, client_secret_,
+ refresh_token_, scopes_),
+ this);
fetcher_->Start(); // OnURLFetchComplete will be called.
}
« no previous file with comments | « google_apis/gaia/mock_url_fetcher_factory.h ('k') | google_apis/gaia/oauth2_access_token_fetcher_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698