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

Side by Side Diff: chrome/common/net/gaia/oauth2_mint_token_fetcher.cc

Issue 9596001: Coverity: Fix pass-by-value. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « chrome/common/net/gaia/oauth2_mint_token_fetcher.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #include "chrome/common/net/gaia/oauth2_mint_token_fetcher.h" 5 #include "chrome/common/net/gaia/oauth2_mint_token_fetcher.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 9
10 #include "base/json/json_reader.h" 10 #include "base/json/json_reader.h"
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 std::string access_token; 130 std::string access_token;
131 ParseMintTokenResponse(source, &access_token); 131 ParseMintTokenResponse(source, &access_token);
132 OnMintTokenSuccess(access_token); 132 OnMintTokenSuccess(access_token);
133 } 133 }
134 134
135 void OAuth2MintTokenFetcher::OnMintTokenSuccess( 135 void OAuth2MintTokenFetcher::OnMintTokenSuccess(
136 const std::string& access_token) { 136 const std::string& access_token) {
137 consumer_->OnMintTokenSuccess(access_token); 137 consumer_->OnMintTokenSuccess(access_token);
138 } 138 }
139 139
140 void OAuth2MintTokenFetcher::OnMintTokenFailure(GoogleServiceAuthError error) { 140 void OAuth2MintTokenFetcher::OnMintTokenFailure(
141 const GoogleServiceAuthError& error) {
141 state_ = ERROR_STATE; 142 state_ = ERROR_STATE;
142 consumer_->OnMintTokenFailure(error); 143 consumer_->OnMintTokenFailure(error);
143 } 144 }
144 145
145 void OAuth2MintTokenFetcher::OnURLFetchComplete(const URLFetcher* source) { 146 void OAuth2MintTokenFetcher::OnURLFetchComplete(const URLFetcher* source) {
146 CHECK(source); 147 CHECK(source);
147 CHECK_EQ(MINT_TOKEN_STARTED, state_); 148 CHECK_EQ(MINT_TOKEN_STARTED, state_);
148 EndMintToken(source); 149 EndMintToken(source);
149 } 150 }
150 151
(...skipping 29 matching lines...) Expand all
180 std::string data; 181 std::string data;
181 source->GetResponseAsString(&data); 182 source->GetResponseAsString(&data);
182 base::JSONReader reader; 183 base::JSONReader reader;
183 scoped_ptr<base::Value> value(reader.Read(data, false)); 184 scoped_ptr<base::Value> value(reader.Read(data, false));
184 if (!value.get() || value->GetType() != base::Value::TYPE_DICTIONARY) 185 if (!value.get() || value->GetType() != base::Value::TYPE_DICTIONARY)
185 return false; 186 return false;
186 187
187 DictionaryValue* dict = static_cast<DictionaryValue*>(value.get()); 188 DictionaryValue* dict = static_cast<DictionaryValue*>(value.get());
188 return dict->GetString(kAccessTokenKey, access_token); 189 return dict->GetString(kAccessTokenKey, access_token);
189 } 190 }
OLDNEW
« no previous file with comments | « chrome/common/net/gaia/oauth2_mint_token_fetcher.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698