Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(435)

Unified Diff: components/password_manager/core/browser/password_store.cc

Issue 887043004: Postpone collecting passwords UMA metrics. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Small enhancement Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 276090ab12f0b3fac862c57be77c9bde9dc49031..164db45209728823677aea2364155392f17fb674 100644
--- a/components/password_manager/core/browser/password_store.cc
+++ b/components/password_manager/core/browser/password_store.cc
@@ -160,10 +160,15 @@ void PasswordStore::GetBlacklistLogins(PasswordStoreConsumer* consumer) {
void PasswordStore::ReportMetrics(const std::string& sync_username,
bool custom_passphrase_sync_enabled) {
- ScheduleTask(base::Bind(&PasswordStore::ReportMetricsImpl,
- this,
- sync_username,
- custom_passphrase_sync_enabled));
+ scoped_refptr<base::SingleThreadTaskRunner> task_runner(
+ GetBackgroundTaskRunner());
+ if (task_runner) {
+ base::Closure task =
+ base::Bind(&PasswordStore::ReportMetricsImpl, this, sync_username,
vasilii 2015/02/03 17:27:42 My concern is that you capture the scoped pointer
+ custom_passphrase_sync_enabled);
+ task_runner->PostDelayedTask(FROM_HERE, task,
+ base::TimeDelta::FromSeconds(30));
+ }
}
void PasswordStore::AddObserver(Observer* observer) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698