Commit efcf82b4 authored by Ramin Halavati's avatar Ramin Halavati Committed by Commit Bot

Missing Traffic Annotation added to ServiceWorkerFetchDispatcher.

Missing traffic annotation added to
ServiceWorkerFetchDispatcher::MaybeStartNavigationPreloadWithURLLoader

Bug: 766239
Bug: 656607
Change-Id: I4df9cd4389cfe494fb34176f9efe005f76a24f73
Reviewed-on: https://chromium-review.googlesource.com/678498
Commit-Queue: Ramin Halavati <rhalavati@chromium.org>
Reviewed-by: default avatarMatt Falkenhagen <falken@chromium.org>
Reviewed-by: default avatarMartin Šrámek <msramek@chromium.org>
Cr-Commit-Position: refs/heads/master@{#504357}
parent 6cb262dd
...@@ -296,6 +296,50 @@ ServiceWorkerMetrics::EventType FetchTypeToWaitUntilEventType( ...@@ -296,6 +296,50 @@ ServiceWorkerMetrics::EventType FetchTypeToWaitUntilEventType(
return ServiceWorkerMetrics::EventType::FETCH_WAITUNTIL; return ServiceWorkerMetrics::EventType::FETCH_WAITUNTIL;
} }
const net::NetworkTrafficAnnotationTag kNavigationPreloadTrafficAnnotation =
net::DefineNetworkTrafficAnnotation("service_worker_navigation_preload",
R"(
semantics {
sender: "Service Worker Navigation Preload"
description:
"This request is issued by a navigation to fetch the content of the "
"page that is being navigated to, in the case where a service worker "
"has been registered for the page and is using the Navigation Preload "
"API."
trigger:
"Navigating Chrome (by clicking on a link, bookmark, history item, "
"using session restore, etc)."
data:
"Arbitrary site-controlled data can be included in the URL, HTTP "
"headers, and request body. Requests may include cookies and "
"site-specific credentials."
destination: WEBSITE
}
policy {
cookies_allowed: YES
cookies_store: "user"
setting:
"This request can be prevented by disabling service workers, which can "
"be done by disabling cookie and site data under Settings, Content "
"Settings, Cookies."
chrome_policy {
URLBlacklist {
URLBlacklist: { entries: '*' }
}
}
chrome_policy {
URLWhitelist {
URLWhitelist { }
}
}
}
comments:
"Chrome would be unable to use service workers if this feature were "
"disabled, which could result in a degraded experience for websites that "
"register a service worker. Using either URLBlacklist or URLWhitelist "
"policies (or a combination of both) limits the scope of these requests."
)");
} // namespace } // namespace
// ResponseCallback is owned by the callback that is passed to // ResponseCallback is owned by the callback that is passed to
...@@ -741,7 +785,7 @@ bool ServiceWorkerFetchDispatcher::MaybeStartNavigationPreloadWithURLLoader( ...@@ -741,7 +785,7 @@ bool ServiceWorkerFetchDispatcher::MaybeStartNavigationPreloadWithURLLoader(
resource_request); resource_request);
// Start the network request for the URL using the network loader. // Start the network request for the URL using the network loader.
// TODO(falken): What to do about routing_id, request_id, traffic annotation? // TODO(falken): What to do about routing_id, request_id?
mojom::URLLoaderClientPtr url_loader_client_ptr_to_pass; mojom::URLLoaderClientPtr url_loader_client_ptr_to_pass;
url_loader_client->Bind(&url_loader_client_ptr_to_pass); url_loader_client->Bind(&url_loader_client_ptr_to_pass);
mojom::URLLoaderPtr url_loader_associated_ptr; mojom::URLLoaderPtr url_loader_associated_ptr;
...@@ -749,7 +793,8 @@ bool ServiceWorkerFetchDispatcher::MaybeStartNavigationPreloadWithURLLoader( ...@@ -749,7 +793,8 @@ bool ServiceWorkerFetchDispatcher::MaybeStartNavigationPreloadWithURLLoader(
mojo::MakeRequest(&url_loader_associated_ptr), -1 /* routing_id? */, mojo::MakeRequest(&url_loader_associated_ptr), -1 /* routing_id? */,
-1 /* request_id? */, mojom::kURLLoadOptionNone, resource_request, -1 /* request_id? */, mojom::kURLLoadOptionNone, resource_request,
std::move(url_loader_client_ptr_to_pass), std::move(url_loader_client_ptr_to_pass),
net::MutableNetworkTrafficAnnotationTag() /* empty? */); net::MutableNetworkTrafficAnnotationTag(
kNavigationPreloadTrafficAnnotation));
// Hook the load up to DelegatingURLLoader, which will call our // Hook the load up to DelegatingURLLoader, which will call our
// DelegatingURLLoaderClient. // DelegatingURLLoaderClient.
......
...@@ -39122,6 +39122,7 @@ Called by update_traffic_annotation_histograms.py.--> ...@@ -39122,6 +39122,7 @@ Called by update_traffic_annotation_histograms.py.-->
<int value="125596241" label="component_updater_utils"/> <int value="125596241" label="component_updater_utils"/>
<int value="126122632" label="web_history_expire_between_dates"/> <int value="126122632" label="web_history_expire_between_dates"/>
<int value="129652775" label="devtools_network_resource"/> <int value="129652775" label="devtools_network_resource"/>
<int value="129872904" label="service_worker_navigation_preload"/>
<int value="131180348" label="indexed_db_internals_handler"/> <int value="131180348" label="indexed_db_internals_handler"/>
<int value="131236802" label="data_reduction_proxy_secure_proxy_check"/> <int value="131236802" label="data_reduction_proxy_secure_proxy_check"/>
<int value="131741641" label="permission_reporting"/> <int value="131741641" label="permission_reporting"/>
...@@ -175,6 +175,7 @@ Refer to README.md for content description and update process. ...@@ -175,6 +175,7 @@ Refer to README.md for content description and update process.
<item id="safe_search_url_reporter" hash_code="119677115" content_hash_code="67393078" os_list="linux,windows"/> <item id="safe_search_url_reporter" hash_code="119677115" content_hash_code="67393078" os_list="linux,windows"/>
<item id="save_file_manager" hash_code="56275203" content_hash_code="56692339" os_list="linux,windows"/> <item id="save_file_manager" hash_code="56275203" content_hash_code="56692339" os_list="linux,windows"/>
<item id="sdch_dictionary_fetch" hash_code="47152935" deprecated="2017-09-16" content_hash_code="16764294"/> <item id="sdch_dictionary_fetch" hash_code="47152935" deprecated="2017-09-16" content_hash_code="16764294"/>
<item id="service_worker_navigation_preload" hash_code="129872904" content_hash_code="79473248" os_list="linux,windows"/>
<item id="service_worker_write_to_cache_job" hash_code="117963307" content_hash_code="18065724" os_list="linux,windows"/> <item id="service_worker_write_to_cache_job" hash_code="117963307" content_hash_code="18065724" os_list="linux,windows"/>
<item id="signed_in_profile_avatar" hash_code="108903331" content_hash_code="72850619" os_list="linux,windows"/> <item id="signed_in_profile_avatar" hash_code="108903331" content_hash_code="72850619" os_list="linux,windows"/>
<item id="speech_recognition_downstream" hash_code="26096088" content_hash_code="120733233" os_list="linux,windows"/> <item id="speech_recognition_downstream" hash_code="26096088" content_hash_code="120733233" os_list="linux,windows"/>
......
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