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

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: Adding layout tests and forward declaring KURL 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..2cde2e584b66a005ce987310674ae2eb6f0fe783 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(ParsedURLString, m_serviceURI);
+ // Throw an error if serviceuri is not empty and url is invalid.
jochen (gone - plz use gerrit) 2015/05/06 13:03:58 nit. that comment doesn't add value, just omit it
kirtia 2015/05/06 14:57:13 Done.
+ if (!m_serviceURI.isEmpty() && !url.isValid()) {
+ exceptionState.throwDOMException(SyntaxError, "serviceURI is neither empty nor a valid URL.");
jochen (gone - plz use gerrit) 2015/05/06 13:03:58 i just double-checked the spec, and it doesn't def
kirtia 2015/06/02 20:56:57 Ack. It has been decided that we ignore malformed
+ 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;
}
« no previous file with comments | « LayoutTests/fast/speech/scripted/start-exception-expected.txt ('k') | Source/modules/speech/SpeechRecognitionClient.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698