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..b1fcf7a9e04494f853456e121c8cc8194a2028c0 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,32 @@ 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 = |
+ net::DefineNetworkTrafficAnnotation("speech_recognition_downstream", R"( |
+ semantics { |
+ sender: "Speech Recognition" |
+ description: |
+ "Chrome provides translation from speech audio recorded with a " |
+ "microphone to text, by using the Google speech recognition web " |
+ "service. Audio is sent to Google's servers and text is returned." |
+ trigger: |
+ "The user chooses to start the recognition by clicking the " |
+ "microphone icon in the Google search field." |
+ data: "Audio recorded with the microphone." |
Henrik Grunell
2017/05/09 09:03:30
This only gets text data, afaik it only sends a re
Ramin Halavati
2017/05/09 09:24:18
You mean this request just sends the id to initial
Henrik Grunell
2017/05/11 07:14:08
A unique id is generated for a speech recognition
Ramin Halavati
2017/05/11 07:21:09
Done.
|
+ destination: GOOGLE_OWNED_SERVICE |
+ } |
+ policy { |
+ cookies_allowed: false |
+ setting: |
+ "The user must allow the browser to access the microphone in a " |
+ "popup notification. This is set per site (hostname pattern). In " |
+ "the content settings, microphone access can be turned off for all " |
+ "sites and site specific settings can be changed." |
+ policy_exception_justification: "Not implemented." |
+ })"); |
+ 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 +418,32 @@ 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("speech_recognition_upstream", R"( |
+ semantics { |
+ sender: "Speech Recognition" |
+ description: |
+ "Chrome provides translation from speech audio recorded with a " |
+ "microphone to text, by using the Google speech recognition web " |
+ "service. Audio is sent to Google's servers and text is returned." |
Henrik Grunell
2017/05/09 09:03:30
Change to "Audio is sent to Google's servers (upst
Ramin Halavati
2017/05/09 09:24:18
We are working on a next version of annotation fun
Henrik Grunell
2017/05/11 07:14:08
Acknowledged.
|
+ trigger: |
+ "The user chooses to start the recognition by clicking the " |
+ "microphone icon in the Google search field." |
+ data: "Audio recorded with the microphone." |
+ destination: GOOGLE_OWNED_SERVICE |
+ } |
+ policy { |
+ cookies_allowed: false |
+ setting: |
+ "The user must allow the browser to access the microphone in a " |
+ "popup notification. This is set per site (hostname pattern). In " |
+ "the content settings, microphone access can be turned off for all " |
+ "sites and site specific settings can be changed." |
+ policy_exception_justification: "Not implemented." |
+ })"); |
+ 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 |