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

Unified Diff: chrome/browser/password_manager/password_store_factory.cc

Issue 800723004: Report PasswordManager.OsPasswordStatus on a background thread with a delay. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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 | « chrome/browser/password_manager/chrome_password_manager_client.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/password_manager/password_store_factory.cc
diff --git a/chrome/browser/password_manager/password_store_factory.cc b/chrome/browser/password_manager/password_store_factory.cc
index c4a9d4ab106674dd783d8bdc5d26e25e0b7f8727..7de59d1e0004e5c14d8abeba8ff96ac6f1dccd59 100644
--- a/chrome/browser/password_manager/password_store_factory.cc
+++ b/chrome/browser/password_manager/password_store_factory.cc
@@ -6,7 +6,9 @@
#include "base/command_line.h"
#include "base/environment.h"
+#include "base/metrics/histogram_macros.h"
#include "base/prefs/pref_service.h"
+#include "chrome/browser/password_manager/password_manager_util.h"
#include "chrome/browser/password_manager/sync_metrics.h"
#include "chrome/browser/profiles/incognito_helpers.h"
#include "chrome/browser/sync/glue/sync_start_util.h"
@@ -42,14 +44,34 @@
using password_manager::PasswordStore;
-#if !defined(OS_CHROMEOS) && defined(USE_X11)
namespace {
+#if !defined(OS_CHROMEOS) && defined(USE_X11)
const LocalProfileId kInvalidLocalProfileId =
static_cast<LocalProfileId>(0);
+#endif
+
+void ReportOsPassword() {
+ password_manager_util::OsPasswordStatus status =
+ password_manager_util::GetOsPasswordStatus();
+
+ UMA_HISTOGRAM_ENUMERATION("PasswordManager.OsPasswordStatus",
+ status,
+ password_manager_util::MAX_PASSWORD_STATUS);
+}
+
+void DelayReportOsPassword() {
+ // Avoid checking OS password until later on in browser startup
+ // since it calls a few Windows APIs.
+ content::BrowserThread::PostDelayedTask(
+ content::BrowserThread::FILE,
+ FROM_HERE,
+ base::Bind(&ReportOsPassword),
+ base::TimeDelta::FromSeconds(40));
+}
} // namespace
-#endif
+
PasswordStoreService::PasswordStoreService(
scoped_refptr<PasswordStore> password_store)
@@ -122,6 +144,7 @@ LocalProfileId PasswordStoreFactory::GetLocalProfileId(
KeyedService* PasswordStoreFactory::BuildServiceInstanceFor(
content::BrowserContext* context) const {
+ DelayReportOsPassword();
Profile* profile = static_cast<Profile*>(context);
base::FilePath login_db_file_path = profile->GetPath();
« no previous file with comments | « chrome/browser/password_manager/chrome_password_manager_client.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698