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

Unified Diff: content/browser/loader/resource_dispatcher_host_impl.cc

Issue 2843403002: Network traffic annotation added to ResourceDisaptcherHostImpl. (Closed)
Patch Set: Annotation updated. 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/loader/resource_dispatcher_host_impl.cc
diff --git a/content/browser/loader/resource_dispatcher_host_impl.cc b/content/browser/loader/resource_dispatcher_host_impl.cc
index 4a9724ec16cd5771bbf2add1558c8f68eb532f35..d9ae3d98e295a4edc67112b616ae1e6688f0da1e 100644
--- a/content/browser/loader/resource_dispatcher_host_impl.cc
+++ b/content/browser/loader/resource_dispatcher_host_impl.cc
@@ -105,6 +105,7 @@
#include "net/log/net_log_with_source.h"
#include "net/ssl/client_cert_store.h"
#include "net/ssl/ssl_cert_request_info.h"
+#include "net/traffic_annotation/network_traffic_annotation.h"
#include "net/url_request/url_request.h"
#include "net/url_request/url_request_context.h"
#include "net/url_request/url_request_job_factory.h"
@@ -127,6 +128,35 @@ using SyncLoadResultCallback =
// ----------------------------------------------------------------------------
+namespace {
+
+constexpr net::NetworkTrafficAnnotationTag kTrafficAnnotation =
+ net::DefineNetworkTrafficAnnotation("resource_dispather_host", R"(
+ semantics {
+ sender: "Resource Dispatcher Host"
+ description:
+ "Navigation-initiated request or renderer process initiated "
+ "request, which includes all resources for normal page loads, "
+ "chrome URLs, resources for installed extensions, as well as "
+ "downloads."
+ trigger:
+ "Navigating to a URL or downloading a file. A webpage, "
+ "ServiceWorker, chrome:// page, or extension may also initiate "
+ "requests in the background."
+ data: "Anything the initiator wants to send."
+ destination: OTHER
+ }
+ policy {
+ cookies_allowed: true
+ cookies_store: "user or per-app cookie store"
+ setting: "These requests cannot be disabled."
+ policy_exception_justification:
+ "Not implemented. Without these requests, Chrome will be unable to "
+ "load any webpage."
+ })");
+
+} // namespace
+
namespace content {
namespace {
@@ -1207,7 +1237,7 @@ void ResourceDispatcherHostImpl::ContinuePendingBeginRequest(
std::unique_ptr<net::URLRequest> new_request = request_context->CreateRequest(
is_navigation_stream_request ? request_data.resource_body_stream_url
: request_data.url,
- request_data.priority, nullptr);
+ request_data.priority, nullptr, kTrafficAnnotation);
// Log that this request is a service worker navigation preload request here,
// since navigation preload machinery has no access to netlog.
@@ -1972,7 +2002,7 @@ void ResourceDispatcherHostImpl::BeginNavigationRequest(
std::unique_ptr<net::URLRequest> new_request;
new_request = request_context->CreateRequest(
- info.common_params.url, net::HIGHEST, nullptr);
+ info.common_params.url, net::HIGHEST, nullptr, kTrafficAnnotation);
new_request->set_method(info.common_params.method);
new_request->set_first_party_for_cookies(
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698