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

Unified Diff: content/browser/speech/google_streaming_remote_engine.cc

Issue 778393002: Add OAuth2 authentication for some voice transcription requests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Inject clock for testing. Created 6 years 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 | « chrome/chrome_tests_unit.gypi ('k') | content/browser/speech/speech_recognition_engine.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/speech/google_streaming_remote_engine.cc
diff --git a/content/browser/speech/google_streaming_remote_engine.cc b/content/browser/speech/google_streaming_remote_engine.cc
index 7fea0fa90a60f56110be95d04a70975986225090..e52430c428cd932d5b23caa6f1a939d021e9b3bf 100644
--- a/content/browser/speech/google_streaming_remote_engine.cc
+++ b/content/browser/speech/google_streaming_remote_engine.cc
@@ -4,6 +4,7 @@
#include "content/browser/speech/google_streaming_remote_engine.h"
+#include <algorithm>
hans 2014/12/10 17:45:37 Is this used for anything?
Anand Mistry (off Chromium) 2014/12/10 22:43:21 Yes, for std::min. I added it because the linter c
#include <vector>
#include "base/bind.h"
@@ -342,7 +343,10 @@ GoogleStreamingRemoteEngine::ConnectBothStreams(const FSMEventArgs&) {
upstream_args.push_back("continuous");
if (config_.interim_results)
upstream_args.push_back("interim");
-
+ if (!config_.auth_token.empty() && !config_.auth_scope.empty()) {
+ upstream_args.push_back("authScope=" + config_.auth_scope);
+ upstream_args.push_back("authToken=" + config_.auth_token);
hans 2014/12/10 17:45:37 I assume these strings are safe to send without es
Anand Mistry (off Chromium) 2014/12/10 22:43:21 Good point. According to the OAuth2 spec, these ca
+ }
GURL upstream_url(std::string(kWebServiceBaseUrl) +
std::string(kUpstreamUrl) +
JoinString(upstream_args, '&'));
« no previous file with comments | « chrome/chrome_tests_unit.gypi ('k') | content/browser/speech/speech_recognition_engine.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698