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

Unified Diff: components/policy/core/common/cloud/external_policy_data_fetcher.cc

Issue 2800653002: Network traffic annotation added to common/cloud. (Closed)
Patch Set: Created 3 years, 8 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/policy/core/common/cloud/external_policy_data_fetcher.cc
diff --git a/components/policy/core/common/cloud/external_policy_data_fetcher.cc b/components/policy/core/common/cloud/external_policy_data_fetcher.cc
index 70f6e5e9ab3dfd67d5044639cebd153d718a8b9e..6e05fb23e29068f5db12d9ca4ffa6300332f9ffe 100644
--- a/components/policy/core/common/cloud/external_policy_data_fetcher.cc
+++ b/components/policy/core/common/cloud/external_policy_data_fetcher.cc
@@ -17,6 +17,7 @@
#include "components/data_use_measurement/core/data_use_user_data.h"
#include "net/base/load_flags.h"
#include "net/base/net_errors.h"
+#include "net/traffic_annotation/network_traffic_annotation.h"
#include "net/url_request/url_fetcher.h"
#include "net/url_request/url_request_context_getter.h"
#include "net/url_request/url_request_status.h"
@@ -177,8 +178,30 @@ ExternalPolicyDataFetcherBackend::CreateFrontend(
void ExternalPolicyDataFetcherBackend::StartJob(
ExternalPolicyDataFetcher::Job* job) {
DCHECK(io_task_runner_->RunsTasksOnCurrentThread());
- std::unique_ptr<net::URLFetcher> owned_fetcher = net::URLFetcher::Create(
- ++last_fetch_id_, job->url, net::URLFetcher::GET, this);
+ net::NetworkTrafficAnnotationTag traffic_annotation =
+ net::DefineNetworkTrafficAnnotation("...", R"(
+ semantics {
+ sender: "..."
pastarmovj 2017/04/07 09:58:46 Cloud Policy
Ramin Halavati 2017/04/19 05:21:57 Done.
+ description: "..."
Andrew T Wilson (Slow) 2017/04/18 12:01:31 Used to fetch policy for extensions, policy-contro
Ramin Halavati 2017/04/19 05:21:58 Done.
+ trigger: "..."
Andrew T Wilson (Slow) 2017/04/18 12:01:31 Periodically loaded when a managed user is signed
Ramin Halavati 2017/04/19 05:21:58 Done.
+ data: "..."
Andrew T Wilson (Slow) 2017/04/18 12:01:31 Various data, supplied by the admin for the manage
Ramin Halavati 2017/04/19 05:21:57 Please elaborate.
Andrew T Wilson (Slow) 2017/04/25 13:48:01 This is used to fetch policy for extensions, which
Ramin Halavati 2017/04/26 05:28:06 Again, please confirm this is what this request se
Andrew T Wilson (Slow) 2017/04/26 09:34:11 This request sends no additional data - it is used
Ramin Halavati 2017/04/26 09:44:41 Done.
+ destination: WEBSITE/GOOGLE_OWNED_SERVICE/OTHER
pastarmovj 2017/04/07 09:58:46 GOOGLE_OWNED_SERVICE
Ramin Halavati 2017/04/19 05:21:58 Done.
+ }
+ policy {
+ cookies_allowed: false/true
pastarmovj 2017/04/07 09:58:46 true?
Andrew T Wilson (Slow) 2017/04/18 12:01:31 true
Ramin Halavati 2017/04/19 05:21:58 Load flags disabled SAVE and SEND. Are they just l
Andrew T Wilson (Slow) 2017/04/25 13:48:01 I don't think we use them here so feel free to mar
Ramin Halavati 2017/04/26 05:28:06 Done.
+ cookies_store: "..."
pastarmovj 2017/04/07 09:58:46 system?
Andrew T Wilson (Slow) 2017/04/18 12:01:31 system
Ramin Halavati 2017/04/19 05:21:58 Acknowledged.
+ setting: "..."
Andrew T Wilson (Slow) 2017/04/18 12:01:31 none
Ramin Halavati 2017/04/19 05:21:58 Done.
+ chrome_policy {
pastarmovj 2017/04/07 09:58:46 empty?
Andrew T Wilson (Slow) 2017/04/18 12:01:31 empty
Ramin Halavati 2017/04/19 05:21:57 Done.
+ [POLICY_NAME] {
+ policy_options {mode: MANDATORY/RECOMMENDED/UNSET}
+ [POLICY_NAME]: ... //(value to disable it)
+ }
+ }
+ policy_exception_justification: "..."
pastarmovj 2017/04/07 09:58:46 This request is part of the policy fetcher itself.
Ramin Halavati 2017/04/19 05:21:57 Done.
+ })");
+ std::unique_ptr<net::URLFetcher> owned_fetcher =
+ net::URLFetcher::Create(++last_fetch_id_, job->url, net::URLFetcher::GET,
+ this, traffic_annotation);
net::URLFetcher* fetcher = owned_fetcher.get();
data_use_measurement::DataUseUserData::AttachToFetcher(
fetcher, data_use_measurement::DataUseUserData::POLICY);

Powered by Google App Engine
This is Rietveld 408576698