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

Unified Diff: net/url_request/url_fetcher_core.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
Index: net/url_request/url_fetcher_core.cc
diff --git a/net/url_request/url_fetcher_core.cc b/net/url_request/url_fetcher_core.cc
index 98edef63c8e3a70b7e7d7ec32f894caf54be1bf7..76cbb57b7dd6a5e748c84db64fa63ff961a678f4 100644
--- a/net/url_request/url_fetcher_core.cc
+++ b/net/url_request/url_fetcher_core.cc
@@ -25,6 +25,7 @@
#include "net/base/upload_data_stream.h"
#include "net/base/upload_file_element_reader.h"
#include "net/http/http_response_headers.h"
+#include "net/traffic_annotation/network_traffic_annotation.h"
#include "net/url_request/redirect_info.h"
#include "net/url_request/url_fetcher_delegate.h"
#include "net/url_request/url_fetcher_response_writer.h"
@@ -551,8 +552,29 @@ void URLFetcherCore::StartURLRequest() {
g_registry.Get().AddURLFetcherCore(this);
current_response_bytes_ = 0;
request_context_getter_->AddObserver(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: "..."
+ })");
request_ = request_context_getter_->GetURLRequestContext()->CreateRequest(
- original_url_, DEFAULT_PRIORITY, this);
+ original_url_, DEFAULT_PRIORITY, this, traffic_annotation);
asanka 2017/04/27 14:36:34 URLFetcherCore is just doing the work for URLFetch
int flags = request_->load_flags() | load_flags_;
// TODO(mmenke): This should really be with the other code to set the upload
« net/url_request/report_sender.cc ('K') | « net/url_request/sdch_dictionary_fetcher.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698