[reland] variations: converts the variations target to a component
This differs from the original patch in that
variations_crash_keys_unittest.cc is only built in non-component
builds. This is because the test uses crash_reporter::GetCrashKeyValue()
which returns the keys of the calling component. In the case of a
component build, that is now the unit-test instead of tge variations
component. This results in the test failing. This is explicitly called
out here:
https://chromium.googlesource.com/chromium/src/+/refs/heads/main/components/crash/core/common/crash_key.h#290
As there are builders that build non-component builds, there is still
coverage on the CQ and main waterfall.
You can diff between patchset 1 and 2 to see the change since first
landing.
The variations target is currently a static_library. This means
any executable/shared-library target that depends upon it ends up
copying the symbols, and we end up with multiple instances of
singletons. This is painful as I'm trying to ensure a single
instance of VariationsIdsProvider is created, but because there
are multiple that is difficult.
By converting the target to a component the duplication doesn't
happen and a single instance is created.
BUG=1148350
TEST=covered by tests
Change-Id: I9d46517b5f0d75e51a2f53dfc5c8e9882ca26af8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2930537
Reviewed-by: Alexei Svitkine <[email protected]>
Reviewed-by: Reilly Grant <[email protected]>
Commit-Queue: Scott Violet <[email protected]>
Cr-Commit-Position: refs/heads/master@{#888209}
diff --git a/components/variations/variations_murmur_hash.h b/components/variations/variations_murmur_hash.h
index d4a0291..62df4c3 100644
--- a/components/variations/variations_murmur_hash.h
+++ b/components/variations/variations_murmur_hash.h
@@ -9,6 +9,7 @@
#include <vector>
#include "base/compiler_specific.h"
+#include "base/component_export.h"
#include "base/strings/string_piece.h"
namespace variations {
@@ -16,7 +17,7 @@
// Hash utilities for NormalizedMurmurHashEntropyProvider. For more info, see:
// https://docs.google.com/document/d/1cPF5PruriWNP2Z5gSkq4MBTm0wSZqLyIJkUO9ekibeo
-class VariationsMurmurHash {
+class COMPONENT_EXPORT(VARIATIONS) VariationsMurmurHash {
public:
// Prepares data to be hashed by VariationsMurmurHash: align and zero-pad to a
// multiple of 4 bytes, and produce the same uint32_t values regardless of