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

Unified Diff: tools/traffic_annotation/sample_traffic_annotation.cc

Issue 2421333002: Protobuf for Traffic Annotation and first use by a URLFetcher. (Closed)
Patch Set: More comments 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
« no previous file with comments | « tools/traffic_annotation/OWNERS ('k') | tools/traffic_annotation/traffic_annotation.proto » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/traffic_annotation/sample_traffic_annotation.cc
diff --git a/tools/traffic_annotation/sample_traffic_annotation.cc b/tools/traffic_annotation/sample_traffic_annotation.cc
new file mode 100644
index 0000000000000000000000000000000000000000..552f301cfa6b5a148c446f6e80e373b9501d4f6f
--- /dev/null
+++ b/tools/traffic_annotation/sample_traffic_annotation.cc
@@ -0,0 +1,69 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "net/traffic_annotation/network_traffic_annotation.h"
+
+// This file includes a sample and a template for text-coded traffic_annotation.
+// For more description on each field, please refer to:
+// (tools/traffic_annotation/traffic_annotation.proto)
+// For more information on policies, please refer to:
+// http://dev.chromium.org/administrators/policy-list-3
+
+void network_traffic_annotation_sample() {
+ net::NetworkTrafficAnnotationTag traffic_annotation =
+ net::DefineNetworkTrafficAnnotation("spellcheck_lookup", R"(
+ semantics {
+ sender: "spellcheck"
+ description:
+ "Google Chrome can provide smarter spell-checking by sending "
+ "text you type into the browser to Google's servers, allowing "
+ "you to use the same spell-checking technology used by Google "
+ "products, such as Docs. If the feature is enabled, Chrome will "
+ "send the entire contents of text fields as you type in them to "
+ "Google along with the browser’s default language. Google "
+ "returns a list of suggested spellings, which will be displayed "
+ "in the context menu."
+ trigger: "User types text into a text field or asks to correct a "
+ "misspelled word."
+ data: "Text a user has typed into a text field. No user identifier "
+ "is sent along with the text."
+ destination: GOOGLE_OWNED_SERVICE
+ }
+ policy {
+ cookies_allowed: false
+ setting:
+ "You can enable or disable this feature via 'Use a web service to "
+ "help resolve spelling errors.' in Chrome's settings under "
+ "Advanced. The feature is disabled by default."
+ policy {
+ SpellCheckServiceEnabled {
+ policy_options {mode: MANDATORY}
+ value: false
+ }
+ }
+ })");
+}
+
+void network_traffic_annotation_template() {
+ 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: ...
+ }
+ }
+ })");
+}
« no previous file with comments | « tools/traffic_annotation/OWNERS ('k') | tools/traffic_annotation/traffic_annotation.proto » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698