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

Unified Diff: chrome/browser/password_manager/password_manager_util.h

Issue 2714543006: Clean Obsolete HTTP Data from the Password Store (Closed)
Patch Set: Add Unittest File Created 3 years, 9 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
Index: chrome/browser/password_manager/password_manager_util.h
diff --git a/chrome/browser/password_manager/password_manager_util.h b/chrome/browser/password_manager/password_manager_util.h
new file mode 100644
index 0000000000000000000000000000000000000000..3b7ed579b0614e1442462913a11853bc71c824ca
--- /dev/null
+++ b/chrome/browser/password_manager/password_manager_util.h
@@ -0,0 +1,34 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
vabr (Chromium) 2017/03/24 07:02:42 Darin and others recommend against creating a "dum
vasilii 2017/03/24 15:14:30 Acknowledged.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_MANAGER_UTIL_H_
+#define CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_MANAGER_UTIL_H_
+
+#include "base/callback_forward.h"
+
+class GURL;
+class Profile;
+
+namespace password_manager_util {
+
+constexpr int kDefaultDelay = 40;
+using HSTSCallback = base::Callback<void(bool)>;
+// Checks asynchronously whether HTTP Strict Transport Security (HSTS) is active
+// for the host of the given origin for a given profile. Notifies |callback|
+// with the result on the calling thread.
+void PostHSTSQueryForHostAndProfile(const GURL& origin,
+ Profile* profile,
+ const HSTSCallback& callback);
+
+// Cleans all obsolete HTTP data for a given profile. HTTP data is considered
+// obsolete, when the corresponding site has migrated to HTTPS and HSTS is
+// enabled. Data that will be cleaned includes passwords, blacklisted origins
+// and site statistics. This is guarded by a preference and will be a no-op if
+// the task was run for the profile in the past.
+void DelayCleanObsoleteHttpDataForProfile(Profile* profile,
+ int delay_in_seconds = kDefaultDelay);
+
+} // namespace password_manager_util
+
+#endif // CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_MANAGER_UTIL_H_

Powered by Google App Engine
This is Rietveld 408576698