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

Unified Diff: components/dom_distiller/core/distiller_url_fetcher.cc

Issue 2703283004: Network traffic annotation added to distiller_url_fetcher. (Closed)
Patch Set: Minor update. 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
« no previous file with comments | « components/dom_distiller/DEPS ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/dom_distiller/core/distiller_url_fetcher.cc
diff --git a/components/dom_distiller/core/distiller_url_fetcher.cc b/components/dom_distiller/core/distiller_url_fetcher.cc
index 752c7ad77ae76b3b4f50a5448d7f18768ec4a225..412ba165a93c9c01608dc50fdfd165dfa6fc2c39 100644
--- a/components/dom_distiller/core/distiller_url_fetcher.cc
+++ b/components/dom_distiller/core/distiller_url_fetcher.cc
@@ -6,6 +6,7 @@
#include "components/data_use_measurement/core/data_use_user_data.h"
#include "net/http/http_status_code.h"
+#include "net/traffic_annotation/network_traffic_annotation.h"
#include "net/url_request/url_fetcher.h"
#include "net/url_request/url_fetcher_delegate.h"
#include "net/url_request/url_request_context_getter.h"
@@ -47,8 +48,36 @@ void DistillerURLFetcher::FetchURL(const std::string& url,
std::unique_ptr<URLFetcher> DistillerURLFetcher::CreateURLFetcher(
net::URLRequestContextGetter* context_getter,
const std::string& url) {
+ net::NetworkTrafficAnnotationTag traffic_annotation =
+ net::DefineNetworkTrafficAnnotation("dom_distiller", R"(
+ semantics {
+ sender: "DOM Distiller"
+ description:
+ "Chromium provides Mobile-friendly view on Android phones when the "
noyau (Ping after 24h) 2017/02/24 09:37:28 Please amend this comment. by either removing andr
Ramin Halavati 2017/02/24 09:50:21 Done.
+ "web page contains an article, and is not mobile-friendly. If the "
+ "user enters Mobile-friendly view, the main content would be "
+ "extracted and reflowed for better readability. DOM distiller is "
+ "the backend service for Mobile-friendly view, Reader Mode, and "
+ "Reading List."
+ trigger:
+ "User enters Mobile-friendly view, Reader Mode, or Reading List."
noyau (Ping after 24h) 2017/02/24 09:37:28 This trigger is incorrect on iOS. On this platform
Ramin Halavati 2017/02/24 09:50:22 Done.
+ data:
+ "URL of the required website resources to fetch. No user "
+ "information is sent."
+ destination: WEBSITE
+ }
+ policy {
+ cookies_allowed: true
+ cookies_store: "user"
+ setting: "Users can enable or disable Mobile-friendly view by "
+ "toggling chrome://flags#reader-mode-heuristics in Chromium on "
+ "Android."
+ policy_exception_justification:
+ "Not implemented, considered not useful as no content is being "
+ "uploaded; this request merely downloads the resources on the web."
+ })");
std::unique_ptr<net::URLFetcher> fetcher =
- URLFetcher::Create(GURL(url), URLFetcher::GET, this);
+ URLFetcher::Create(GURL(url), URLFetcher::GET, this, traffic_annotation);
data_use_measurement::DataUseUserData::AttachToFetcher(
fetcher.get(), data_use_measurement::DataUseUserData::DOM_DISTILLER);
fetcher->SetRequestContext(context_getter);
« no previous file with comments | « components/dom_distiller/DEPS ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698