Commit f2b44497 authored by Nicolas Ouellet-Payeur's avatar Nicolas Ouellet-Payeur Committed by Commit Bot

Revert "[Traffic Annotation] Remove function_context from extractor output"

This reverts commit 17ccf43e.

Reason for revert: suspecting that this makes the presubmit check not run on most CLs (crbug/949382)

Original change's description:
> [Traffic Annotation] Remove function_context from extractor output
> 
> The new extractor can't trivially determine the name of the enclosing
> function, and it didn't bring much value anyways.
> 
> Bug: 966883
> Change-Id: I7b52050730186c6972754d3b9e577d4c4740d5dc
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1686621
> Reviewed-by: Nico Weber <thakis@chromium.org>
> Reviewed-by: Ramin Halavati <rhalavati@chromium.org>
> Commit-Queue: Nicolas Ouellet-Payeur <nicolaso@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#675223}

TBR=thakis@chromium.org,rhalavati@chromium.org,nicolaso@chromium.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: 966883
Change-Id: I0c326313df18b7b05f7a41cd58e6d1e491277ae5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1715423Reviewed-by: default avatarNicolas Ouellet-Payeur <nicolaso@chromium.org>
Commit-Queue: Nicolas Ouellet-Payeur <nicolaso@chromium.org>
Cr-Commit-Position: refs/heads/master@{#680626}
parent 97e77417
...@@ -47,6 +47,17 @@ namespace { ...@@ -47,6 +47,17 @@ namespace {
struct Location { struct Location {
std::string file_path; std::string file_path;
int line_number = -1; int line_number = -1;
// Name of the function including this line. E.g., in the following code,
// |function_name| will be 'foo' for all |line_number| values 101-103.
//
// 100 void foo() {
// 101 NetworkTrafficAnnotationTag baz =
// 102 net::DefineNetworkTrafficAnnotation(...); }
// 103 bar(baz);
// 104 }
// If no function is found, 'Global Namespace' will be returned.
std::string function_name;
}; };
// An instance of a call to either of the 4 network traffic annotation // An instance of a call to either of the 4 network traffic annotation
...@@ -154,6 +165,13 @@ class NetworkAnnotationTagCallback : public MatchFinder::MatchCallback { ...@@ -154,6 +165,13 @@ class NetworkAnnotationTagCallback : public MatchFinder::MatchCallback {
location->line_number = location->line_number =
result.SourceManager->getSpellingLineNumber(source_location); result.SourceManager->getSpellingLineNumber(source_location);
const clang::FunctionDecl* ancestor =
result.Nodes.getNodeAs<clang::FunctionDecl>("function_context");
if (ancestor)
location->function_name = ancestor->getQualifiedNameAsString();
else
location->function_name = "Global Namespace";
std::replace(location->file_path.begin(), location->file_path.end(), '\\', std::replace(location->file_path.begin(), location->file_path.end(), '\\',
'/'); '/');
...@@ -178,11 +196,32 @@ class NetworkAnnotationTagCallback : public MatchFinder::MatchCallback { ...@@ -178,11 +196,32 @@ class NetworkAnnotationTagCallback : public MatchFinder::MatchCallback {
collector_->calls.push_back(instance); collector_->calls.push_back(instance);
} }
// Tests if the given function name belongs to the network traffic annotation
// API. These functions are all defined in
// 'net/traffic_annotation/network_traffic_annotation.h'.
bool IsAPIFunction(const std::string& function_name) {
return function_name == "net::NetworkTrafficAnnotationTag::NotReached" ||
function_name == "net::DefineNetworkTrafficAnnotation" ||
function_name == "net::DefinePartialNetworkTrafficAnnotation" ||
function_name == "net::CompleteNetworkTrafficAnnotation" ||
function_name == "net::BranchedCompleteNetworkTrafficAnnotation" ||
function_name ==
"net::MutableNetworkTrafficAnnotationTag::operator "
"NetworkTrafficAnnotationTag" ||
function_name ==
"net::MutablePartialNetworkTrafficAnnotationTag::operator "
"PartialNetworkTrafficAnnotationTag";
}
// Stores an annotation constructor called with list expression. // Stores an annotation constructor called with list expression.
void AddConstructor(const clang::CXXConstructExpr* constructor_expr, void AddConstructor(const clang::CXXConstructExpr* constructor_expr,
const MatchFinder::MatchResult& result) { const MatchFinder::MatchResult& result) {
Location instance; Location instance;
GetInstanceLocation(result, constructor_expr, &instance); GetInstanceLocation(result, constructor_expr, &instance);
// Only report if the constructor is not in one of the API functions for
// network traffic annotations.
if (!IsAPIFunction(instance.function_name))
collector_->assignments.push_back(instance); collector_->assignments.push_back(instance);
} }
...@@ -190,7 +229,11 @@ class NetworkAnnotationTagCallback : public MatchFinder::MatchCallback { ...@@ -190,7 +229,11 @@ class NetworkAnnotationTagCallback : public MatchFinder::MatchCallback {
void AddAssignment(const clang::MemberExpr* member_expr, void AddAssignment(const clang::MemberExpr* member_expr,
const MatchFinder::MatchResult& result) { const MatchFinder::MatchResult& result) {
Location instance; Location instance;
GetInstanceLocation(result, member_expr, &instance); GetInstanceLocation(result, member_expr, &instance);
// Only report if the assignment is not in one of the API functions for
// network traffic annotations.
if (!IsAPIFunction(instance.function_name))
collector_->assignments.push_back(instance); collector_->assignments.push_back(instance);
} }
...@@ -371,6 +414,7 @@ int main(int argc, const char* argv[]) { ...@@ -371,6 +414,7 @@ int main(int argc, const char* argv[]) {
for (const NetworkAnnotationInstance& instance : collector.annotations) { for (const NetworkAnnotationInstance& instance : collector.annotations) {
llvm::outs() << "==== NEW ANNOTATION ====\n"; llvm::outs() << "==== NEW ANNOTATION ====\n";
llvm::outs() << instance.location.file_path << "\n"; llvm::outs() << instance.location.file_path << "\n";
llvm::outs() << instance.location.function_name << "\n";
llvm::outs() << instance.location.line_number << "\n"; llvm::outs() << instance.location.line_number << "\n";
llvm::outs() << instance.GetTypeName() << "\n"; llvm::outs() << instance.GetTypeName() << "\n";
llvm::outs() << instance.annotation.unique_id << "\n"; llvm::outs() << instance.annotation.unique_id << "\n";
...@@ -383,6 +427,7 @@ int main(int argc, const char* argv[]) { ...@@ -383,6 +427,7 @@ int main(int argc, const char* argv[]) {
for (const CallInstance& instance : collector.calls) { for (const CallInstance& instance : collector.calls) {
llvm::outs() << "==== NEW CALL ====\n"; llvm::outs() << "==== NEW CALL ====\n";
llvm::outs() << instance.location.file_path << "\n"; llvm::outs() << instance.location.file_path << "\n";
llvm::outs() << instance.location.function_name << "\n";
llvm::outs() << instance.location.line_number << "\n"; llvm::outs() << instance.location.line_number << "\n";
llvm::outs() << instance.called_function_name << "\n"; llvm::outs() << instance.called_function_name << "\n";
llvm::outs() << instance.has_annotation << "\n"; llvm::outs() << instance.has_annotation << "\n";
...@@ -393,6 +438,7 @@ int main(int argc, const char* argv[]) { ...@@ -393,6 +438,7 @@ int main(int argc, const char* argv[]) {
for (const Location& instance : collector.assignments) { for (const Location& instance : collector.assignments) {
llvm::outs() << "==== NEW ASSIGNMENT ====\n"; llvm::outs() << "==== NEW ASSIGNMENT ====\n";
llvm::outs() << instance.file_path << "\n"; llvm::outs() << instance.file_path << "\n";
llvm::outs() << instance.function_name << "\n";
llvm::outs() << instance.line_number << "\n"; llvm::outs() << instance.line_number << "\n";
llvm::outs() << "==== ASSIGNMENT ENDS ====\n"; llvm::outs() << "==== ASSIGNMENT ENDS ====\n";
} }
......
...@@ -95,7 +95,8 @@ test("traffic_annotation_auditor_unittests") { ...@@ -95,7 +95,8 @@ test("traffic_annotation_auditor_unittests") {
"tests/annotations_sample1.xml", "tests/annotations_sample1.xml",
"tests/annotations_sample2.xml", "tests/annotations_sample2.xml",
"tests/annotations_sample3.xml", "tests/annotations_sample3.xml",
"tests/extractor_outputs/bad_assignment.txt", "tests/extractor_outputs/bad_assignment1.txt",
"tests/extractor_outputs/bad_assignment2.txt",
"tests/extractor_outputs/bad_call.txt", "tests/extractor_outputs/bad_call.txt",
"tests/extractor_outputs/bad_syntax_annotation1.txt", "tests/extractor_outputs/bad_syntax_annotation1.txt",
"tests/extractor_outputs/bad_syntax_annotation2.txt", "tests/extractor_outputs/bad_syntax_annotation2.txt",
......
...@@ -130,13 +130,14 @@ AuditorResult AnnotationInstance::Deserialize( ...@@ -130,13 +130,14 @@ AuditorResult AnnotationInstance::Deserialize(
const std::vector<std::string>& serialized_lines, const std::vector<std::string>& serialized_lines,
int start_line, int start_line,
int end_line) { int end_line) {
if (end_line - start_line < 6) { if (end_line - start_line < 7) {
return AuditorResult(AuditorResult::Type::ERROR_FATAL, return AuditorResult(AuditorResult::Type::ERROR_FATAL,
"Not enough lines to deserialize annotation."); "Not enough lines to deserialize annotation.");
} }
// Extract header lines. // Extract header lines.
const std::string& file_path = serialized_lines[start_line++]; const std::string& file_path = serialized_lines[start_line++];
const std::string& function_context = serialized_lines[start_line++];
int line_number; int line_number;
base::StringToInt(serialized_lines[start_line++], &line_number); base::StringToInt(serialized_lines[start_line++], &line_number);
std::string function_type = serialized_lines[start_line++]; std::string function_type = serialized_lines[start_line++];
...@@ -195,6 +196,7 @@ AuditorResult AnnotationInstance::Deserialize( ...@@ -195,6 +196,7 @@ AuditorResult AnnotationInstance::Deserialize(
traffic_annotation::NetworkTrafficAnnotation_TrafficSource* src = traffic_annotation::NetworkTrafficAnnotation_TrafficSource* src =
proto.mutable_source(); proto.mutable_source();
src->set_file(file_path); src->set_file(file_path);
src->set_function(function_context);
src->set_line(line_number); src->set_line(line_number);
proto.set_unique_id(unique_id); proto.set_unique_id(unique_id);
second_id_hash_code = TrafficAnnotationAuditor::ComputeHashValue(second_id); second_id_hash_code = TrafficAnnotationAuditor::ComputeHashValue(second_id);
...@@ -643,6 +645,7 @@ CallInstance::CallInstance() : line_number(0), is_annotated(false) {} ...@@ -643,6 +645,7 @@ CallInstance::CallInstance() : line_number(0), is_annotated(false) {}
CallInstance::CallInstance(const CallInstance& other) CallInstance::CallInstance(const CallInstance& other)
: file_path(other.file_path), : file_path(other.file_path),
line_number(other.line_number), line_number(other.line_number),
function_context(other.function_context),
function_name(other.function_name), function_name(other.function_name),
is_annotated(other.is_annotated) {} is_annotated(other.is_annotated) {}
...@@ -650,12 +653,13 @@ AuditorResult CallInstance::Deserialize( ...@@ -650,12 +653,13 @@ AuditorResult CallInstance::Deserialize(
const std::vector<std::string>& serialized_lines, const std::vector<std::string>& serialized_lines,
int start_line, int start_line,
int end_line) { int end_line) {
if (end_line - start_line != 4) { if (end_line - start_line != 5) {
return AuditorResult(AuditorResult::Type::ERROR_FATAL, return AuditorResult(AuditorResult::Type::ERROR_FATAL,
"Not enough lines to deserialize call."); "Not enough lines to deserialize call.");
} }
file_path = serialized_lines[start_line++]; file_path = serialized_lines[start_line++];
function_context = serialized_lines[start_line++];
int line_number_int; int line_number_int;
base::StringToInt(serialized_lines[start_line++], &line_number_int); base::StringToInt(serialized_lines[start_line++], &line_number_int);
line_number = static_cast<uint32_t>(line_number_int); line_number = static_cast<uint32_t>(line_number_int);
...@@ -669,17 +673,20 @@ AuditorResult CallInstance::Deserialize( ...@@ -669,17 +673,20 @@ AuditorResult CallInstance::Deserialize(
AssignmentInstance::AssignmentInstance() : line_number(0) {} AssignmentInstance::AssignmentInstance() : line_number(0) {}
AssignmentInstance::AssignmentInstance(const AssignmentInstance& other) AssignmentInstance::AssignmentInstance(const AssignmentInstance& other)
: file_path(other.file_path), line_number(other.line_number) {} : file_path(other.file_path),
line_number(other.line_number),
function_context(other.function_context) {}
AuditorResult AssignmentInstance::Deserialize( AuditorResult AssignmentInstance::Deserialize(
const std::vector<std::string>& serialized_lines, const std::vector<std::string>& serialized_lines,
int start_line, int start_line,
int end_line) { int end_line) {
if (end_line - start_line != 2) { if (end_line - start_line != 3) {
return AuditorResult(AuditorResult::Type::ERROR_FATAL, return AuditorResult(AuditorResult::Type::ERROR_FATAL,
"Not enough lines to deserialize assignment."); "Not enough lines to deserialize assignment.");
} }
file_path = serialized_lines[start_line++]; file_path = serialized_lines[start_line++];
function_context = serialized_lines[start_line++];
int line_number_int; int line_number_int;
base::StringToInt(serialized_lines[start_line++], &line_number_int); base::StringToInt(serialized_lines[start_line++], &line_number_int);
line_number = static_cast<uint32_t>(line_number_int); line_number = static_cast<uint32_t>(line_number_int);
......
...@@ -156,6 +156,9 @@ class CallInstance : public InstanceBase { ...@@ -156,6 +156,9 @@ class CallInstance : public InstanceBase {
std::string file_path; std::string file_path;
uint32_t line_number; uint32_t line_number;
// Name of the function in which the call happens.
std::string function_context;
// Name of the function that may need annotation. // Name of the function that may need annotation.
std::string function_name; std::string function_name;
...@@ -184,6 +187,9 @@ class AssignmentInstance : public InstanceBase { ...@@ -184,6 +187,9 @@ class AssignmentInstance : public InstanceBase {
std::string file_path; std::string file_path;
uint32_t line_number; uint32_t line_number;
// Name of the function in which assignment happens.
std::string function_context;
}; };
#endif // TOOLS_TRAFFIC_ANNOTATION_AUDITOR_INSTANCE_H_ #endif // TOOLS_TRAFFIC_ANNOTATION_AUDITOR_INSTANCE_H_
components/download/internal/proto_conversions.cc
\ No newline at end of file
components/download/internal/proto_conversions.cc
267
\ No newline at end of file
components/download/internal/proto_conversions.cc
download::ProtoConversions::EntryFromProto
\ No newline at end of file
headless/public/util/http_url_fetcher.cc headless/public/util/http_url_fetcher.cc
headless::HttpURLFetcher::Delegate::Delegate
net::URLRequestContext::CreateRequest net::URLRequestContext::CreateRequest
1 1
\ No newline at end of file
chrome/browser/supervised_user/legacy/supervised_user_refresh_token_fetcher.cc chrome/browser/supervised_user/legacy/supervised_user_refresh_token_fetcher.cc
OnGetTokenSuccess
166 166
Definition Definition
supervised_user_refresh_token_fetcher supervised_user_refresh_token_fetcher
......
chrome/browser/supervised_user/legacy/supervised_user_refresh_token_fetcher.cc chrome/browser/supervised_user/legacy/supervised_user_refresh_token_fetcher.cc
OnGetTokenSuccess
166 166
Definition Definition
supervised_user_refresh_token_fetcher supervised_user_refresh_token_fetcher
......
chrome/browser/supervised_user/legacy/supervised_user_refresh_token_fetcher.cc chrome/browser/supervised_user/legacy/supervised_user_refresh_token_fetcher.cc
OnGetTokenSuccess
166 166
Definition Definition
supervised_user_refresh_token_fetcher supervised_user_refresh_token_fetcher
......
chrome/browser/supervised_user/legacy/supervised_user_refresh_token_fetcher.cc chrome/browser/supervised_user/legacy/supervised_user_refresh_token_fetcher.cc
OnGetTokenSuccess
166 166
Definition Definition
supervised_user_refresh_token_fetcher supervised_user_refresh_token_fetcher
......
chrome/browser/supervised_user/legacy/supervised_user_refresh_token_fetcher.cc chrome/browser/supervised_user/legacy/supervised_user_refresh_token_fetcher.cc
OnGetTokenSuccess
Definition Definition
supervised_user_refresh_token_fetcher supervised_user_refresh_token_fetcher
......
chrome/browser/supervised_user/legacy/supervised_user_refresh_token_fetcher.cc chrome/browser/supervised_user/legacy/supervised_user_refresh_token_fetcher.cc
OnGetTokenSuccess
122 122
definition definition
supervised_user_refresh_token_fetcher supervised_user_refresh_token_fetcher
......
chrome/browser/supervised_user/legacy/supervised_user_refresh_token_fetcher.cc chrome/browser/supervised_user/legacy/supervised_user_refresh_token_fetcher.cc
OnGetTokenSuccess
122 122
definition definition
supervised_user_refresh_token_fetcher supervised_user_refresh_token_fetcher
components/download/internal/background_service/proto_conversions.cc components/download/internal/background_service/proto_conversions.cc
download::ProtoConversions::EntryFromProto
267 267
\ No newline at end of file
chrome/service/cloud_print/cloud_print_url_fetcher.cc chrome/service/cloud_print/cloud_print_url_fetcher.cc
cloud_print::CloudPrintURLFetcher::StartRequestHelper
265 265
BranchedCompleting BranchedCompleting
cloud_print cloud_print
......
headless/public/util/http_url_fetcher.cc headless/public/util/http_url_fetcher.cc
headless::HttpURLFetcher::Delegate::Delegate
100 100
net::URLRequestContext::CreateRequest net::URLRequestContext::CreateRequest
1 1
\ No newline at end of file
chrome/browser/supervised_user/legacy/supervised_user_refresh_token_fetcher.cc chrome/browser/supervised_user/legacy/supervised_user_refresh_token_fetcher.cc
OnGetTokenSuccess
166 166
Definition Definition
supervised_user_refresh_token_fetcher supervised_user_refresh_token_fetcher
......
chrome/service/cloud_print/cloud_print_url_fetcher.cc chrome/service/cloud_print/cloud_print_url_fetcher.cc
cloud_print::CloudPrintURLFetcher::StartRequestHelper
265 265
Completing Completing
cloud_print cloud_print
......
components/browsing_data/core/counters/history_counter.cc components/browsing_data/core/counters/history_counter.cc
browsing_data::HistoryCounter::Count
98 98
Partial Partial
web_history_counter web_history_counter
......
google_apis/drive/request_sender_unittest.cc google_apis/drive/request_sender_unittest.cc
google_apis::(anonymous namespace)::RequestSenderTest::RequestSenderTest
67 67
Definition Definition
test test
......
net/url_request/url_request_context.cc net/url_request/url_request_context.cc
net::URLRequestContext::CreateRequest
120 120
Definition Definition
missing missing
......
...@@ -334,6 +334,7 @@ TEST_F(TrafficAnnotationAuditorTest, AnnotationDeserialization) { ...@@ -334,6 +334,7 @@ TEST_F(TrafficAnnotationAuditorTest, AnnotationDeserialization) {
EXPECT_EQ(annotation.proto.source().file(), EXPECT_EQ(annotation.proto.source().file(),
"chrome/browser/supervised_user/legacy/" "chrome/browser/supervised_user/legacy/"
"supervised_user_refresh_token_fetcher.cc"); "supervised_user_refresh_token_fetcher.cc");
EXPECT_EQ(annotation.proto.source().function(), "OnGetTokenSuccess");
EXPECT_EQ(annotation.proto.source().line(), 166); EXPECT_EQ(annotation.proto.source().line(), 166);
EXPECT_EQ(annotation.proto.semantics().sender(), "Supervised Users"); EXPECT_EQ(annotation.proto.semantics().sender(), "Supervised Users");
EXPECT_EQ(annotation.proto.policy().cookies_allowed(), 1); EXPECT_EQ(annotation.proto.policy().cookies_allowed(), 1);
...@@ -364,6 +365,8 @@ TEST_F(TrafficAnnotationAuditorTest, CallDeserialization) { ...@@ -364,6 +365,8 @@ TEST_F(TrafficAnnotationAuditorTest, CallDeserialization) {
EXPECT_EQ(call.file_path, "headless/public/util/http_url_fetcher.cc"); EXPECT_EQ(call.file_path, "headless/public/util/http_url_fetcher.cc");
EXPECT_EQ(call.line_number, 100u); EXPECT_EQ(call.line_number, 100u);
EXPECT_EQ(call.function_context,
"headless::HttpURLFetcher::Delegate::Delegate");
EXPECT_EQ(call.function_name, "net::URLRequestContext::CreateRequest"); EXPECT_EQ(call.function_name, "net::URLRequestContext::CreateRequest");
EXPECT_EQ(call.is_annotated, true); EXPECT_EQ(call.is_annotated, true);
} }
...@@ -378,7 +381,8 @@ TEST_F(TrafficAnnotationAuditorTest, AssignmentDeserialization) { ...@@ -378,7 +381,8 @@ TEST_F(TrafficAnnotationAuditorTest, AssignmentDeserialization) {
Assignmentample test_cases[] = { Assignmentample test_cases[] = {
{"good_assignment.txt", AuditorResult::Type::RESULT_OK}, {"good_assignment.txt", AuditorResult::Type::RESULT_OK},
{"bad_assignment.txt", AuditorResult::Type::ERROR_FATAL}, {"bad_assignment1.txt", AuditorResult::Type::ERROR_FATAL},
{"bad_assignment2.txt", AuditorResult::Type::ERROR_FATAL},
}; };
for (const auto& test_case : test_cases) { for (const auto& test_case : test_cases) {
......
...@@ -74,5 +74,5 @@ and land the resulting CL. ...@@ -74,5 +74,5 @@ and land the resulting CL.
The following two lines will be updated by the above script, and the modified The following two lines will be updated by the above script, and the modified
README should be committed along with the updated .sha1 checksums. README should be committed along with the updated .sha1 checksums.
CLANG_REVISION = 'd874c057bc2361da5157553e1e2178f43c3ade1a' CLANG_REVISION = '360094'
LASTCHANGE=5a2618740eb68a63b73a40f08a13b1e337cb6399-refs/heads/master@{#674114} LASTCHANGE=ecda211dff8f3722704938f87637e0df657d15f1-refs/heads/master@{#659930}
24a6a97630bc133de57c4812af3abca8763b5a7f 73004f4964def13577f9d060d77908d51c30d521
\ No newline at end of file \ No newline at end of file
8618305abe807cbeefaaa512e47796f89116bf98 c4e2a772fbab2f1f7e47cf8f4f23425933f8cd0f
\ No newline at end of file \ No newline at end of file
fe1e664643c009ca4c16fbe3cabe34a206ca50ee e3c00e2607fbe0d5758e60bc42c6802feacdea08
\ No newline at end of file \ No newline at end of file
76bd7403ff65eeeb27c7c56dda2688e3d9319053 eac43e1fb9f3fb1a300515061ad9daef6d51839d
\ No newline at end of file \ No newline at end of file
...@@ -54,6 +54,13 @@ class Annotation: ...@@ -54,6 +54,13 @@ class Annotation:
file_path: Path to the file that contains this annotation. file_path: Path to the file that contains this annotation.
""" """
self.file_path = file_path self.file_path = file_path
# TODO(crbug/966883): Remove function_name from here and from the clang
# tool's output.
#
# |function_name| is not supported, but keep it in the output for
# compatibility with the clang tool. Use an obviously wrong function name
# in case this details ends up in auditor output.
self.function_name = "XXX_UNIMPLEMENTED_XXX"
self.line_number = line_number self.line_number = line_number
self.type_name = type_name self.type_name = type_name
self.unique_id = unique_id self.unique_id = unique_id
...@@ -81,6 +88,7 @@ class Annotation: ...@@ -81,6 +88,7 @@ class Annotation:
return "\n".join(map(str, [ return "\n".join(map(str, [
"==== NEW ANNOTATION ====", "==== NEW ANNOTATION ====",
self.file_path, self.file_path,
self.function_name,
self.line_number, self.line_number,
self.type_name, self.type_name,
self.unique_id, self.unique_id,
......
==== NEW ANNOTATION ==== ==== NEW ANNOTATION ====
valid_file.cc valid_file.cc
XXX_UNIMPLEMENTED_XXX
14 14
Definition Definition
id1 id1
...@@ -25,6 +26,7 @@ id1 ...@@ -25,6 +26,7 @@ id1
==== ANNOTATION ENDS ==== ==== ANNOTATION ENDS ====
==== NEW ANNOTATION ==== ==== NEW ANNOTATION ====
valid_file.cc valid_file.cc
XXX_UNIMPLEMENTED_XXX
36 36
Partial Partial
id2 id2
...@@ -40,6 +42,7 @@ completing_id2 ...@@ -40,6 +42,7 @@ completing_id2
==== ANNOTATION ENDS ==== ==== ANNOTATION ENDS ====
==== NEW ANNOTATION ==== ==== NEW ANNOTATION ====
valid_file.cc valid_file.cc
XXX_UNIMPLEMENTED_XXX
46 46
Completing Completing
id3 id3
...@@ -59,6 +62,7 @@ id3 ...@@ -59,6 +62,7 @@ id3
==== ANNOTATION ENDS ==== ==== ANNOTATION ENDS ====
==== NEW ANNOTATION ==== ==== NEW ANNOTATION ====
valid_file.cc valid_file.cc
XXX_UNIMPLEMENTED_XXX
61 61
BranchedCompleting BranchedCompleting
id4 id4
...@@ -73,6 +77,7 @@ branch4 ...@@ -73,6 +77,7 @@ branch4
==== ANNOTATION ENDS ==== ==== ANNOTATION ENDS ====
==== NEW ANNOTATION ==== ==== NEW ANNOTATION ====
valid_file.cc valid_file.cc
XXX_UNIMPLEMENTED_XXX
126 126
Mutable Mutable
...@@ -81,6 +86,7 @@ Mutable ...@@ -81,6 +86,7 @@ Mutable
==== ANNOTATION ENDS ==== ==== ANNOTATION ENDS ====
==== NEW ANNOTATION ==== ==== NEW ANNOTATION ====
valid_file.cc valid_file.cc
XXX_UNIMPLEMENTED_XXX
86 86
Definition Definition
test test
...@@ -89,6 +95,7 @@ Traffic annotation for unit, browser and other tests ...@@ -89,6 +95,7 @@ Traffic annotation for unit, browser and other tests
==== ANNOTATION ENDS ==== ==== ANNOTATION ENDS ====
==== NEW ANNOTATION ==== ==== NEW ANNOTATION ====
valid_file.cc valid_file.cc
XXX_UNIMPLEMENTED_XXX
88 88
Partial Partial
test_partial test_partial
......
...@@ -38,6 +38,12 @@ message NetworkTrafficAnnotation { ...@@ -38,6 +38,12 @@ message NetworkTrafficAnnotation {
// specified. // specified.
string file = 1; string file = 1;
// Function name where the network request is instantiated.
// This is typically filled by the extractor and does not need to be
// specified in the source code. For manual whitelisting this needs to be
// specified.
string function = 2;
// __LINE__ in file, where the AuditPolicy object is instantiated. // __LINE__ in file, where the AuditPolicy object is instantiated.
// This is typically filled by the extractor and does not need to be // This is typically filled by the extractor and does not need to be
// specified in the source code. // specified in the source code.
......
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