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

Unified Diff: chrome/browser/ui/omnibox/chrome_omnibox_client.cc

Issue 2682263002: Network traffic annotation added to chrome::BitmapFetcher. (Closed)
Patch Set: Unittests added. Created 3 years, 10 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/ui/omnibox/chrome_omnibox_client.cc
diff --git a/chrome/browser/ui/omnibox/chrome_omnibox_client.cc b/chrome/browser/ui/omnibox/chrome_omnibox_client.cc
index 3e12199b9ce6e01a39cd809637a45215c28636ef..f9e22ed7d033385d55709dff911bc3f9411dadd4 100644
--- a/chrome/browser/ui/omnibox/chrome_omnibox_client.cc
+++ b/chrome/browser/ui/omnibox/chrome_omnibox_client.cc
@@ -48,6 +48,7 @@
#include "content/public/browser/navigation_entry.h"
#include "content/public/browser/web_contents.h"
#include "extensions/common/constants.h"
+#include "net/traffic_annotation/network_traffic_annotation.h"
#include "third_party/skia/include/core/SkBitmap.h"
#include "ui/base/window_open_disposition.h"
#include "url/gurl.h"
@@ -289,11 +290,32 @@ void ChromeOmniboxClient::OnResultChanged(
BitmapFetcherServiceFactory::GetForBrowserContext(profile_);
if (image_service) {
image_service->CancelRequest(request_id_);
+ net::NetworkTrafficAnnotationTag traffic_annotation =
+ net::DefineNetworkTrafficAnnotation("", R"(
+ semantics {
+ sender: ""
+ description: ""
+ trigger: ""
+ data: ""
+ destination: WEBSITE/GOOGLE_OWNED_SERVICE/OTHER
+ }
+ policy {
+ cookies_allowed: false/true
+ cookies_store: ""
+ setting: ""
+ policy {
+ [POLICY_NAME] {
+ policy_options {mode: MANDATORY/RECOMMENDED/UNSET}
+ value: ...
+ }
+ }
+ })");
request_id_ = image_service->RequestImage(
match->answer->second_line().image_url(),
new AnswerImageObserver(
base::Bind(&ChromeOmniboxClient::OnBitmapFetched,
- base::Unretained(this), on_bitmap_fetched)));
+ base::Unretained(this), on_bitmap_fetched)),
+ traffic_annotation);
}
}
}

Powered by Google App Engine
This is Rietveld 408576698