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

Unified Diff: google_apis/gaia/oauth2_access_token_fetcher_impl.cc

Issue 1873663002: Convert //google_apis from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 1945c7946d8a411f73198792d03341f19820c163..c029e1be27365c5cf6796dc403cdd7eccd850d3c 100644
--- a/google_apis/gaia/oauth2_access_token_fetcher_impl.cc
+++ b/google_apis/gaia/oauth2_access_token_fetcher_impl.cc
@@ -90,12 +90,13 @@ static GoogleServiceAuthError CreateAuthError(URLRequestStatus status) {
}
}
-static scoped_ptr<URLFetcher> CreateFetcher(URLRequestContextGetter* getter,
- const GURL& url,
- const std::string& body,
- URLFetcherDelegate* delegate) {
+static std::unique_ptr<URLFetcher> CreateFetcher(
+ URLRequestContextGetter* getter,
+ const GURL& url,
+ const std::string& body,
+ URLFetcherDelegate* delegate) {
bool empty_body = body.empty();
- scoped_ptr<URLFetcher> result = net::URLFetcher::Create(
+ std::unique_ptr<URLFetcher> result = net::URLFetcher::Create(
0, url, empty_body ? URLFetcher::GET : URLFetcher::POST, delegate);
result->SetRequestContext(getter);
@@ -113,17 +114,17 @@ static scoped_ptr<URLFetcher> CreateFetcher(URLRequestContextGetter* getter,
return result;
}
-scoped_ptr<base::DictionaryValue> ParseGetAccessTokenResponse(
+std::unique_ptr<base::DictionaryValue> ParseGetAccessTokenResponse(
const net::URLFetcher* source) {
CHECK(source);
std::string data;
source->GetResponseAsString(&data);
- scoped_ptr<base::Value> value = base::JSONReader::Read(data);
+ std::unique_ptr<base::Value> value = base::JSONReader::Read(data);
if (!value.get() || value->GetType() != base::Value::TYPE_DICTIONARY)
value.reset();
- return scoped_ptr<base::DictionaryValue>(
+ return std::unique_ptr<base::DictionaryValue>(
static_cast<base::DictionaryValue*>(value.release()));
}
@@ -299,7 +300,8 @@ bool OAuth2AccessTokenFetcherImpl::ParseGetAccessTokenSuccessResponse(
std::string* access_token,
int* expires_in) {
CHECK(access_token);
- scoped_ptr<base::DictionaryValue> value = ParseGetAccessTokenResponse(source);
+ std::unique_ptr<base::DictionaryValue> value =
+ ParseGetAccessTokenResponse(source);
if (value.get() == NULL)
return false;
@@ -312,7 +314,8 @@ bool OAuth2AccessTokenFetcherImpl::ParseGetAccessTokenFailureResponse(
const net::URLFetcher* source,
std::string* error) {
CHECK(error);
- scoped_ptr<base::DictionaryValue> value = ParseGetAccessTokenResponse(source);
+ std::unique_ptr<base::DictionaryValue> value =
+ ParseGetAccessTokenResponse(source);
if (value.get() == NULL)
return false;
return value->GetString(kErrorKey, error);

Powered by Google App Engine
This is Rietveld 408576698