Commit 4f97bca4 authored by Asanka Herath's avatar Asanka Herath Committed by Commit Bot

[privacy_budget] Enable `gn check`.

Includes some fixes for issues found by `gn check` in the
`privacy_budget` directories.

Bug: 973801
Change-Id: Iad543786ea08108a165dc08fc6b7c7794e14f5e7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2251090
Commit-Queue: Asanka Herath <asanka@chromium.org>
Reviewed-by: default avatarNico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#782164}
parent 6a1a354c
...@@ -166,6 +166,7 @@ check_targets = [ ...@@ -166,6 +166,7 @@ check_targets = [
"//chrome/browser/prerender/*", "//chrome/browser/prerender/*",
"//chrome/browser/previews/*", "//chrome/browser/previews/*",
"//chrome/browser/printing/*", "//chrome/browser/printing/*",
"//chrome/browser/privacy_budget/*",
"//chrome/browser/profile_resetter/*", "//chrome/browser/profile_resetter/*",
"//chrome/browser/profiles/*", "//chrome/browser/profiles/*",
...@@ -344,6 +345,7 @@ check_targets = [ ...@@ -344,6 +345,7 @@ check_targets = [
# "//third_party/blink/*", # Errors: https://crbug.com/800764 # "//third_party/blink/*", # Errors: https://crbug.com/800764
"//third_party/blink/public/*", "//third_party/blink/public/*",
"//third_party/blink/common/privacy_budget/*",
#"//third_party/breakpad/*", # Small errors. #"//third_party/breakpad/*", # Small errors.
"//third_party/boringssl/*", "//third_party/boringssl/*",
......
...@@ -14,10 +14,13 @@ source_set("privacy_budget") { ...@@ -14,10 +14,13 @@ source_set("privacy_budget") {
deps = [ deps = [
"//base", "//base",
"//chrome/common/privacy_budget",
"//components/prefs",
"//components/ukm",
"//services/metrics/public/cpp:metrics_cpp", "//services/metrics/public/cpp:metrics_cpp",
"//services/metrics/public/cpp:ukm_builders", "//services/metrics/public/cpp:ukm_builders",
"//services/metrics/public/mojom", "//services/metrics/public/mojom",
"//third_party/blink/public/common", "//third_party/blink/public/common/privacy_budget",
] ]
} }
...@@ -30,6 +33,7 @@ source_set("unit_tests") { ...@@ -30,6 +33,7 @@ source_set("unit_tests") {
] ]
deps = [ deps = [
":privacy_budget",
"//chrome/common/privacy_budget:test_support", "//chrome/common/privacy_budget:test_support",
"//chrome/test:test_support", "//chrome/test:test_support",
"//testing/gtest", "//testing/gtest",
......
...@@ -44,6 +44,7 @@ source_set("unit_tests") { ...@@ -44,6 +44,7 @@ source_set("unit_tests") {
"//testing/gmock", "//testing/gmock",
"//testing/gtest", "//testing/gtest",
"//third_party/blink/public/common", "//third_party/blink/public/common",
"//third_party/blink/public/common/privacy_budget:internal",
] ]
} }
......
...@@ -2,9 +2,17 @@ ...@@ -2,9 +2,17 @@
# Use of this source code is governed by a BSD-style license that can be # Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file. # found in the LICENSE file.
source_set("internal") {
sources = [ "identifiability_internal_templates.h" ]
visibility = [
":*",
"//third_party/blink/common/privacy_budget:*",
]
}
source_set("privacy_budget") { source_set("privacy_budget") {
sources = [ sources = [
"identifiability_internal_templates.h",
"identifiability_metric_builder.h", "identifiability_metric_builder.h",
"identifiability_metrics.h", "identifiability_metrics.h",
"identifiability_study_participation.h", "identifiability_study_participation.h",
...@@ -16,13 +24,11 @@ source_set("privacy_budget") { ...@@ -16,13 +24,11 @@ source_set("privacy_budget") {
] ]
deps = [ deps = [
":internal",
"//base", "//base",
"//services/metrics/public/cpp:metrics_cpp", "//services/metrics/public/cpp:metrics_cpp",
"//services/network/public/cpp:cpp", "//services/network/public/cpp:cpp",
"//third_party/blink/public/common:common_export", "//third_party/blink/public/common:common_export",
"//third_party/blink/public/mojom:web_feature_mojo_bindings", "//third_party/blink/public/mojom:web_feature_mojo_bindings",
] ]
# Internal templates are not a public API.
public = sources - [ "identifiability_internal_templates.h" ]
} }
...@@ -5,10 +5,10 @@ ...@@ -5,10 +5,10 @@
#ifndef THIRD_PARTY_BLINK_PUBLIC_COMMON_PRIVACY_BUDGET_IDENTIFIABILITY_INTERNAL_TEMPLATES_H_ #ifndef THIRD_PARTY_BLINK_PUBLIC_COMMON_PRIVACY_BUDGET_IDENTIFIABILITY_INTERNAL_TEMPLATES_H_
#define THIRD_PARTY_BLINK_PUBLIC_COMMON_PRIVACY_BUDGET_IDENTIFIABILITY_INTERNAL_TEMPLATES_H_ #define THIRD_PARTY_BLINK_PUBLIC_COMMON_PRIVACY_BUDGET_IDENTIFIABILITY_INTERNAL_TEMPLATES_H_
#include <cstdint>
#include <cstring>
#include <type_traits> #include <type_traits>
#include "third_party/blink/public/common/privacy_budget/identifiability_metrics.h"
namespace blink { namespace blink {
namespace internal { namespace internal {
...@@ -66,7 +66,7 @@ constexpr int64_t DigestOfObjectRepresentation(T in) { ...@@ -66,7 +66,7 @@ constexpr int64_t DigestOfObjectRepresentation(T in) {
return in; return in;
int64_t result = 0; int64_t result = 0;
memcpy(&result, &in, sizeof(in)); std::memcpy(&result, &in, sizeof(in));
return result; return result;
} }
......
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