Commit 24e21016 authored by Ramin Halavati's avatar Ramin Halavati Committed by Commit Bot

Network traffic annotation added to two files.

Network traffic annotation is added to network request of:
content/browser/indexed_db/indexed_db_internals_ui.cc
content/browser/web_contents/web_contents_impl.cc

BUG=656607

Change-Id: Ifedeb2356faa1754e63227794b75d44c489ee1f8
Reviewed-on: https://chromium-review.googlesource.com/522702Reviewed-by: default avatarJochen Eisinger <jochen@chromium.org>
Reviewed-by: default avatarMartin Šrámek <msramek@chromium.org>
Reviewed-by: default avatarDavid Trainor <dtrainor@chromium.org>
Reviewed-by: default avatarDaniel Murphy <dmurph@chromium.org>
Commit-Queue: Ramin Halavati <rhalavati@chromium.org>
Cr-Commit-Position: refs/heads/master@{#485245}
parent b98c4727
......@@ -281,9 +281,29 @@ void IndexedDBInternalsUI::OnDownloadDataReady(
DCHECK_CURRENTLY_ON(BrowserThread::UI);
const GURL url = GURL(FILE_PATH_LITERAL("file://") + zip_path.value());
WebContents* web_contents = web_ui()->GetWebContents();
net::NetworkTrafficAnnotationTag traffic_annotation =
net::DefineNetworkTrafficAnnotation("indexed_db_internals_handler", R"(
semantics {
sender: "Indexed DB Internals"
description:
"This is an internal Chrome webpage that displays debug "
"information about IndexedDB usage and data, used by developers."
trigger: "When a user navigates to chrome://indexeddb-internals/."
data: "None."
destination: LOCAL
}
policy {
cookies_allowed: false
setting:
"This feature cannot be disabled by settings, but it's only "
"triggered by navigating to the specified URL."
policy_exception_justification:
"Not implemented. Indexed DB is Chrome's internal local data "
"storage.
})");
std::unique_ptr<DownloadUrlParameters> dl_params(
DownloadUrlParameters::CreateForWebContentsMainFrame(
web_contents, url, NO_TRAFFIC_ANNOTATION_YET));
DownloadUrlParameters::CreateForWebContentsMainFrame(web_contents, url,
traffic_annotation));
const GURL referrer(web_contents->GetLastCommittedURL());
dl_params->set_referrer(content::Referrer::SanitizeForRequest(
url, content::Referrer(referrer, blink::kWebReferrerPolicyDefault)));
......
......@@ -3241,11 +3241,31 @@ void WebContentsImpl::SaveFrameWithHeaders(const GURL& url,
if (entry)
post_id = entry->GetPostID();
}
net::NetworkTrafficAnnotationTag traffic_annotation =
net::DefineNetworkTrafficAnnotation("download_web_contents_frame", R"(
semantics {
sender: "Save Page Action"
description:
"Saves the given frame's URL to the local file system."
trigger:
"The user has triggered a save operation on the frame through a "
"context menu or other mechanism."
data: "None."
destination: WEBSITE
}
policy {
cookies_allowed: true
cookies_store: "user"
setting:
"This feature cannot be disabled by settings, but it's is only "
"triggered by user request."
policy_exception_justification: "Not implemented."
})");
auto params = base::MakeUnique<DownloadUrlParameters>(
url, frame_host->GetProcess()->GetID(),
frame_host->GetRenderViewHost()->GetRoutingID(),
frame_host->GetRoutingID(), storage_partition->GetURLRequestContext(),
NO_TRAFFIC_ANNOTATION_YET);
traffic_annotation);
params->set_referrer(referrer);
params->set_post_id(post_id);
if (post_id >= 0)
......
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