Index: content/browser/speech/speech_recognition_engine.cc |
diff --git a/content/browser/speech/speech_recognition_engine.cc b/content/browser/speech/speech_recognition_engine.cc |
index efa13f470e73e6a26b8280ea2410f66c53d2ab26..8b402cc7b24a1e7c8645dc5ab3d84c27b0b092ef 100644 |
--- a/content/browser/speech/speech_recognition_engine.cc |
+++ b/content/browser/speech/speech_recognition_engine.cc |
@@ -21,6 +21,7 @@ |
#include "google_apis/google_api_keys.h" |
#include "net/base/escape.h" |
#include "net/base/load_flags.h" |
+#include "net/traffic_annotation/network_traffic_annotation.h" |
#include "net/url_request/http_user_agent_settings.h" |
#include "net/url_request/url_fetcher.h" |
#include "net/url_request/url_request_context.h" |
@@ -337,8 +338,29 @@ SpeechRecognitionEngine::ConnectBothStreams(const FSMEventArgs&) { |
std::string(kDownstreamUrl) + |
base::JoinString(downstream_args, "&")); |
- downstream_fetcher_ = URLFetcher::Create( |
- kDownstreamUrlFetcherIdForTesting, downstream_url, URLFetcher::GET, this); |
+ net::NetworkTrafficAnnotationTag downstream_traffic_annotation = |
Henrik Grunell
2017/05/09 08:27:11
Oh, I wrote the upstream text here. Please change
Ramin Halavati
2017/05/09 08:37:18
Done, I will copy it here to make it easier for ne
|
+ net::DefineNetworkTrafficAnnotation("...", R"( |
Henrik Grunell
2017/05/09 08:27:11
"speech_recognition"
Ramin Halavati
2017/05/09 08:37:18
Done.
|
+ semantics { |
+ sender: "..." |
Henrik Grunell
2017/05/09 08:27:11
"Speech Recognition"
Ramin Halavati
2017/05/09 08:37:17
Done.
|
+ description: "..." |
Henrik Grunell
2017/05/09 08:27:11
"Chromium provides translation from speech audio r
Ramin Halavati
2017/05/09 08:37:18
Done.
|
+ trigger: "..." |
Henrik Grunell
2017/05/09 08:27:11
This needs to be expanded and clarified.
Henrik Grunell
2017/05/09 08:27:11
"The user chooses to start the recognition by clic
|
+ data: "..." |
Henrik Grunell
2017/05/09 08:27:11
"Audio recorded with a microphone."
Henrik Grunell
2017/05/09 08:27:11
How much data is recorded?
|
+ destination: WEBSITE/GOOGLE_OWNED_SERVICE/OTHER |
Henrik Grunell
2017/05/09 08:27:11
GOOGLE_OWNED_SERVICE
Ramin Halavati
2017/05/09 08:37:18
Done.
|
+ } |
+ policy { |
+ cookies_allowed: false |
Henrik Grunell
2017/05/09 08:27:11
I don't know, but guess false.
Tommi?
Ramin Halavati
2017/05/09 08:37:17
They are disabled in line 365.
|
+ setting: "..." |
Henrik Grunell
2017/05/09 08:27:12
"The user must allow the browser to access the mic
Ramin Halavati
2017/05/09 08:37:17
Done.
|
+ chrome_policy { |
+ [POLICY_NAME] { |
+ policy_options {mode: MANDATORY/RECOMMENDED/UNSET} |
+ [POLICY_NAME]: ... //(value to disable it) |
+ } |
+ } |
+ policy_exception_justification: "..." |
Henrik Grunell
2017/05/09 08:27:11
No policy is implemented.
Ramin Halavati
2017/05/09 08:37:18
Done.
|
+ })"); |
+ downstream_fetcher_ = |
+ URLFetcher::Create(kDownstreamUrlFetcherIdForTesting, downstream_url, |
+ URLFetcher::GET, this, downstream_traffic_annotation); |
downstream_fetcher_->SetRequestContext(url_context_.get()); |
downstream_fetcher_->SetLoadFlags(net::LOAD_DO_NOT_SAVE_COOKIES | |
net::LOAD_DO_NOT_SEND_COOKIES | |
@@ -393,8 +415,29 @@ SpeechRecognitionEngine::ConnectBothStreams(const FSMEventArgs&) { |
std::string(kUpstreamUrl) + |
base::JoinString(upstream_args, "&")); |
- upstream_fetcher_ = URLFetcher::Create(kUpstreamUrlFetcherIdForTesting, |
- upstream_url, URLFetcher::POST, this); |
+ net::NetworkTrafficAnnotationTag upstream_traffic_annotation = |
+ net::DefineNetworkTrafficAnnotation("...", R"( |
+ semantics { |
+ sender: "..." |
+ description: "..." |
+ trigger: "..." |
+ data: "..." |
+ destination: WEBSITE/GOOGLE_OWNED_SERVICE/OTHER |
+ } |
+ policy { |
+ cookies_allowed: false |
+ setting: "..." |
+ chrome_policy { |
+ [POLICY_NAME] { |
+ policy_options {mode: MANDATORY/RECOMMENDED/UNSET} |
+ [POLICY_NAME]: ... //(value to disable it) |
+ } |
+ } |
+ policy_exception_justification: "..." |
+ })"); |
+ upstream_fetcher_ = |
+ URLFetcher::Create(kUpstreamUrlFetcherIdForTesting, upstream_url, |
+ URLFetcher::POST, this, upstream_traffic_annotation); |
if (use_framed_post_data_) |
upstream_fetcher_->SetChunkedUpload("application/octet-stream"); |
else |