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

Unified Diff: Source/modules/speech/SpeechRecognition.cpp

Issue 1117383002: Changing serviceuri param to be url from string in Blink and tagging requests to speech recognizer Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Modifying tests to add better examples and removing the unnecessary comment Created 5 years, 7 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
Index: Source/modules/speech/SpeechRecognition.cpp
diff --git a/Source/modules/speech/SpeechRecognition.cpp b/Source/modules/speech/SpeechRecognition.cpp
index 9309fe571c22f61a05c5ec9b5e46297064540470..c8252601054ff4477eaa633dff7b89b283a7aede 100644
--- a/Source/modules/speech/SpeechRecognition.cpp
+++ b/Source/modules/speech/SpeechRecognition.cpp
@@ -35,6 +35,7 @@
#include "modules/speech/SpeechRecognitionController.h"
#include "modules/speech/SpeechRecognitionError.h"
#include "modules/speech/SpeechRecognitionEvent.h"
+#include "platform/weborigin/KURL.h"
namespace blink {
@@ -58,8 +59,14 @@ void SpeechRecognition::start(ExceptionState& exceptionState)
return;
}
+ KURL url(ParsedURLString, m_serviceURI);
+ if (!m_serviceURI.isEmpty() && !url.isValid()) {
+ exceptionState.throwDOMException(SyntaxError, "serviceURI is neither empty nor a valid URL.");
+ return;
+ }
+
m_finalResults.clear();
- m_controller->start(this, m_grammars, m_lang, m_serviceURI, m_continuous, m_interimResults, m_maxAlternatives, m_audioTrack);
+ m_controller->start(this, m_grammars, m_lang, url, m_continuous, m_interimResults, m_maxAlternatives, m_audioTrack);
m_started = true;
}

Powered by Google App Engine
This is Rietveld 408576698