| Index: components/password_manager/core/browser/password_store.cc
|
| diff --git a/components/password_manager/core/browser/password_store.cc b/components/password_manager/core/browser/password_store.cc
|
| index 4fe387e75183259823123db683722a746583d779..c009b076689670e3add14217ac5df33a44335ec6 100644
|
| --- a/components/password_manager/core/browser/password_store.cc
|
| +++ b/components/password_manager/core/browser/password_store.cc
|
| @@ -94,7 +94,9 @@ void PasswordStore::SetAffiliatedMatchHelper(
|
| }
|
|
|
| void PasswordStore::AddLogin(const PasswordForm& form) {
|
| + VLOG(0) << "PasswordStore::AddLogin: Started.";
|
| CheckForEmptyUsernameAndPassword(form);
|
| + VLOG(0) << "PasswordStore::AddLogin: Scheduling AddLoginInternal task.";
|
| ScheduleTask(base::Bind(&PasswordStore::AddLoginInternal, this, form));
|
| }
|
|
|
| @@ -120,6 +122,8 @@ void PasswordStore::RemoveLoginsByOriginAndTime(
|
| base::Time delete_begin,
|
| base::Time delete_end,
|
| const base::Closure& completion) {
|
| + VLOG(0) << "PasswordStore::RemoveLoginsByOriginAndTime: Scheduling "
|
| + "RemoveLoginsByOriginAndTimeInternal.";
|
| ScheduleTask(base::Bind(&PasswordStore::RemoveLoginsByOriginAndTimeInternal,
|
| this, origin, delete_begin, delete_end, completion));
|
| }
|
| @@ -222,8 +226,8 @@ void PasswordStore::GetSiteStats(const GURL& origin_domain,
|
| base::Passed(&request)));
|
| }
|
|
|
| -void PasswordStore::AddObserver(Observer* observer) {
|
| - observers_->AddObserver(observer);
|
| +bool PasswordStore::AddObserver(Observer* observer) {
|
| + return observers_->AddObserver(observer);
|
| }
|
|
|
| void PasswordStore::RemoveObserver(Observer* observer) {
|
| @@ -232,10 +236,21 @@ void PasswordStore::RemoveObserver(Observer* observer) {
|
|
|
| bool PasswordStore::ScheduleTask(const base::Closure& task) {
|
| CHECK(is_alive());
|
| + VLOG(0) << "PasswordStore::ScheduleTask: Setting single thread task runner "
|
| + "from background task runner.";
|
| scoped_refptr<base::SingleThreadTaskRunner> task_runner(
|
| GetBackgroundTaskRunner());
|
| - if (task_runner.get())
|
| - return task_runner->PostTask(FROM_HERE, task);
|
| + if (task_runner.get()) {
|
| + VLOG(0) << "PasswordStore::ScheduleTask: Found task runner -- posting "
|
| + "given task to it.";
|
| + bool will_run = task_runner->PostTask(FROM_HERE, task);
|
| + VLOG(0) << "PasswordStore::ScheduleTask: PostTask returned with expected "
|
| + "run state: "
|
| + << will_run;
|
| + return will_run;
|
| + }
|
| + VLOG(0) << "PasswordStore::ScheduleTask: No task runner found -- returning "
|
| + "false.";
|
| return false;
|
| }
|
|
|
| @@ -334,7 +349,10 @@ void PasswordStore::WrapModificationTask(ModificationTask task) {
|
| }
|
|
|
| void PasswordStore::AddLoginInternal(const PasswordForm& form) {
|
| + VLOG(0) << "PasswordStore::AddLoginInternal: Started.";
|
| PasswordStoreChangeList changes = AddLoginImpl(form);
|
| + VLOG(0)
|
| + << "PasswordStore::AddLoginInternal: Notifying observers about changes.";
|
| NotifyLoginsChanged(changes);
|
| }
|
|
|
| @@ -362,11 +380,19 @@ void PasswordStore::RemoveLoginsByOriginAndTimeInternal(
|
| base::Time delete_begin,
|
| base::Time delete_end,
|
| const base::Closure& completion) {
|
| + VLOG(0) << "PasswordStore::RemoveLoginsByOriginAndTimeInternal: Started.";
|
| + VLOG(0) << "PasswordStore::RemoveLoginsByOriginAndTimeInternal: Removing "
|
| + "logins by origin and time.";
|
| PasswordStoreChangeList changes =
|
| RemoveLoginsByOriginAndTimeImpl(origin, delete_begin, delete_end);
|
| + VLOG(0) << "PasswordStore::RemoveLoginsByOriginAndTimeInternal: Removed "
|
| + << changes.size() << " logins.";
|
| NotifyLoginsChanged(changes);
|
| - if (!completion.is_null())
|
| + if (!completion.is_null()) {
|
| + VLOG(0) << "PasswordStore::RemoveLoginsByOriginAndTimeInternal: posting "
|
| + "completion callback.";
|
| main_thread_runner_->PostTask(FROM_HERE, completion);
|
| + }
|
| }
|
|
|
| void PasswordStore::RemoveLoginsCreatedBetweenInternal(
|
| @@ -590,16 +616,4 @@ void PasswordStore::DestroySyncableService() {
|
| syncable_service_.reset();
|
| }
|
|
|
| -// No-op implementation of RemoveLoginsByOriginAndTimeImpl to please the
|
| -// compiler on derived classes that have not yet provided an implementation on
|
| -// their own.
|
| -// TODO(ttr314@googlemail.com): Once crbug.com/113973 is done, remove default
|
| -// implementation and mark method as pure virtual.
|
| -PasswordStoreChangeList PasswordStore::RemoveLoginsByOriginAndTimeImpl(
|
| - const url::Origin& origin,
|
| - base::Time delete_begin,
|
| - base::Time delete_end) {
|
| - return PasswordStoreChangeList();
|
| -}
|
| -
|
| } // namespace password_manager
|
|
|