Commit f16d9ea8 authored by rhalavati@chromium.org's avatar rhalavati@chromium.org Committed by Commit Bot

Remove extra patterns from Traffic Annotation Extractor.

Socket patterns are no longer required in traffic annotation tests,
hence they are removed from traffic_annotation_extractor clang tool.

The original plan was to have network traffic annotation as an optional
argument of socket create functions, and we needed to check if the
argument existed for all calls that originate from Chrome. This is now
changed to having annotations as a mandatory argument of the socket
write functions, and as it is enforced by the compiler, we do not need
to test it.

Bug: 690323
Change-Id: I101fb7295662c3488807091cb9a8686cfc87d249
Reviewed-on: https://chromium-review.googlesource.com/1046087
Commit-Queue: Ramin Halavati <rhalavati@chromium.org>
Reviewed-by: default avatarDaniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#556388}
parent f41d0a73
......@@ -12,13 +12,7 @@
// 2) Extracts all calls of the following network request creation functions
// and returns their source location and availability of a
// net::[Partial]NetworkTrafficAnnotation parameter in them:
// - SSLClientSocket::SSLClientSocket
// - TCPClientSocket::TCPClientSocket
// - UDPClientSocket::UDPClientSocket
// - URLFetcher::Create
// - ClientSocketFactory::CreateDatagramClientSocket
// - ClientSocketFactory::CreateSSLClientSocket
// - ClientSocketFactory::CreateTransportClientSocket
// - URLRequestContext::CreateRequest
// 3) Finds all instances of initializing any of the following classes with list
// expressions or assignment of a value to |unique_id_hash_code| of the
......@@ -349,18 +343,11 @@ int RunMatchers(clang::tooling::ClangTool* clang_tool, Collector* collector) {
// Setup patterns to find functions that should be monitored.
match_finder.addMatcher(
callExpr(
hasDeclaration(functionDecl(
anyOf(hasName("SSLClientSocket::SSLClientSocket"),
hasName("TCPClientSocket::TCPClientSocket"),
hasName("UDPClientSocket::UDPClientSocket"),
hasName("URLFetcher::Create"),
hasName("ClientSocketFactory::CreateDatagramClientSocket"),
hasName("ClientSocketFactory::CreateSSLClientSocket"),
hasName("ClientSocketFactory::CreateTransportClientSocket"),
hasName("URLRequestContext::CreateRequest")),
has_annotation_parameter)),
bind_function_context_if_present)
callExpr(hasDeclaration(functionDecl(
anyOf(hasName("URLFetcher::Create"),
hasName("URLRequestContext::CreateRequest")),
has_annotation_parameter)),
bind_function_context_if_present)
.bind("monitored_function"),
&callback);
......
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