summaryrefslogtreecommitdiffstats
path: root/google_apis
diff options
context:
space:
mode:
authorestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-10-01 16:20:19 +0000
committerestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-10-01 16:20:19 +0000
commitc97496b98c8493f96867b5281ca9a468c2896c13 (patch)
tree69634019af059b717339cf43eb632455fa807df2 /google_apis
parentc5363bc56306ea3e19dcfac834c9af564774b267 (diff)
downloadchromium_src-c97496b98c8493f96867b5281ca9a468c2896c13.zip
chromium_src-c97496b98c8493f96867b5281ca9a468c2896c13.tar.gz
chromium_src-c97496b98c8493f96867b5281ca9a468c2896c13.tar.bz2
Don't allow OAuth2MintTokenFlow to outlive profile.
BUG=150911 Review URL: https://codereview.chromium.org/10966009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@159502 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'google_apis')
-rw-r--r--google_apis/gaia/oauth2_mint_token_flow.cc13
-rw-r--r--google_apis/gaia/oauth2_mint_token_flow.h8
2 files changed, 0 insertions, 21 deletions
diff --git a/google_apis/gaia/oauth2_mint_token_flow.cc b/google_apis/gaia/oauth2_mint_token_flow.cc
index 66dd1a0..88f2878a 100644
--- a/google_apis/gaia/oauth2_mint_token_flow.cc
+++ b/google_apis/gaia/oauth2_mint_token_flow.cc
@@ -96,23 +96,14 @@ OAuth2MintTokenFlow::OAuth2MintTokenFlow(
: OAuth2ApiCallFlow(
context, parameters.login_refresh_token,
"", std::vector<std::string>()),
- context_(context),
delegate_(delegate),
parameters_(parameters),
- delete_when_done_(false),
ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)) {
}
OAuth2MintTokenFlow::~OAuth2MintTokenFlow() { }
-void OAuth2MintTokenFlow::FireAndForget() {
- delete_when_done_ = true;
- Start();
-}
-
void OAuth2MintTokenFlow::ReportSuccess(const std::string& access_token) {
- scoped_ptr<OAuth2MintTokenFlow> will_delete(delete_when_done_ ? this : NULL);
-
if (delegate_)
delegate_->OnMintTokenSuccess(access_token);
@@ -121,8 +112,6 @@ void OAuth2MintTokenFlow::ReportSuccess(const std::string& access_token) {
void OAuth2MintTokenFlow::ReportIssueAdviceSuccess(
const IssueAdviceInfo& issue_advice) {
- scoped_ptr<OAuth2MintTokenFlow> will_delete(delete_when_done_ ? this : NULL);
-
if (delegate_)
delegate_->OnIssueAdviceSuccess(issue_advice);
@@ -131,8 +120,6 @@ void OAuth2MintTokenFlow::ReportIssueAdviceSuccess(
void OAuth2MintTokenFlow::ReportFailure(
const GoogleServiceAuthError& error) {
- scoped_ptr<OAuth2MintTokenFlow> will_delete(delete_when_done_ ? this : NULL);
-
if (delegate_)
delegate_->OnMintTokenFailure(error);
diff --git a/google_apis/gaia/oauth2_mint_token_flow.h b/google_apis/gaia/oauth2_mint_token_flow.h
index cdca9ec..40850b4 100644
--- a/google_apis/gaia/oauth2_mint_token_flow.h
+++ b/google_apis/gaia/oauth2_mint_token_flow.h
@@ -103,10 +103,6 @@ class OAuth2MintTokenFlow : public OAuth2ApiCallFlow {
const Parameters& parameters);
virtual ~OAuth2MintTokenFlow();
- // Starts the flow, and deletes |this| when done. Useful when the caller
- // does not care about the response (|delegate_| is NULL).
- void FireAndForget();
-
protected:
// Implementation of template methods in OAuth2ApiCallFlow.
virtual GURL CreateApiCallUrl() OVERRIDE;
@@ -139,12 +135,8 @@ class OAuth2MintTokenFlow : public OAuth2ApiCallFlow {
static bool ParseMintTokenResponse(
const base::DictionaryValue* dict, std::string* access_token);
- net::URLRequestContextGetter* context_;
Delegate* delegate_;
Parameters parameters_;
- // If true, |this| owns itself and will delete itself after reporting
- // success or failure.
- bool delete_when_done_;
base::WeakPtrFactory<OAuth2MintTokenFlow> weak_factory_;
DISALLOW_COPY_AND_ASSIGN(OAuth2MintTokenFlow);