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

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

Issue 2703283004: Network traffic annotation added to distiller_url_fetcher. (Closed)
Patch Set: 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..b84af62c6f072a016ff58ef259a58e9f4516f206 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,29 @@ 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("...", R"(
wychen 2017/02/23 21:31:24 Nit: raw strings should not be indented with the r
wychen 2017/02/23 21:31:25 unique id: "dom_distiller"
Ramin Halavati 2017/02/24 09:03:49 Annotation raw strings are optimized out of binary
+ semantics {
+ sender: "..."
wychen 2017/02/23 21:31:24 sender: "DOM Distiller"
Ramin Halavati 2017/02/24 09:03:49 Done.
+ description: "..."
wychen 2017/02/23 21:31:24 description: "Google Chrome provides Mobile-friend
Ramin Halavati 2017/02/24 09:03:49 Done.
+ trigger: "..."
wychen 2017/02/23 21:31:24 trigger: "User enters Mobile-friendly view, Reader
Ramin Halavati 2017/02/24 09:03:48 Done.
+ data: "..."
wychen 2017/02/23 21:31:24 data: "URL of the required website resources to fe
Ramin Halavati 2017/02/24 09:03:49 Done.
+ destination: WEBSITE/GOOGLE_OWNED_SERVICE/OTHER
wychen 2017/02/23 21:31:25 destination: WEBSITE
Ramin Halavati 2017/02/24 09:03:49 Done.
+ }
+ policy {
+ cookies_allowed: false/true
wychen 2017/02/23 21:31:25 cookies_allowed: true
Ramin Halavati 2017/02/24 09:03:49 Done.
+ cookies_store: "..."
wychen 2017/02/23 21:31:24 cookies_store: "user"
Ramin Halavati 2017/02/24 09:03:48 Done.
+ setting: "..."
wychen 2017/02/23 21:31:24 setting: "You can enable or disable Mobile-friendl
Olivier 2017/02/24 08:36:16 Reader mode is not publicly shipped on iOS. Only p
Ramin Halavati 2017/02/24 09:03:49 Please advise on the settings comment for Reading
wychen 2017/02/24 18:22:10 Then I guess we don't mention Reader Mode on iOS a
+ policy {
wychen 2017/02/23 21:31:24 No policies.
Ramin Halavati 2017/02/24 09:03:49 Done.
+ [POLICY_NAME] {
+ policy_options {mode: MANDATORY/RECOMMENDED/UNSET}
+ value: ...
+ }
+ }
+ policy_exception_justification: "..."
wychen 2017/02/23 21:31:25 policy_exception_justification: "Not implemented,
Ramin Halavati 2017/02/24 09:03:48 Done.
+ })");
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