diff options
Diffstat (limited to 'google_apis/gaia/google_service_auth_error.cc')
-rw-r--r-- | google_apis/gaia/google_service_auth_error.cc | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/google_apis/gaia/google_service_auth_error.cc b/google_apis/gaia/google_service_auth_error.cc index 7796fae..5fab6dd 100644 --- a/google_apis/gaia/google_service_auth_error.cc +++ b/google_apis/gaia/google_service_auth_error.cc @@ -64,6 +64,11 @@ bool GoogleServiceAuthError::operator==( second_factor_ == b.second_factor_); } +bool GoogleServiceAuthError::operator!=( + const GoogleServiceAuthError& b) const { + return !(*this == b); +} + GoogleServiceAuthError::GoogleServiceAuthError(State s) : state_(s), network_error_(0) { @@ -240,6 +245,21 @@ std::string GoogleServiceAuthError::ToString() const { } } +bool GoogleServiceAuthError::IsPersistentError() const { + if (state_ == GoogleServiceAuthError::NONE) return false; + return !IsTransientError(); +} + +bool GoogleServiceAuthError::IsTransientError() const { + switch (state_) { + case GoogleServiceAuthError::CONNECTION_FAILED: + case GoogleServiceAuthError::SERVICE_UNAVAILABLE: + return true; + default: + return false; + } +} + GoogleServiceAuthError::GoogleServiceAuthError(State s, int error) : state_(s), network_error_(error) { |