Commit 2fb187b8 authored by Jan Wilken Dörrie's avatar Jan Wilken Dörrie Committed by Commit Bot

[Passwords] Add forward declaration for PasswordForm

This change adds a separate header for forward declarations of
password_manager::PasswordForm. Since this is currently only an alias of
autofill::PasswordForm, a naive forward declaration does not work.

Furthermore, this change creates a new target for password_form,
making it easier to split up cycling dependencies between several
password_manager sub components.

Bug: 1067347
Change-Id: Ia5e6cd83dfd84b09c7dd3069d4f86ca2830102fb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2426449
Commit-Queue: Jan Wilken Dörrie <jdoerrie@chromium.org>
Reviewed-by: default avatarMohamed Amir Yosef <mamir@chromium.org>
Cr-Commit-Position: refs/heads/master@{#810168}
parent cbe5fbdc
......@@ -148,7 +148,6 @@ static_library("browser") {
"password_feature_manager.h",
"password_feature_manager_impl.cc",
"password_feature_manager_impl.h",
"password_form.h",
"password_form_filling.cc",
"password_form_filling.h",
"password_form_manager.cc",
......@@ -406,6 +405,17 @@ source_set("csv_unittests") {
]
}
# PasswordForm is an extremely common struct used by many sub-components and
# sub-directories. Having its own target makes it possible to break up several
# cyclic dependencies.
source_set("password_form") {
sources = [
"password_form.h",
"password_form_forward.h",
]
deps = [ "//components/autofill/core/common" ]
}
static_library("password_generator") {
sources = [
"generation/password_generator.cc",
......
// Copyright 2020 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_PASSWORD_FORM_FORWARD_H_
#define COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_PASSWORD_FORM_FORWARD_H_
// While `password_manager::PasswordForm` is just an alias to
// `autofill::PasswordForm` it is rather awkward to construct a forward
// declaration for it, since a naive solution such as
// namespace password_manager { struct PasswordForm; } would break the build.
// This file aims to make this easier, and classes merely interested in a
// forward declaration can simply #include this header.
//
// TODO(crbug.com/1067347): Remove this file once password_manager::PasswordForm
// is a real class, and a regular forward declaration does work.
namespace autofill {
struct PasswordForm;
}
namespace password_manager {
using PasswordForm = autofill::PasswordForm;
}
#endif // COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_PASSWORD_FORM_FORWARD_H_
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment