Commit fc6205bb authored by Daniel Bratell's avatar Daniel Bratell Committed by Commit Bot

Rename some symbols that were duplicated in cert code

Duplicates of kTrafficAnnotation and g_is_fake_official_build_for_testing
just appeared and caused problems for certain (extreme) jumbo build
configurations.

In jumbo builds much code is compiled in the same translation
unit which means that they share the same anonymous namespace.

This patch renames the variables following the pattern of similar clashes.

(nopresubmit because any changes to net::URLFetcher are currently
 blocked and this just changes a name)

NOPRESUBMIT=true

Change-Id: Ib55f61c2c8a76c235de45f509df493c875a3a12b
Reviewed-on: https://chromium-review.googlesource.com/992313
Commit-Queue: Daniel Bratell <bratell@opera.com>
Reviewed-by: default avatarRyan Sleevi <rsleevi@chromium.org>
Reviewed-by: default avatarMatt Mueller <mattm@chromium.org>
Reviewed-by: default avatarSergey Ulanov <sergeyu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#548379}
parent 253ec117
......@@ -25,7 +25,7 @@ namespace media_router {
namespace {
constexpr net::NetworkTrafficAnnotationTag kTrafficAnnotation =
constexpr net::NetworkTrafficAnnotationTag kDialUrlFetcherTrafficAnnotation =
net::DefineNetworkTrafficAnnotation("dial_url_fetcher", R"(
semantics {
sender: "DIAL"
......@@ -101,8 +101,8 @@ void DialURLFetcher::Start() {
net::LOAD_DO_NOT_SEND_COOKIES |
net::LOAD_DO_NOT_SEND_AUTH_DATA;
loader_ =
network::SimpleURLLoader::Create(std::move(request), kTrafficAnnotation);
loader_ = network::SimpleURLLoader::Create(std::move(request),
kDialUrlFetcherTrafficAnnotation);
// Allow the fetcher to retry on 5XX responses and ERR_NETWORK_CHANGED.
loader_->SetRetryOptions(
......
......@@ -63,8 +63,9 @@ const char kProduct[] = "Chrome_ChromeOS";
// TODO(crbug.com/775415): Update comment to reflect new policy when discarding
// the command line flag.
constexpr net::NetworkTrafficAnnotationTag kTrafficAnnotation =
net::DefineNetworkTrafficAnnotation("webrtc_event_log_uploader", R"(
constexpr net::NetworkTrafficAnnotationTag
kWebrtcEventLogUploaderTrafficAnnotation =
net::DefineNetworkTrafficAnnotation("webrtc_event_log_uploader", R"(
semantics {
sender: "WebRTC Event Log uploader module"
description:
......@@ -262,7 +263,8 @@ void WebRtcEventLogUploaderImpl::StartUpload() {
DCHECK(io_task_runner_->RunsTasksInCurrentSequence());
url_fetcher_ = net::URLFetcher::Create(
GURL(kUploadURL), net::URLFetcher::POST, &delegate_, kTrafficAnnotation);
GURL(kUploadURL), net::URLFetcher::POST, &delegate_,
kWebrtcEventLogUploaderTrafficAnnotation);
url_fetcher_->SetRequestContext(request_context_getter_);
url_fetcher_->SetLoadFlags(net::LOAD_DO_NOT_SAVE_COOKIES |
net::LOAD_DO_NOT_SEND_COOKIES);
......
......@@ -34,7 +34,7 @@
// Certificate reports are only sent from official builds, but this flag can be
// set by tests.
static bool g_is_fake_official_build_for_testing = false;
static bool g_is_fake_official_build_for_cert_verifier_testing = false;
namespace {
......@@ -255,7 +255,7 @@ TrialComparisonCertVerifier::~TrialComparisonCertVerifier() = default;
// static
void TrialComparisonCertVerifier::SetFakeOfficialBuildForTesting() {
g_is_fake_official_build_for_testing = true;
g_is_fake_official_build_for_cert_verifier_testing = true;
}
int TrialComparisonCertVerifier::Verify(const RequestParams& params,
......@@ -284,7 +284,7 @@ void TrialComparisonCertVerifier::OnPrimaryVerifierComplete(
bool is_first_job) {
DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
bool is_official_build = g_is_fake_official_build_for_testing;
bool is_official_build = g_is_fake_official_build_for_cert_verifier_testing;
#if defined(OFFICIAL_BUILD) && defined(GOOGLE_CHROME_BUILD)
is_official_build = true;
#endif
......
......@@ -38,7 +38,7 @@ namespace {
// Certificate reports are only sent from official builds, but this flag can be
// set by tests.
static bool g_is_fake_official_build_for_testing = false;
static bool g_is_fake_official_build_for_cert_report_testing = false;
// Returns a pointer to the Profile associated with |web_contents|.
Profile* GetProfile(content::WebContents* web_contents) {
......@@ -78,7 +78,7 @@ CertReportHelper::~CertReportHelper() {
// static
void CertReportHelper::SetFakeOfficialBuildForTesting() {
g_is_fake_official_build_for_testing = true;
g_is_fake_official_build_for_cert_report_testing = true;
}
void CertReportHelper::PopulateExtendedReportingOption(
......@@ -204,7 +204,7 @@ bool CertReportHelper::ShouldShowCertificateReporterCheckbox() {
bool CertReportHelper::ShouldReportCertificateError() {
DCHECK(ShouldShowCertificateReporterCheckbox());
bool is_official_build = g_is_fake_official_build_for_testing;
bool is_official_build = g_is_fake_official_build_for_cert_report_testing;
#if defined(OFFICIAL_BUILD) && defined(GOOGLE_CHROME_BUILD)
is_official_build = true;
#endif
......
......@@ -31,10 +31,11 @@ static const uint32_t kServerPublicKeyVersion = 1;
static const char kHkdfLabel[] = "certificate report";
constexpr net::NetworkTrafficAnnotationTag kTrafficAnnotation =
net::DefineNetworkTrafficAnnotation(
"safe_browsing_certificate_error_reporting",
R"(
constexpr net::NetworkTrafficAnnotationTag
kSafeBrowsingCertificateErrorReportingTrafficAnnotation =
net::DefineNetworkTrafficAnnotation(
"safe_browsing_certificate_error_reporting",
R"(
semantics {
sender: "Safe Browsing Extended Reporting"
description:
......@@ -77,8 +78,9 @@ CertificateErrorReporter::CertificateErrorReporter(
upload_url,
kServerPublicKey,
kServerPublicKeyVersion,
std::make_unique<net::ReportSender>(request_context,
kTrafficAnnotation)) {}
std::make_unique<net::ReportSender>(
request_context,
kSafeBrowsingCertificateErrorReportingTrafficAnnotation)) {}
CertificateErrorReporter::CertificateErrorReporter(
const GURL& upload_url,
......
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