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

Unified Diff: components/password_manager/core/browser/http_password_migrator.h

Issue 2748933005: Remove Obsolete HTTP SiteStatistics From PasswordStore during Migration (Closed)
Patch Set: Capture explicitly 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: components/password_manager/core/browser/http_password_migrator.h
diff --git a/components/password_manager/core/browser/http_password_migrator.h b/components/password_manager/core/browser/http_password_migrator.h
deleted file mode 100644
index 4f71156878ef3c7b9787f60a0111f5c910837ba3..0000000000000000000000000000000000000000
--- a/components/password_manager/core/browser/http_password_migrator.h
+++ /dev/null
@@ -1,83 +0,0 @@
-// Copyright 2017 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_HTTP_PASSWORD_MIGRATOR_H_
-#define COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_HTTP_PASSWORD_MIGRATOR_H_
-
-#include <memory>
-#include <vector>
-
-#include "base/macros.h"
-#include "base/threading/thread_checker.h"
-#include "components/password_manager/core/browser/password_store_consumer.h"
-
-namespace autofill {
-struct PasswordForm;
-}
-
-class GURL;
-
-namespace password_manager {
-
-class PasswordManagerClient;
-
-// The class is responsible for migrating the passwords saved on HTTP to HTTPS
-// origin. It automatically determines whether HTTP passwords should be moved or
-// copied depending on the site's HSTS status. If a site has HSTS enabled, the
-// HTTP password is considered obsolete and will be replaced by an HTTPS
-// version. If HSTS is not enabled, some parts of the site might still be served
-// via HTTP, which is why the password is copied in this case.
-class HttpPasswordMigrator : public PasswordStoreConsumer {
- public:
- // API to be implemented by an embedder of HttpPasswordMigrator.
- class Consumer {
- public:
- virtual ~Consumer() = default;
-
- // Notify the embedder that |forms| were migrated to HTTPS. |forms| contain
- // the updated HTTPS scheme.
- virtual void ProcessMigratedForms(
- std::vector<std::unique_ptr<autofill::PasswordForm>> forms) = 0;
- };
-
- // |https_origin| should specify a valid HTTPS URL.
- HttpPasswordMigrator(const GURL& https_origin,
- const PasswordManagerClient* client,
- Consumer* consumer);
- ~HttpPasswordMigrator() override;
-
- // PasswordStoreConsumer:
- void OnGetPasswordStoreResults(
- std::vector<std::unique_ptr<autofill::PasswordForm>> results) override;
-
- // Callback for |PasswordManagerClient::PostHSTSQueryForHost|.
- void OnHSTSQueryResult(bool is_hsts);
-
- private:
- enum class MigrationMode {
- MOVE, // HTTP credentials are deleted after migration to HTTPS.
- COPY, // HTTP credentials are kept after migration to HTTPS.
- };
-
- void ProcessPasswordStoreResults();
-
- const PasswordManagerClient* const client_;
- Consumer* consumer_;
-
- // |ProcessPasswordStoreResults| requires that both |OnHSTSQueryResult| and
- // |OnGetPasswordStoreResults| have returned. Since this can happen in an
- // arbitrary order, boolean flags are introduced to indicate completion. Only
- // if both are set to true |ProcessPasswordStoreResults| gets called.
- bool got_hsts_query_result_ = false;
- bool got_password_store_results_ = false;
- MigrationMode mode_;
- std::vector<std::unique_ptr<autofill::PasswordForm>> results_;
- base::ThreadChecker thread_checker_;
-
- DISALLOW_COPY_AND_ASSIGN(HttpPasswordMigrator);
-};
-
-} // namespace password_manager
-
-#endif // COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_HTTP_PASSWORD_MIGRATOR_H_

Powered by Google App Engine
This is Rietveld 408576698