Commit 23f6b994 authored by Nicolas Ouellet-payeur's avatar Nicolas Ouellet-payeur Committed by Commit Bot

[SyncSetup] Reformat code for network traffic annotations

The buildbot linux-annotator-rel turned red [1] after this CL:
https://chromium-review.googlesource.com/c/chromium/src/+/2012950

extractor.py doesn't like that we use a constant instead of a
string-literal in DefinePartialNetworkTrafficAnnotation. This CL
simply replaces the constant with a string literal.

[1] https://ci.chromium.org/p/chromium/builders/ci/linux-annotator-rel/20744

Bug: 1046794
Change-Id: Iee31bfcdbb2f860b96493a154858cf391b4922ad
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2028288
Auto-Submit: Nicolas Ouellet-Payeur <nicolaso@chromium.org>
Reviewed-by: default avatarDavid Roger <droger@chromium.org>
Reviewed-by: default avatarMihai Sardarescu <msarda@chromium.org>
Commit-Queue: Nicolas Ouellet-Payeur <nicolaso@chromium.org>
Cr-Commit-Position: refs/heads/master@{#736826}
parent 0bb673f3
......@@ -15,7 +15,11 @@
#include "components/version_info/version_info.h"
namespace {
const char kQueryWebAndAppActivityPartialNetworkAnnotation[] = R"(
constexpr net::PartialNetworkTrafficAnnotationTag
kHistoryRecordingEnabledAnnotation =
net::DefinePartialNetworkTrafficAnnotation("history_recording_enabled",
"web_history_service",
R"(
semantics {
description:
"Queries history.google.com to find out if user has the 'Include "
......@@ -39,7 +43,7 @@ const char kQueryWebAndAppActivityPartialNetworkAnnotation[] = R"(
SyncDisabled: true
}
}
})";
})");
// Merges several asynchronous boolean callbacks into one that returns a boolean
// product of their responses. Deletes itself when done.
......@@ -99,14 +103,10 @@ CreateQueryWebAndAppActivityRequest(
const base::Optional<bool>&)> callback) {
DCHECK(identity_manager);
DCHECK(url_loader_factory);
net::PartialNetworkTrafficAnnotationTag partial_traffic_annotation =
net::DefinePartialNetworkTrafficAnnotation(
"history_recording_enabled", "web_history_service",
kQueryWebAndAppActivityPartialNetworkAnnotation);
return history::WebHistoryService::CreateQueryWebAndAppActivityRequest(
identity_manager, url_loader_factory, std::move(callback),
partial_traffic_annotation);
kHistoryRecordingEnabledAnnotation);
}
void IsHistoryRecordingEnabledAndCanBeUsed(
......@@ -128,13 +128,8 @@ void IsHistoryRecordingEnabledAndCanBeUsed(
return;
}
net::PartialNetworkTrafficAnnotationTag partial_traffic_annotation =
net::DefinePartialNetworkTrafficAnnotation(
"history_recording_enabled", "web_history_service",
kQueryWebAndAppActivityPartialNetworkAnnotation);
history_service->QueryWebAndAppActivity(std::move(callback),
partial_traffic_annotation);
kHistoryRecordingEnabledAnnotation);
}
void ShouldPopupDialogAboutOtherFormsOfBrowsingHistory(
......
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