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

Unified Diff: components/ntp_tiles/icon_cacher_impl.cc

Issue 2794343002: Network traffic annotation added to image_data_fetcher. (Closed)
Patch Set: Annotation updated. Created 3 years, 7 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: components/ntp_tiles/icon_cacher_impl.cc
diff --git a/components/ntp_tiles/icon_cacher_impl.cc b/components/ntp_tiles/icon_cacher_impl.cc
index 488e102ff953f4fa9a183f9c4b5c8941a1261799..92a7d236720d009bbd790a526bc725f66df32ef5 100644
--- a/components/ntp_tiles/icon_cacher_impl.cc
+++ b/components/ntp_tiles/icon_cacher_impl.cc
@@ -15,6 +15,7 @@
#include "components/favicon_base/favicon_util.h"
#include "components/image_fetcher/core/image_decoder.h"
#include "components/image_fetcher/core/image_fetcher.h"
+#include "net/traffic_annotation/network_traffic_annotation.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/gfx/geometry/size.h"
#include "ui/gfx/image/image.h"
@@ -100,11 +101,30 @@ void IconCacherImpl::OnGetFaviconImageForPageURLFinished(
std::unique_ptr<CancelableImageCallback> preliminary_callback =
MaybeProvideDefaultIcon(site, preliminary_icon_available);
+ net::NetworkTrafficAnnotationTag traffic_annotation =
+ net::DefineNetworkTrafficAnnotation("icon_cacher", R"(
+ semantics {
+ sender: "Popular Sites New Tab Fetch"
+ description:
+ "Chrome may display a list of regionally-popular web sites on the "
+ "New Tab Page. This service fetches icons from those sites."
+ trigger:
+ "Whenever a popular site would be displayed, but its icon is not "
+ "yet cached in the browser."
+ data: "The URL for which to retrieve an icon."
+ destination: WEBSITE
+ }
+ policy {
+ cookies_allowed: false
+ setting: "This feature cannot be disabled in settings."
+ policy_exception_justification: "Not implemented."
+ })");
image_fetcher_->StartOrQueueNetworkRequest(
std::string(), IconURL(site),
base::Bind(&IconCacherImpl::OnPopularSitesFaviconDownloaded,
base::Unretained(this), site,
- base::Passed(std::move(preliminary_callback))));
+ base::Passed(std::move(preliminary_callback))),
+ traffic_annotation);
}
void IconCacherImpl::OnPopularSitesFaviconDownloaded(

Powered by Google App Engine
This is Rietveld 408576698