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

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: Rebase. 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 01d3c219dcb0b8e08e9631f057571a8b120d10c8..ee84444ce29e60f42112fdc26ccea0f8dfd25de2 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>
#include <vector>
#include "base/bind.h"
@@ -342,7 +343,12 @@ 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=" + net::EscapeQueryParamValue(config_.auth_scope, true));
+ upstream_args.push_back(
+ "authToken=" + net::EscapeQueryParamValue(config_.auth_token, true));
+ }
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