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); |