Open the LoginDatabase on the DB thread, not the UI thread.

PasswordStoreFactory::BuildServiceInstanceFor() used to open the LoginDatabase directly, on the UI thread. As the operation takes ~100 ms on average, this had led to significant UI jankiness.

This CL now changes this behavior so that the DB is opened in a deferred manner by PasswordStoreDefault on the DB thread. Furthermore, this CL refactors LoginDatabase to take the path to the DB in the constructor, and starts using scoped_ptr-s when PasswordStore implementations take ownership of passed-in components.

BUG=138903

Review URL: https://codereview.chromium.org/838453003

Cr-Commit-Position: refs/heads/master@{#312607}
18 files changed