Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(678)

Unified Diff: net/url_request/report_sender.cc

Issue 2846873002: Network traffic annotation added to URLFetcher. (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | net/url_request/sdch_dictionary_fetcher.cc » ('j') | net/url_request/url_fetcher_core.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/url_request/report_sender.cc
diff --git a/net/url_request/report_sender.cc b/net/url_request/report_sender.cc
index ef560151d01f26473698a5c536c4808977316d3d..fa1ad45e8ff1f04a08be9607e331d8f02a48efd9 100644
--- a/net/url_request/report_sender.cc
+++ b/net/url_request/report_sender.cc
@@ -11,6 +11,7 @@
#include "net/base/load_flags.h"
#include "net/base/request_priority.h"
#include "net/base/upload_bytes_element_reader.h"
+#include "net/traffic_annotation/network_traffic_annotation.h"
#include "net/url_request/url_request_context.h"
#include "net/url_request/url_request_status.h"
@@ -54,8 +55,29 @@ void ReportSender::Send(const GURL& report_uri,
const SuccessCallback& success_callback,
const ErrorCallback& error_callback) {
DCHECK(!content_type.empty());
- std::unique_ptr<URLRequest> url_request =
- request_context_->CreateRequest(report_uri, DEFAULT_PRIORITY, this);
+ net::NetworkTrafficAnnotationTag traffic_annotation =
+ net::DefineNetworkTrafficAnnotation("...", R"(
+ semantics {
+ sender: "..."
+ description: "..."
+ trigger: "..."
+ data: "..."
+ destination: WEBSITE/GOOGLE_OWNED_SERVICE/OTHER/LOCAL
+ }
+ policy {
+ cookies_allowed: false/true
+ cookies_store: "..."
+ setting: "..."
+ chrome_policy {
+ [POLICY_NAME] {
+ policy_options {mode: MANDATORY/RECOMMENDED/UNSET}
+ [POLICY_NAME]: ... //(value to disable it)
+ }
+ }
+ policy_exception_justification: "..."
+ })");
+ std::unique_ptr<URLRequest> url_request = request_context_->CreateRequest(
+ report_uri, DEFAULT_PRIORITY, this, traffic_annotation);
meacer 2017/04/27 17:55:28 * sender: "Safe Browsing Extended Reporting" Howe
Jialiu Lin 2017/04/27 18:04:53 I think the annotation should be added to each of
estark 2017/04/28 05:18:28 Yeah, I agree with Jialiu that it's infeasible to
url_request->SetUserData(
&kUserDataKey,
base::MakeUnique<CallbackInfo>(success_callback, error_callback));
« no previous file with comments | « no previous file | net/url_request/sdch_dictionary_fetcher.cc » ('j') | net/url_request/url_fetcher_core.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698