| 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 "components/browser_sync/browser/profile_sync_service.h" | 5 #include "components/browser_sync/browser/profile_sync_service.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <cstddef> | 8 #include <cstddef> |
| 9 #include <map> | 9 #include <map> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 1136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1147 base::Bind(&ProfileSyncService::RequestAccessToken, | 1147 base::Bind(&ProfileSyncService::RequestAccessToken, |
| 1148 weak_factory_.GetWeakPtr())); | 1148 weak_factory_.GetWeakPtr())); |
| 1149 } | 1149 } |
| 1150 } else { | 1150 } else { |
| 1151 // Reset backoff time after successful connection. | 1151 // Reset backoff time after successful connection. |
| 1152 if (status == syncer::CONNECTION_OK) { | 1152 if (status == syncer::CONNECTION_OK) { |
| 1153 // Request shouldn't be scheduled at this time. But if it is, it's | 1153 // Request shouldn't be scheduled at this time. But if it is, it's |
| 1154 // possible that sync flips between OK and auth error states rapidly, | 1154 // possible that sync flips between OK and auth error states rapidly, |
| 1155 // thus hammers token server. To be safe, only reset backoff delay when | 1155 // thus hammers token server. To be safe, only reset backoff delay when |
| 1156 // no scheduled request. | 1156 // no scheduled request. |
| 1157 if (request_access_token_retry_timer_.IsRunning()) { | 1157 if (!request_access_token_retry_timer_.IsRunning()) { |
| 1158 NOTREACHED(); | |
| 1159 } else { | |
| 1160 request_access_token_backoff_.Reset(); | 1158 request_access_token_backoff_.Reset(); |
| 1161 } | 1159 } |
| 1162 } | 1160 } |
| 1163 | 1161 |
| 1164 const GoogleServiceAuthError auth_error = | 1162 const GoogleServiceAuthError auth_error = |
| 1165 ConnectionStatusToAuthError(status); | 1163 ConnectionStatusToAuthError(status); |
| 1166 DVLOG(1) << "Connection status change: " << auth_error.ToString(); | 1164 DVLOG(1) << "Connection status change: " << auth_error.ToString(); |
| 1167 UpdateAuthErrorState(auth_error); | 1165 UpdateAuthErrorState(auth_error); |
| 1168 } | 1166 } |
| 1169 } | 1167 } |
| (...skipping 1367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2537 } | 2535 } |
| 2538 | 2536 |
| 2539 std::string ProfileSyncService::unrecoverable_error_message() const { | 2537 std::string ProfileSyncService::unrecoverable_error_message() const { |
| 2540 return unrecoverable_error_message_; | 2538 return unrecoverable_error_message_; |
| 2541 } | 2539 } |
| 2542 | 2540 |
| 2543 tracked_objects::Location ProfileSyncService::unrecoverable_error_location() | 2541 tracked_objects::Location ProfileSyncService::unrecoverable_error_location() |
| 2544 const { | 2542 const { |
| 2545 return unrecoverable_error_location_; | 2543 return unrecoverable_error_location_; |
| 2546 } | 2544 } |
| OLD | NEW |