Add DB cannot be opened error state for loading credentials.
Bug 976143 shows a case when the token database could not be opened.
My suspicion is that another process had a handle on this file and
that forbids Chrome for using it. However debugging it was fairly
complex.
This CL separates this state to make debugging easier.
Bug: 976143
Change-Id: I2106201c3ae17299a3ce3d2e4675bb90bab1f062
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1670223
Reviewed-by: Thomas Tangl <tangltom@chromium.org>
Commit-Queue: Mihai Sardarescu <msarda@chromium.org>
Cr-Commit-Position: refs/heads/master@{#671344}
diff --git a/components/signin/core/browser/about_signin_internals.cc b/components/signin/core/browser/about_signin_internals.cc
index af75dc7..03ebfc0 100644
--- a/components/signin/core/browser/about_signin_internals.cc
+++ b/components/signin/core/browser/about_signin_internals.cc
@@ -120,6 +120,9 @@
return "Load credentials in progress";
case OAuth2TokenServiceDelegate::LOAD_CREDENTIALS_FINISHED_WITH_SUCCESS:
return "Load credentials finished with success";
+ case OAuth2TokenServiceDelegate::
+ LOAD_CREDENTIALS_FINISHED_WITH_DB_CANNOT_BE_OPENED:
+ return "Load credentials failed with datase cannot be opened error";
case OAuth2TokenServiceDelegate::LOAD_CREDENTIALS_FINISHED_WITH_DB_ERRORS:
return "Load credentials failed with database errors";
case OAuth2TokenServiceDelegate::
diff --git a/components/signin/core/browser/mutable_profile_oauth2_token_service_delegate.cc b/components/signin/core/browser/mutable_profile_oauth2_token_service_delegate.cc
index 7b1f1b3..93a00004 100644
--- a/components/signin/core/browser/mutable_profile_oauth2_token_service_delegate.cc
+++ b/components/signin/core/browser/mutable_profile_oauth2_token_service_delegate.cc
@@ -557,7 +557,8 @@
set_load_credentials_state(LoadCredentialsStateFromTokenResult(
token_result->GetValue().db_result));
} else {
- set_load_credentials_state(LOAD_CREDENTIALS_FINISHED_WITH_UNKNOWN_ERRORS);
+ set_load_credentials_state(
+ LOAD_CREDENTIALS_FINISHED_WITH_DB_CANNOT_BE_OPENED);
}
// Make sure that we have an entry for |loading_primary_account_id_| in the
diff --git a/components/signin/core/browser/profile_oauth2_token_service.cc b/components/signin/core/browser/profile_oauth2_token_service.cc
index 0a97c47..415fcd62 100644
--- a/components/signin/core/browser/profile_oauth2_token_service.cc
+++ b/components/signin/core/browser/profile_oauth2_token_service.cc
@@ -211,6 +211,8 @@
case OAuth2TokenServiceDelegate::LOAD_CREDENTIALS_IN_PROGRESS:
// LoadCredentials has not finished.
return false;
+ case OAuth2TokenServiceDelegate::
+ LOAD_CREDENTIALS_FINISHED_WITH_DB_CANNOT_BE_OPENED:
case OAuth2TokenServiceDelegate::LOAD_CREDENTIALS_FINISHED_WITH_DB_ERRORS:
case OAuth2TokenServiceDelegate::
LOAD_CREDENTIALS_FINISHED_WITH_DECRYPT_ERRORS:
diff --git a/google_apis/gaia/oauth2_token_service_delegate.h b/google_apis/gaia/oauth2_token_service_delegate.h
index b75de091..9b2fec8 100644
--- a/google_apis/gaia/oauth2_token_service_delegate.h
+++ b/google_apis/gaia/oauth2_token_service_delegate.h
@@ -35,6 +35,7 @@
LOAD_CREDENTIALS_NOT_STARTED,
LOAD_CREDENTIALS_IN_PROGRESS,
LOAD_CREDENTIALS_FINISHED_WITH_SUCCESS,
+ LOAD_CREDENTIALS_FINISHED_WITH_DB_CANNOT_BE_OPENED,
LOAD_CREDENTIALS_FINISHED_WITH_DB_ERRORS,
LOAD_CREDENTIALS_FINISHED_WITH_DECRYPT_ERRORS,
LOAD_CREDENTIALS_FINISHED_WITH_NO_TOKEN_FOR_PRIMARY_ACCOUNT,