Commit faa3159f authored by Oscar Johansson's avatar Oscar Johansson Committed by Commit Bot

Forward declare operator overload (components/)

When building using jumbo, files get merged and more options
are presented for the compiler. When using the operator overload <<
in PasswordRequirementsSpec, the compiler gets too many
options and will fail before reaching the correct operator overload.

The issue solved by forward declaring the operator overload in the files
that uses it.

Bug: 869381
Change-Id: I3d0226c9e12b1e64b3359a1efb2f9948a24e61b6
Reviewed-on: https://chromium-review.googlesource.com/1160228Reviewed-by: default avatarVadym Doroshenko <dvadym@chromium.org>
Commit-Queue: Oscar Johansson <oscarj@opera.com>
Cr-Commit-Position: refs/heads/master@{#581526}
parent 5cc093d4
...@@ -4,9 +4,11 @@ ...@@ -4,9 +4,11 @@
#include "components/autofill/core/browser/password_requirements_spec_printer.h" #include "components/autofill/core/browser/password_requirements_spec_printer.h"
namespace autofill {
std::ostream& operator<<( std::ostream& operator<<(
std::ostream& out, std::ostream& out,
const autofill::PasswordRequirementsSpec::CharacterClass& character_class) { const PasswordRequirementsSpec::CharacterClass& character_class) {
out << "{"; out << "{";
if (character_class.has_character_set()) if (character_class.has_character_set())
out << "character_set: \"" << character_class.character_set() << "\", "; out << "character_set: \"" << character_class.character_set() << "\", ";
...@@ -19,7 +21,7 @@ std::ostream& operator<<( ...@@ -19,7 +21,7 @@ std::ostream& operator<<(
} }
std::ostream& operator<<(std::ostream& out, std::ostream& operator<<(std::ostream& out,
const autofill::PasswordRequirementsSpec& spec) { const PasswordRequirementsSpec& spec) {
out << "{"; out << "{";
if (spec.has_priority()) if (spec.has_priority())
out << "priority: " << spec.priority() << ", "; out << "priority: " << spec.priority() << ", ";
...@@ -42,3 +44,5 @@ std::ostream& operator<<(std::ostream& out, ...@@ -42,3 +44,5 @@ std::ostream& operator<<(std::ostream& out,
out << "}"; out << "}";
return out; return out;
} }
} // namespace autofill
...@@ -9,11 +9,15 @@ ...@@ -9,11 +9,15 @@
#include "components/autofill/core/browser/proto/password_requirements.pb.h" #include "components/autofill/core/browser/proto/password_requirements.pb.h"
namespace autofill {
std::ostream& operator<<( std::ostream& operator<<(
std::ostream& out, std::ostream& out,
const autofill::PasswordRequirementsSpec::CharacterClass& character_class); const PasswordRequirementsSpec::CharacterClass& character_class);
std::ostream& operator<<(std::ostream& out, std::ostream& operator<<(std::ostream& out,
const autofill::PasswordRequirementsSpec& spec); const PasswordRequirementsSpec& spec);
} // namespace autofill
#endif // COMPONENTS_AUTOFILL_CORE_BROWSER_PASSWORD_REQUIREMENTS_SPEC_PRINTER_H_ #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_PASSWORD_REQUIREMENTS_SPEC_PRINTER_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