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

Side by Side Diff: google_apis/gaia/oauth2_api_call_flow.h

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, 7 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef GOOGLE_APIS_GAIA_OAUTH2_API_CALL_FLOW_H_ 5 #ifndef GOOGLE_APIS_GAIA_OAUTH2_API_CALL_FLOW_H_
6 #define GOOGLE_APIS_GAIA_OAUTH2_API_CALL_FLOW_H_ 6 #define GOOGLE_APIS_GAIA_OAUTH2_API_CALL_FLOW_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/gtest_prod_util.h" 10 #include "base/gtest_prod_util.h"
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 INITIAL, 57 INITIAL,
58 API_CALL_STARTED, 58 API_CALL_STARTED,
59 API_CALL_DONE, 59 API_CALL_DONE,
60 ERROR_STATE 60 ERROR_STATE
61 }; 61 };
62 62
63 // Creates an instance of URLFetcher that does not send or save cookies. 63 // Creates an instance of URLFetcher that does not send or save cookies.
64 // Template method CreateApiCallUrl is used to get the URL. 64 // Template method CreateApiCallUrl is used to get the URL.
65 // Template method CreateApiCallBody is used to get the body. 65 // Template method CreateApiCallBody is used to get the body.
66 // The URLFether's method will be GET if body is empty, POST otherwise. 66 // The URLFether's method will be GET if body is empty, POST otherwise.
67 // Caller owns the returned instance. 67 scoped_ptr<net::URLFetcher> CreateURLFetcher(
68 net::URLFetcher* CreateURLFetcher(net::URLRequestContextGetter* context, 68 net::URLRequestContextGetter* context,
69 const std::string& access_token); 69 const std::string& access_token);
70 70
71 // Helper methods to implement the state machine for the flow. 71 // Helper methods to implement the state machine for the flow.
72 void BeginApiCall(); 72 void BeginApiCall();
73 void EndApiCall(const net::URLFetcher* source); 73 void EndApiCall(const net::URLFetcher* source);
74 74
75 State state_; 75 State state_;
76 scoped_ptr<net::URLFetcher> url_fetcher_; 76 scoped_ptr<net::URLFetcher> url_fetcher_;
77 77
78 DISALLOW_COPY_AND_ASSIGN(OAuth2ApiCallFlow); 78 DISALLOW_COPY_AND_ASSIGN(OAuth2ApiCallFlow);
79 }; 79 };
80 80
81 #endif // GOOGLE_APIS_GAIA_OAUTH2_API_CALL_FLOW_H_ 81 #endif // GOOGLE_APIS_GAIA_OAUTH2_API_CALL_FLOW_H_
OLDNEW
« no previous file with comments | « google_apis/gaia/oauth2_access_token_fetcher_impl_unittest.cc ('k') | google_apis/gaia/oauth2_api_call_flow.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698