OLD | NEW |
---|---|
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 "google_apis/gaia/gaia_oauth_client.h" | 5 #include "google_apis/gaia/gaia_oauth_client.h" |
6 | 6 |
7 #include "base/json/json_reader.h" | 7 #include "base/json/json_reader.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/values.h" | 10 #include "base/values.h" |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
196 message_value->IsType(Value::TYPE_DICTIONARY)) { | 196 message_value->IsType(Value::TYPE_DICTIONARY)) { |
197 response_dict.reset( | 197 response_dict.reset( |
198 static_cast<DictionaryValue*>(message_value.release())); | 198 static_cast<DictionaryValue*>(message_value.release())); |
199 } | 199 } |
200 } | 200 } |
201 | 201 |
202 if (!response_dict.get()) { | 202 if (!response_dict.get()) { |
203 // If we don't have an access token yet and the the error was not | 203 // If we don't have an access token yet and the the error was not |
204 // RC_BAD_REQUEST, we may need to retry. | 204 // RC_BAD_REQUEST, we may need to retry. |
205 if ((source->GetMaxRetriesOn5xx() != -1) && | 205 if ((source->GetMaxRetriesOn5xx() != -1) && |
206 (num_retries_ > source->GetMaxRetriesOn5xx())) { | 206 (num_retries_ >= source->GetMaxRetriesOn5xx())) { |
Andrew T Wilson (Slow)
2013/05/27 13:52:15
Do we have a test that exercises this change?
Bernhard Bauer
2013/05/27 14:42:13
device_cloud_policy_manager_chromeos_unittest.cc (
| |
207 // Retry limit reached. Give up. | 207 // Retry limit reached. Give up. |
208 delegate_->OnNetworkError(source->GetResponseCode()); | 208 delegate_->OnNetworkError(source->GetResponseCode()); |
209 } else { | 209 } else { |
210 request_ = old_request.Pass(); | 210 request_ = old_request.Pass(); |
211 *should_retry_request = true; | 211 *should_retry_request = true; |
212 } | 212 } |
213 return; | 213 return; |
214 } | 214 } |
215 | 215 |
216 RequestType type = request_type_; | 216 RequestType type = request_type_; |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
282 delegate); | 282 delegate); |
283 } | 283 } |
284 | 284 |
285 void GaiaOAuthClient::GetUserInfo(const std::string& access_token, | 285 void GaiaOAuthClient::GetUserInfo(const std::string& access_token, |
286 int max_retries, | 286 int max_retries, |
287 Delegate* delegate) { | 287 Delegate* delegate) { |
288 return core_->GetUserInfo(access_token, max_retries, delegate); | 288 return core_->GetUserInfo(access_token, max_retries, delegate); |
289 } | 289 } |
290 | 290 |
291 } // namespace gaia | 291 } // namespace gaia |
OLD | NEW |