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

Unified Diff: chrome/browser/search/thumbnail_source.cc

Issue 2794343002: Network traffic annotation added to image_data_fetcher. (Closed)
Patch Set: Comments addressed. 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: chrome/browser/search/thumbnail_source.cc
diff --git a/chrome/browser/search/thumbnail_source.cc b/chrome/browser/search/thumbnail_source.cc
index 2331ee0b1adbc68c205a50ceb56026989c16ac7a..277edff2587bd706eeb4f6c7a3d652e4230c4bf8 100644
--- a/chrome/browser/search/thumbnail_source.cc
+++ b/chrome/browser/search/thumbnail_source.cc
@@ -11,6 +11,7 @@
#include "chrome/browser/thumbnails/thumbnail_service.h"
#include "chrome/browser/thumbnails/thumbnail_service_factory.h"
#include "chrome/common/url_constants.h"
+#include "net/traffic_annotation/network_traffic_annotation.h"
#include "net/url_request/url_request.h"
#include "url/gurl.h"
@@ -47,12 +48,45 @@ void ThumbnailSource::StartDataRequest(
// If a local thumbnail is available for the page's URL, provide it.
callback.Run(data.get());
} else if (fallback_thumbnail_url.is_valid()) {
+ net::NetworkTrafficAnnotationTag traffic_annotation =
+ net::DefineNetworkTrafficAnnotation("thumbnail_source", R"(
+ semantics {
+ sender: "Thumbnail Source"
+ description:
+ "Retrieves thumbnails for site suggestions based on the user's "
+ "synced browsing history, for use e.g. on the New Tab page."
+ trigger:
+ "Triggered when a thumbnail for a suggestion is required (e.g. on "
+ "the New Tab page), and no local thumbnail is available."
+ data: "The URL for which to retrieve a thumbnail."
+ destination: GOOGLE_OWNED_SERVICE
+ }
+ policy {
+ cookies_allowed: false
+ setting:
+ "Users can disable this feature by signing out of Chrome, or "
+ "disabling Sync or History Sync in Chrome settings under 'Advanced "
+ "sync settings...'. The feature is enabled by default."
+ chrome_policy {
+ SyncDisabled {
+ policy_options {mode: MANDATORY}
+ SyncDisabled: true
+ }
+ }
+ chrome_policy {
+ SigninAllowed {
+ policy_options {mode: MANDATORY}
+ SigninAllowed: false
+ }
+ }
+ })");
// Otherwise, if a fallback thumbnail URL was provided, fetch it and
// eventually return it.
image_data_fetcher_.FetchImageData(
fallback_thumbnail_url,
base::Bind(&ThumbnailSource::SendFetchedUrlImage,
- weak_ptr_factory_.GetWeakPtr(), callback));
+ weak_ptr_factory_.GetWeakPtr(), callback),
+ traffic_annotation);
} else {
callback.Run(nullptr);
}
« no previous file with comments | « chrome/browser/search/suggestions/image_fetcher_impl_browsertest.cc ('k') | components/doodle/doodle_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698