| Index: third_party/WebKit/Source/web/SpeechRecognitionClientProxy.cpp
|
| diff --git a/third_party/WebKit/Source/web/SpeechRecognitionClientProxy.cpp b/third_party/WebKit/Source/web/SpeechRecognitionClientProxy.cpp
|
| deleted file mode 100644
|
| index 01fea41d6bfefd3b01d0e02331d195ea7b552aa4..0000000000000000000000000000000000000000
|
| --- a/third_party/WebKit/Source/web/SpeechRecognitionClientProxy.cpp
|
| +++ /dev/null
|
| @@ -1,170 +0,0 @@
|
| -/*
|
| - * Copyright (C) 2012 Google Inc. All rights reserved.
|
| - *
|
| - * Redistribution and use in source and binary forms, with or without
|
| - * modification, are permitted provided that the following conditions
|
| - * are met:
|
| - * * Redistributions of source code must retain the above copyright
|
| - * notice, this list of conditions and the following disclaimer.
|
| - * * Redistributions in binary form must reproduce the above copyright
|
| - * notice, this list of conditions and the following disclaimer in the
|
| - * documentation and/or other materials provided with the distribution.
|
| - *
|
| - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
|
| - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
| - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
| - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
| - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
| - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
| - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
| - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
|
| - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
| - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
| - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
| - */
|
| -
|
| -#include "web/SpeechRecognitionClientProxy.h"
|
| -
|
| -#include <memory>
|
| -#include "core/dom/ExecutionContext.h"
|
| -#include "modules/mediastream/MediaStreamTrack.h"
|
| -#include "modules/speech/SpeechGrammarList.h"
|
| -#include "modules/speech/SpeechRecognition.h"
|
| -#include "modules/speech/SpeechRecognitionError.h"
|
| -#include "modules/speech/SpeechRecognitionResult.h"
|
| -#include "modules/speech/SpeechRecognitionResultList.h"
|
| -#include "platform/RuntimeEnabledFeatures.h"
|
| -#include "platform/weborigin/SecurityOrigin.h"
|
| -#include "platform/wtf/PassRefPtr.h"
|
| -#include "platform/wtf/PtrUtil.h"
|
| -#include "public/platform/WebMediaStreamTrack.h"
|
| -#include "public/platform/WebSecurityOrigin.h"
|
| -#include "public/web/WebSpeechGrammar.h"
|
| -#include "public/web/WebSpeechRecognitionHandle.h"
|
| -#include "public/web/WebSpeechRecognitionParams.h"
|
| -#include "public/web/WebSpeechRecognitionResult.h"
|
| -#include "public/web/WebSpeechRecognizer.h"
|
| -
|
| -namespace blink {
|
| -
|
| -SpeechRecognitionClientProxy::~SpeechRecognitionClientProxy() {}
|
| -
|
| -std::unique_ptr<SpeechRecognitionClientProxy>
|
| -SpeechRecognitionClientProxy::Create(WebSpeechRecognizer* recognizer) {
|
| - return WTF::WrapUnique(new SpeechRecognitionClientProxy(recognizer));
|
| -}
|
| -
|
| -void SpeechRecognitionClientProxy::Start(SpeechRecognition* recognition,
|
| - const SpeechGrammarList* grammar_list,
|
| - const String& lang,
|
| - bool continuous,
|
| - bool interim_results,
|
| - unsigned long max_alternatives,
|
| - MediaStreamTrack* audio_track) {
|
| - size_t length =
|
| - grammar_list ? static_cast<size_t>(grammar_list->length()) : 0U;
|
| - WebVector<WebSpeechGrammar> web_speech_grammars(length);
|
| - for (unsigned long i = 0; i < length; ++i)
|
| - web_speech_grammars[i] = grammar_list->item(i);
|
| -
|
| - WebMediaStreamTrack track;
|
| - if (RuntimeEnabledFeatures::mediaStreamSpeechEnabled() && audio_track)
|
| - track.Assign(audio_track->Component());
|
| - WebSpeechRecognitionParams params(
|
| - web_speech_grammars, lang, continuous, interim_results, max_alternatives,
|
| - track,
|
| - WebSecurityOrigin(
|
| - recognition->GetExecutionContext()->GetSecurityOrigin()));
|
| - recognizer_->Start(recognition, params, this);
|
| -}
|
| -
|
| -void SpeechRecognitionClientProxy::Stop(SpeechRecognition* recognition) {
|
| - recognizer_->Stop(recognition, this);
|
| -}
|
| -
|
| -void SpeechRecognitionClientProxy::Abort(SpeechRecognition* recognition) {
|
| - recognizer_->Abort(recognition, this);
|
| -}
|
| -
|
| -void SpeechRecognitionClientProxy::DidStartAudio(
|
| - const WebSpeechRecognitionHandle& handle) {
|
| - SpeechRecognition* recognition(handle);
|
| - recognition->DidStartAudio();
|
| -}
|
| -
|
| -void SpeechRecognitionClientProxy::DidStartSound(
|
| - const WebSpeechRecognitionHandle& handle) {
|
| - SpeechRecognition* recognition(handle);
|
| - recognition->DidStartSound();
|
| - recognition->DidStartSpeech();
|
| -}
|
| -
|
| -void SpeechRecognitionClientProxy::DidEndSound(
|
| - const WebSpeechRecognitionHandle& handle) {
|
| - SpeechRecognition* recognition(handle);
|
| - recognition->DidEndSpeech();
|
| - recognition->DidEndSound();
|
| -}
|
| -
|
| -void SpeechRecognitionClientProxy::DidEndAudio(
|
| - const WebSpeechRecognitionHandle& handle) {
|
| - SpeechRecognition* recognition(handle);
|
| - recognition->DidEndAudio();
|
| -}
|
| -
|
| -void SpeechRecognitionClientProxy::DidReceiveResults(
|
| - const WebSpeechRecognitionHandle& handle,
|
| - const WebVector<WebSpeechRecognitionResult>& new_final_results,
|
| - const WebVector<WebSpeechRecognitionResult>& current_interim_results) {
|
| - SpeechRecognition* recognition(handle);
|
| -
|
| - HeapVector<Member<SpeechRecognitionResult>> final_results_vector(
|
| - new_final_results.size());
|
| - for (size_t i = 0; i < new_final_results.size(); ++i)
|
| - final_results_vector[i] =
|
| - Member<SpeechRecognitionResult>(new_final_results[i]);
|
| -
|
| - HeapVector<Member<SpeechRecognitionResult>> interim_results_vector(
|
| - current_interim_results.size());
|
| - for (size_t i = 0; i < current_interim_results.size(); ++i)
|
| - interim_results_vector[i] =
|
| - Member<SpeechRecognitionResult>(current_interim_results[i]);
|
| -
|
| - recognition->DidReceiveResults(final_results_vector, interim_results_vector);
|
| -}
|
| -
|
| -void SpeechRecognitionClientProxy::DidReceiveNoMatch(
|
| - const WebSpeechRecognitionHandle& handle,
|
| - const WebSpeechRecognitionResult& result) {
|
| - SpeechRecognition* recognition(handle);
|
| - recognition->DidReceiveNoMatch(result);
|
| -}
|
| -
|
| -void SpeechRecognitionClientProxy::DidReceiveError(
|
| - const WebSpeechRecognitionHandle& handle,
|
| - const WebString& message,
|
| - WebSpeechRecognizerClient::ErrorCode code) {
|
| - SpeechRecognition* recognition(handle);
|
| - SpeechRecognitionError::ErrorCode error_code =
|
| - static_cast<SpeechRecognitionError::ErrorCode>(code);
|
| - recognition->DidReceiveError(
|
| - SpeechRecognitionError::Create(error_code, message));
|
| -}
|
| -
|
| -void SpeechRecognitionClientProxy::DidStart(
|
| - const WebSpeechRecognitionHandle& handle) {
|
| - SpeechRecognition* recognition(handle);
|
| - recognition->DidStart();
|
| -}
|
| -
|
| -void SpeechRecognitionClientProxy::DidEnd(
|
| - const WebSpeechRecognitionHandle& handle) {
|
| - SpeechRecognition* recognition(handle);
|
| - recognition->DidEnd();
|
| -}
|
| -
|
| -SpeechRecognitionClientProxy::SpeechRecognitionClientProxy(
|
| - WebSpeechRecognizer* recognizer)
|
| - : recognizer_(recognizer) {}
|
| -
|
| -} // namespace blink
|
|
|