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

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

Issue 9007025: Coverity fix: Big parameter passed by value (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase trunk Created 8 years, 11 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_access_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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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_access_token_fetcher.h" 5 #include "chrome/common/net/gaia/oauth2_access_token_fetcher.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 std::string access_token; 145 std::string access_token;
146 ParseGetAccessTokenResponse(source, &access_token); 146 ParseGetAccessTokenResponse(source, &access_token);
147 OnGetTokenSuccess(access_token); 147 OnGetTokenSuccess(access_token);
148 } 148 }
149 149
150 void OAuth2AccessTokenFetcher::OnGetTokenSuccess( 150 void OAuth2AccessTokenFetcher::OnGetTokenSuccess(
151 const std::string& access_token) { 151 const std::string& access_token) {
152 consumer_->OnGetTokenSuccess(access_token); 152 consumer_->OnGetTokenSuccess(access_token);
153 } 153 }
154 154
155 void OAuth2AccessTokenFetcher::OnGetTokenFailure(GoogleServiceAuthError error) { 155 void OAuth2AccessTokenFetcher::OnGetTokenFailure(
156 const GoogleServiceAuthError& error) {
156 state_ = ERROR_STATE; 157 state_ = ERROR_STATE;
157 consumer_->OnGetTokenFailure(error); 158 consumer_->OnGetTokenFailure(error);
158 } 159 }
159 160
160 void OAuth2AccessTokenFetcher::OnURLFetchComplete(const URLFetcher* source) { 161 void OAuth2AccessTokenFetcher::OnURLFetchComplete(const URLFetcher* source) {
161 CHECK(source); 162 CHECK(source);
162 CHECK(state_ == GET_ACCESS_TOKEN_STARTED); 163 CHECK(state_ == GET_ACCESS_TOKEN_STARTED);
163 EndGetAccessToken(source); 164 EndGetAccessToken(source);
164 } 165 }
165 166
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 std::string data; 206 std::string data;
206 source->GetResponseAsString(&data); 207 source->GetResponseAsString(&data);
207 base::JSONReader reader; 208 base::JSONReader reader;
208 scoped_ptr<base::Value> value(reader.Read(data, false)); 209 scoped_ptr<base::Value> value(reader.Read(data, false));
209 if (!value.get() || value->GetType() != base::Value::TYPE_DICTIONARY) 210 if (!value.get() || value->GetType() != base::Value::TYPE_DICTIONARY)
210 return false; 211 return false;
211 212
212 DictionaryValue* dict = static_cast<DictionaryValue*>(value.get()); 213 DictionaryValue* dict = static_cast<DictionaryValue*>(value.get());
213 return GetStringFromDictionary(dict, kAccessTokenKey, access_token); 214 return GetStringFromDictionary(dict, kAccessTokenKey, access_token);
214 } 215 }
OLDNEW
« no previous file with comments | « chrome/common/net/gaia/oauth2_access_token_fetcher.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698