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

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

Issue 1034833002: Adding a serviceURI param to SpeechRecognition (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Changing the serviceuri param to be KURL rather than string so we can check whether the url is vali… Created 5 years, 8 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
« no previous file with comments | « Source/modules/speech/SpeechRecognition.h ('k') | Source/modules/speech/SpeechRecognition.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/speech/SpeechRecognition.cpp
diff --git a/Source/modules/speech/SpeechRecognition.cpp b/Source/modules/speech/SpeechRecognition.cpp
index 051e89e1f1b27d94f3993734db7abebd0ae788d9..f36b6933dc71836ac90cb1924e01585b63f3f872 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,15 @@ void SpeechRecognition::start(ExceptionState& exceptionState)
return;
}
+ KURL url(m_serviceURI);
+ // Throw an error if serviceuri is not empty and url is invalid.
+ if (!m_serviceURI.empty() && !url.isValid()) {
+ exceptionState.throwDOMException(ValidationError, "serviceuri is invalid");
+ return;
+ }
+
m_finalResults.clear();
- m_controller->start(this, m_grammars, m_lang, 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;
}
« no previous file with comments | « Source/modules/speech/SpeechRecognition.h ('k') | Source/modules/speech/SpeechRecognition.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698