Commit 956ce4c3 authored by rhalavati@google.com's avatar rhalavati@google.com Committed by Commit Bot

Add temporary annotation tag to auditor.

A temporary network traffic annotation tag is added to be used during
refactoring of the socket classes. Network Traffic Annotation Auditor
is updated to add this tag to reserved words and ignore it in tests.

Bug: 690323
Change-Id: I79f570ced37a8572b6f495de478d18d998dc4189
Reviewed-on: https://chromium-review.googlesource.com/813674Reviewed-by: default avatarMartin Šrámek <msramek@chromium.org>
Commit-Queue: Ramin Halavati <rhalavati@chromium.org>
Cr-Commit-Position: refs/heads/master@{#522391}
parent 3ace642d
...@@ -128,6 +128,13 @@ AuditorResult AnnotationInstance::Deserialize( ...@@ -128,6 +128,13 @@ AuditorResult AnnotationInstance::Deserialize(
return AuditorResult(AuditorResult::Type::ERROR_MISSING_TAG_USED, "", return AuditorResult(AuditorResult::Type::ERROR_MISSING_TAG_USED, "",
file_path, line_number); file_path, line_number);
// TODO(crbug.com/656607): Remove this test.
// Process temporary tag.
if (unique_id_hash_code ==
NO_TRAFFIC_ANNOTATION_BUG_656607.unique_id_hash_code) {
return AuditorResult(AuditorResult::Type::RESULT_IGNORE);
}
// Decode serialized proto. // Decode serialized proto.
std::string annotation_text = ""; std::string annotation_text = "";
while (start_line < end_line) { while (start_line < end_line) {
......
...@@ -37,7 +37,7 @@ std::map<int, std::string> kReservedAnnotations = { ...@@ -37,7 +37,7 @@ std::map<int, std::string> kReservedAnnotations = {
{PARTIAL_TRAFFIC_ANNOTATION_FOR_TESTS.unique_id_hash_code, "test_partial"}, {PARTIAL_TRAFFIC_ANNOTATION_FOR_TESTS.unique_id_hash_code, "test_partial"},
{NO_TRAFFIC_ANNOTATION_YET.unique_id_hash_code, "undefined"}, {NO_TRAFFIC_ANNOTATION_YET.unique_id_hash_code, "undefined"},
{MISSING_TRAFFIC_ANNOTATION.unique_id_hash_code, "missing"}, {MISSING_TRAFFIC_ANNOTATION.unique_id_hash_code, "missing"},
}; {NO_TRAFFIC_ANNOTATION_BUG_656607.unique_id_hash_code, "undefined-656607"}};
struct AnnotationID { struct AnnotationID {
// Two ids can be the same in the following cases: // Two ids can be the same in the following cases:
......
...@@ -350,7 +350,8 @@ TEST_F(TrafficAnnotationAuditorTest, GetReservedUniqueIDs) { ...@@ -350,7 +350,8 @@ TEST_F(TrafficAnnotationAuditorTest, GetReservedUniqueIDs) {
PARTIAL_TRAFFIC_ANNOTATION_FOR_TESTS.unique_id_hash_code, PARTIAL_TRAFFIC_ANNOTATION_FOR_TESTS.unique_id_hash_code,
NO_TRAFFIC_ANNOTATION_YET.unique_id_hash_code, NO_TRAFFIC_ANNOTATION_YET.unique_id_hash_code,
NO_PARTIAL_TRAFFIC_ANNOTATION_YET.unique_id_hash_code, NO_PARTIAL_TRAFFIC_ANNOTATION_YET.unique_id_hash_code,
MISSING_TRAFFIC_ANNOTATION.unique_id_hash_code}; MISSING_TRAFFIC_ANNOTATION.unique_id_hash_code,
NO_TRAFFIC_ANNOTATION_BUG_656607.unique_id_hash_code};
std::map<int, std::string> reserved_words = std::map<int, std::string> reserved_words =
TrafficAnnotationAuditor::GetReservedUniqueIDs(); TrafficAnnotationAuditor::GetReservedUniqueIDs();
......
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