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

Unified Diff: google_apis/gaia/oauth2_api_call_flow.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
« no previous file with comments | « google_apis/gaia/oauth2_api_call_flow.h ('k') | google_apis/gaia/oauth2_api_call_flow_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: google_apis/gaia/oauth2_api_call_flow.cc
diff --git a/google_apis/gaia/oauth2_api_call_flow.cc b/google_apis/gaia/oauth2_api_call_flow.cc
index 3d65d7c32d76f7b84dfedc997c03330c7af74bac..d02c8c6181da4dad3677ea0822e2590564cfa58c 100644
--- a/google_apis/gaia/oauth2_api_call_flow.cc
+++ b/google_apis/gaia/oauth2_api_call_flow.cc
@@ -42,7 +42,7 @@ void OAuth2ApiCallFlow::Start(net::URLRequestContextGetter* context,
CHECK(state_ == INITIAL);
state_ = API_CALL_STARTED;
- url_fetcher_.reset(CreateURLFetcher(context, access_token));
+ url_fetcher_ = CreateURLFetcher(context, access_token);
url_fetcher_->Start(); // OnURLFetchComplete will be called.
}
@@ -71,15 +71,13 @@ void OAuth2ApiCallFlow::OnURLFetchComplete(const net::URLFetcher* source) {
EndApiCall(source);
}
-URLFetcher* OAuth2ApiCallFlow::CreateURLFetcher(
+scoped_ptr<URLFetcher> OAuth2ApiCallFlow::CreateURLFetcher(
net::URLRequestContextGetter* context,
const std::string& access_token) {
std::string body = CreateApiCallBody();
bool empty_body = body.empty();
- URLFetcher* result = net::URLFetcher::Create(
- 0,
- CreateApiCallUrl(),
- empty_body ? URLFetcher::GET : URLFetcher::POST,
+ scoped_ptr<URLFetcher> result = net::URLFetcher::Create(
+ 0, CreateApiCallUrl(), empty_body ? URLFetcher::GET : URLFetcher::POST,
this);
result->SetRequestContext(context);
« no previous file with comments | « google_apis/gaia/oauth2_api_call_flow.h ('k') | google_apis/gaia/oauth2_api_call_flow_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698