[Sync] Avoid unnecessary DB rewrite for TokenService credentials that were just read from DB
When the token service is initialized, tokens are read from disk via LoadTokensFromDB. The callback for this function after the DB read completes is LoadTokensIntoMemory. When LoadTokensIntoMemory is run, it calls UpdateCredentials, which implicitly rewrites the just-read credentials back to the DB. This DB write is unnecessary. An unintended side effect is that the credential caching service does an unnecessary file-write to "Sync Credentials" every single time Chrome is restarted, even though the sync credentials haven't changed in any way. This patch modifies LoadTokensIntoMemory to merely update |credentials_|, the in-memory credentials object, without updating the DB too. BUG=139263 TEST=unit_tests; Sign in to sync, restart chrome, and make sure TokenService credentials are not re-written to DB during initialization. Review URL: https://chromiumcodereview.appspot.com/10829051 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@148863 0039d316-1c4b-4281-b951-d872f2087c98
Showing
Please register or sign in to comment