Changeset 65327 in webkit
- Timestamp:
- Aug 13, 2010 9:49:30 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r65324 r65327 1 2010-08-13 Satish Sampath <satish@chromium.org> 2 3 Reviewed by Jeremy Orlow. 4 5 Support for multiple speech enabled elements in same page. 6 https://bugs.webkit.org/show_bug.cgi?id=43922 7 8 * page/SpeechInput.cpp: Generates request ids as necessary when each speech enabled input element gets 9 created/destroyed and multiplexes the listener callbacks to the appropriate input element based on the request id. 10 (WebCore::SpeechInput::SpeechInput): 11 (WebCore::SpeechInput::~SpeechInput): 12 (WebCore::SpeechInput::registerListener): 13 (WebCore::SpeechInput::unregisterListener): 14 (WebCore::SpeechInput::didCompleteRecording): 15 (WebCore::SpeechInput::didCompleteRecognition): 16 (WebCore::SpeechInput::setRecognitionResult): 17 (WebCore::SpeechInput::startRecognition): 18 (WebCore::SpeechInput::stopRecording): 19 (WebCore::SpeechInput::cancelRecognition): 20 * page/SpeechInput.h: 21 * page/SpeechInputClient.h: Now requires a one time set for the WebCore::SpeechInputListener and 22 takes in a 'requestId' for all calls. 23 * page/SpeechInputListener.h: Now returns the above mentioned requestId in all the listener callbacks for 24 identifying which input element the event goes to. 25 * platform/mock/SpeechInputClientMock.cpp: 26 (WebCore::SpeechInputClientMock::SpeechInputClientMock): 27 (WebCore::SpeechInputClientMock::setListener): 28 (WebCore::SpeechInputClientMock::startRecognition): 29 (WebCore::SpeechInputClientMock::stopRecording): 30 (WebCore::SpeechInputClientMock::cancelRecognition): 31 (WebCore::SpeechInputClientMock::timerFired): 32 * platform/mock/SpeechInputClientMock.h: 33 * rendering/TextControlInnerElements.cpp: 34 (WebCore::InputFieldSpeechButtonElement::InputFieldSpeechButtonElement): 35 (WebCore::InputFieldSpeechButtonElement::~InputFieldSpeechButtonElement): 36 (WebCore::InputFieldSpeechButtonElement::defaultEventHandler): 37 (WebCore::InputFieldSpeechButtonElement::speechInput): 38 (WebCore::InputFieldSpeechButtonElement::didCompleteRecording): 39 (WebCore::InputFieldSpeechButtonElement::didCompleteRecognition): 40 (WebCore::InputFieldSpeechButtonElement::setRecognitionResult): 41 * rendering/TextControlInnerElements.h: 42 1 43 2010-08-13 Eric Carlson <eric.carlson@apple.com> 2 44 -
trunk/WebCore/page/SpeechInput.cpp
r64111 r65327 42 42 SpeechInput::SpeechInput(SpeechInputClient* client) 43 43 : m_client(client) 44 , m_ listener(0)44 , m_nextListenerId(1) 45 45 { 46 m_client->setListener(this); 46 47 } 47 48 48 void SpeechInput::didCompleteRecording()49 SpeechInput::~SpeechInput() 49 50 { 50 ASSERT(m_listener); 51 m_listener->didCompleteRecording(); 51 m_client->setListener(0); 52 52 } 53 53 54 void SpeechInput::didCompleteRecognition()54 int SpeechInput::registerListener(SpeechInputListener* listener) 55 55 { 56 ASSERT(m_listener); 57 m_listener->didCompleteRecognition(); 58 m_listener = 0; 56 #if defined(DEBUG) 57 // Check if already present. 58 for (HashMap<int, SpeechInputListener*>::iterator it = m_listeners.begin(); it != m_listeners.end(); ++it) 59 ASSERT(it->second != listener); 60 #endif 61 62 m_listeners.add(m_nextListenerId, listener); 63 return m_nextListenerId++; 59 64 } 60 65 61 void SpeechInput:: setRecognitionResult(const String& result)66 void SpeechInput::unregisterListener(int listenerId) 62 67 { 63 ASSERT(m_listener);64 m_listener->setRecognitionResult(result);68 if (m_listeners.contains(listenerId)) 69 m_listeners.remove(listenerId); 65 70 } 66 71 67 bool SpeechInput::startRecognition(SpeechInputListener* listener)72 void SpeechInput::didCompleteRecording(int listenerId) 68 73 { 69 // Cancel any ongoing recognition first. 70 if (m_listener) { 71 m_listener->didCompleteRecognition(); 72 m_listener = 0; 73 m_client->cancelRecognition(); 74 } 75 76 m_listener = listener; 77 return m_client->startRecognition(this); 74 // Don't assert if not present as the element might have been removed by the page while 75 // this event was on the way. 76 if (m_listeners.contains(listenerId)) 77 m_listeners.get(listenerId)->didCompleteRecording(listenerId); 78 78 } 79 79 80 void SpeechInput:: stopRecording()80 void SpeechInput::didCompleteRecognition(int listenerId) 81 81 { 82 ASSERT(m_listener); 83 m_client->stopRecording(); 82 // Don't assert if not present as the element might have been removed by the page while 83 // this event was on the way. 84 if (m_listeners.contains(listenerId)) 85 m_listeners.get(listenerId)->didCompleteRecognition(listenerId); 86 } 87 88 void SpeechInput::setRecognitionResult(int listenerId, const String& result) 89 { 90 // Don't assert if not present as the element might have been removed by the page while 91 // this event was on the way. 92 if (m_listeners.contains(listenerId)) 93 m_listeners.get(listenerId)->setRecognitionResult(listenerId, result); 94 } 95 96 bool SpeechInput::startRecognition(int listenerId) 97 { 98 ASSERT(m_listeners.contains(listenerId)); 99 return m_client->startRecognition(listenerId); 100 } 101 102 void SpeechInput::stopRecording(int listenerId) 103 { 104 ASSERT(m_listeners.contains(listenerId)); 105 m_client->stopRecording(listenerId); 106 } 107 108 void SpeechInput::cancelRecognition(int listenerId) 109 { 110 ASSERT(m_listeners.contains(listenerId)); 111 m_client->cancelRecognition(listenerId); 84 112 } 85 113 -
trunk/WebCore/page/SpeechInput.h
r65021 r65327 36 36 #include "SpeechInputListener.h" 37 37 #include <wtf/Forward.h> 38 #include <wtf/HashMap.h> 38 39 #include <wtf/Noncopyable.h> 39 40 … … 49 50 public: 50 51 SpeechInput(SpeechInputClient*); 51 virtual ~SpeechInput() { } 52 virtual ~SpeechInput(); 53 54 // Generates a unique ID for the given listener to be used for speech requests. 55 // This should be the first call made by listeners before anything else. 56 int registerListener(SpeechInputListener*); 57 58 // Invoked when the listener is done with recording or getting destroyed. 59 // Failure to unregister may result in crashes if there were any pending speech events. 60 void unregisterListener(int); 52 61 53 62 // Methods invoked by the input elements. 54 bool startRecognition(SpeechInputListener* listener); 55 void stopRecording(); 63 bool startRecognition(int); 64 void stopRecording(int); 65 void cancelRecognition(int); 56 66 57 67 // SpeechInputListener methods. 58 virtual void didCompleteRecording( );59 virtual void didCompleteRecognition( );60 virtual void setRecognitionResult( const String&);68 virtual void didCompleteRecording(int); 69 virtual void didCompleteRecognition(int); 70 virtual void setRecognitionResult(int, const String&); 61 71 62 72 private: 63 73 SpeechInputClient* m_client; 64 SpeechInputListener* m_listener; 74 HashMap<int, SpeechInputListener*> m_listeners; 75 int m_nextListenerId; 65 76 }; 66 77 -
trunk/WebCore/page/SpeechInputClient.h
r64111 r65327 41 41 class SpeechInputClient { 42 42 public: 43 virtual bool startRecognition(SpeechInputListener* listener) = 0; 43 // This is the first call made by a listener, registering itself for future callbacks. 44 // When the listener no longer needs speech input (for e.g. when it gets destroyed), 45 // it should set a null listener to stop receiving callbacks. 46 // The client does not take ownership of the pointer. 47 virtual void setListener(SpeechInputListener*) = 0; 48 49 // Starts speech recognition and audio recording. 50 virtual bool startRecognition(int requestId) = 0; 44 51 45 52 // Stops audio recording and performs recognition with the audio recorded until now 46 53 // (does not discard audio). 47 virtual void stopRecording( ) = 0;54 virtual void stopRecording(int requestId) = 0; 48 55 49 56 // Cancels an ongoing recognition and discards any audio recorded so far. No partial 50 57 // recognition results are returned to the listener. 51 virtual void cancelRecognition( ) = 0;58 virtual void cancelRecognition(int requestId) = 0; 52 59 53 60 protected: -
trunk/WebCore/page/SpeechInputListener.h
r65021 r65327 42 42 public: 43 43 // Informs that audio recording has completed and recognition is underway. 44 virtual void didCompleteRecording( ) = 0;44 virtual void didCompleteRecording(int requestId) = 0; 45 45 46 46 // Informs that speech recognition has completed. This gets invoked irrespective of whether … … 48 48 // handler typically frees up any temporary resources allocated and waits for the next speech 49 49 // recognition request. 50 virtual void didCompleteRecognition( ) = 0;50 virtual void didCompleteRecognition(int requestId) = 0; 51 51 52 52 // Gives results from speech recognition, either partial or the final results. … … 54 54 // available as the user keeps speaking. If the speech could not be recognized properly 55 55 // or if there was any other errors in the process, this method may never be called. 56 virtual void setRecognitionResult( const String& result) = 0;56 virtual void setRecognitionResult(int requestId, const String& result) = 0; 57 57 58 58 protected: -
trunk/WebCore/platform/mock/SpeechInputClientMock.cpp
r64351 r65327 42 42 , m_timer(this, &SpeechInputClientMock::timerFired) 43 43 , m_listener(0) 44 , m_requestId(0) 44 45 { 45 46 } 46 47 47 bool SpeechInputClientMock::startRecognition(SpeechInputListener* listener) 48 void SpeechInputClientMock::setListener(SpeechInputListener* listener) 49 { 50 m_listener = listener; 51 } 52 53 bool SpeechInputClientMock::startRecognition(int requestId) 48 54 { 49 55 if (m_timer.isActive()) 50 56 return false; 51 m_ listener = listener;57 m_requestId = requestId; 52 58 m_recording = true; 53 59 m_timer.startOneShot(0); … … 55 61 } 56 62 57 void SpeechInputClientMock::stopRecording( )63 void SpeechInputClientMock::stopRecording(int requestId) 58 64 { 65 ASSERT(requestId == m_requestId); 59 66 if (m_timer.isActive() && m_recording) { 60 67 m_timer.stop(); … … 63 70 } 64 71 65 void SpeechInputClientMock::cancelRecognition( )72 void SpeechInputClientMock::cancelRecognition(int requestId) 66 73 { 74 ASSERT(requestId == m_requestId); 67 75 if (m_timer.isActive()) { 68 76 m_timer.stop(); 69 77 m_recording = false; 70 m_listener->didCompleteRecognition( );71 m_ listener= 0;78 m_listener->didCompleteRecognition(m_requestId); 79 m_requestId = 0; 72 80 } 73 81 } … … 82 90 if (m_recording) { 83 91 m_recording = false; 84 m_listener->didCompleteRecording( );92 m_listener->didCompleteRecording(m_requestId); 85 93 m_timer.startOneShot(0); 86 94 } else { 87 m_listener->setRecognitionResult(m_re cognitionResult);88 m_listener->didCompleteRecognition( );89 m_ listener= 0;95 m_listener->setRecognitionResult(m_requestId, m_recognitionResult); 96 m_listener->didCompleteRecognition(m_requestId); 97 m_requestId = 0; 90 98 } 91 99 } -
trunk/WebCore/platform/mock/SpeechInputClientMock.h
r64351 r65327 50 50 51 51 // SpeechInputClient methods. 52 bool startRecognition(SpeechInputListener*); 53 void stopRecording(); 54 void cancelRecognition(); 52 void setListener(SpeechInputListener*); 53 bool startRecognition(int); 54 void stopRecording(int); 55 void cancelRecognition(int); 55 56 56 57 private: … … 60 61 Timer<SpeechInputClientMock> m_timer; 61 62 SpeechInputListener* m_listener; 63 int m_requestId; 62 64 String m_recognitionResult; 63 65 }; -
trunk/WebCore/rendering/TextControlInnerElements.cpp
r65220 r65327 347 347 , m_capturing(false) 348 348 , m_state(Idle) 349 { 349 , m_listenerId(document()->page()->speechInput()->registerListener(this)) 350 { 351 } 352 353 InputFieldSpeechButtonElement::~InputFieldSpeechButtonElement() 354 { 355 SpeechInput* speech = speechInput(); 356 if (speech) { // Could be null when page is unloading. 357 if (m_state != Idle) 358 speech->cancelRecognition(m_listenerId); 359 speech->unregisterListener(m_listenerId); 360 } 350 361 } 351 362 … … 387 398 switch (m_state) { 388 399 case Idle: 389 if (speechInput()->startRecognition( this))400 if (speechInput()->startRecognition(m_listenerId)) 390 401 setState(Recording); 391 402 break; 392 403 case Recording: 393 speechInput()->stopRecording( );404 speechInput()->stopRecording(m_listenerId); 394 405 break; 395 406 case Recognizing: … … 414 425 SpeechInput* InputFieldSpeechButtonElement::speechInput() 415 426 { 416 return document()->page() ->speechInput();417 } 418 419 void InputFieldSpeechButtonElement::didCompleteRecording( )427 return document()->page() ? document()->page()->speechInput() : 0; 428 } 429 430 void InputFieldSpeechButtonElement::didCompleteRecording(int) 420 431 { 421 432 setState(Recognizing); 422 433 } 423 434 424 void InputFieldSpeechButtonElement::didCompleteRecognition( )435 void InputFieldSpeechButtonElement::didCompleteRecognition(int) 425 436 { 426 437 setState(Idle); 427 438 } 428 439 429 void InputFieldSpeechButtonElement::setRecognitionResult( const String& result)440 void InputFieldSpeechButtonElement::setRecognitionResult(int, const String& result) 430 441 { 431 442 HTMLInputElement* input = static_cast<HTMLInputElement*>(shadowAncestorNode()); -
trunk/WebCore/rendering/TextControlInnerElements.h
r65220 r65327 127 127 128 128 static PassRefPtr<InputFieldSpeechButtonElement> create(Node*); 129 virtual ~InputFieldSpeechButtonElement(); 129 130 130 131 virtual void detach(); … … 133 134 134 135 // SpeechInputListener methods. 135 void didCompleteRecording( );136 void didCompleteRecognition( );137 void setRecognitionResult( const String& result);136 void didCompleteRecording(int); 137 void didCompleteRecognition(int); 138 void setRecognitionResult(int, const String& result); 138 139 139 140 private: … … 144 145 bool m_capturing; 145 146 SpeechInputState m_state; 147 int m_listenerId; 146 148 }; 147 149 -
trunk/WebKit/chromium/ChangeLog
r65304 r65327 1 2010-08-13 Satish Sampath <satish@chromium.org> 2 3 Reviewed by Jeremy Orlow. 4 5 Support for multiple speech enabled elements in same page. 6 https://bugs.webkit.org/show_bug.cgi?id=43922 7 8 * public/WebSpeechInputController.h: Bubbles up the requestId given by webcore to the embedder. 9 (WebKit::WebSpeechInputController::startRecognition): 10 (WebKit::WebSpeechInputController::cancelRecognition): 11 (WebKit::WebSpeechInputController::stopRecording): 12 * public/WebSpeechInputListener.h: Passes down the requestId given by embedder to webcore. 13 (WebKit::WebSpeechInputListener::didCompleteRecording): 14 (WebKit::WebSpeechInputListener::setRecognitionResult): 15 (WebKit::WebSpeechInputListener::didCompleteRecognition): 16 * src/SpeechInputClientImpl.cpp: 17 (WebKit::SpeechInputClientImpl::setListener): 18 (WebKit::SpeechInputClientImpl::startRecognition): 19 (WebKit::SpeechInputClientImpl::stopRecording): 20 (WebKit::SpeechInputClientImpl::cancelRecognition): 21 (WebKit::SpeechInputClientImpl::didCompleteRecording): 22 (WebKit::SpeechInputClientImpl::didCompleteRecognition): 23 (WebKit::SpeechInputClientImpl::setRecognitionResult): 24 * src/SpeechInputClientImpl.h: 25 * src/WebSpeechInputControllerMockImpl.cpp: 26 (WebKit::WebSpeechInputControllerMockImpl::WebSpeechInputControllerMockImpl): 27 (WebKit::WebSpeechInputControllerMockImpl::~WebSpeechInputControllerMockImpl): 28 (WebKit::WebSpeechInputControllerMockImpl::didCompleteRecording): 29 (WebKit::WebSpeechInputControllerMockImpl::didCompleteRecognition): 30 (WebKit::WebSpeechInputControllerMockImpl::setRecognitionResult): 31 (WebKit::WebSpeechInputControllerMockImpl::startRecognition): 32 (WebKit::WebSpeechInputControllerMockImpl::cancelRecognition): 33 (WebKit::WebSpeechInputControllerMockImpl::stopRecording): 34 * src/WebSpeechInputControllerMockImpl.h: 35 1 36 2010-08-12 Yury Semikhatsky <yurys@chromium.org> 2 37 -
trunk/WebKit/chromium/public/WebSpeechInputController.h
r64042 r65327 42 42 // runs to the limit or stopRecording is called. Progress indications and the recognized 43 43 // text are returned via the listener interface. 44 virtual bool startRecognition(int) 45 { 46 return startRecognition(); 47 } 48 // FIXME: Remove this once chromium has picked up this change. 44 49 virtual bool startRecognition() 45 50 { 46 47 51 WEBKIT_ASSERT_NOT_REACHED(); 52 return false; 48 53 } 49 54 50 55 // Cancels an ongoing recognition and discards any audio recorded so far. No partial 51 56 // recognition results are returned to the listener. 57 virtual void cancelRecognition(int) { cancelRecognition(); } 58 // FIXME: Remove this once chromium has picked up this change. 52 59 virtual void cancelRecognition() { WEBKIT_ASSERT_NOT_REACHED(); } 53 60 … … 57 64 // recording 'endpointer' should detect silence in the input and stop recording automatically. 58 65 // Call startRecognition() to record audio and recognize speech again. 66 virtual void stopRecording(int) { stopRecording(); } 67 // FIXME: Remove this once chromium has picked up this change. 59 68 virtual void stopRecording() { WEBKIT_ASSERT_NOT_REACHED(); } 60 69 -
trunk/WebKit/chromium/public/WebSpeechInputListener.h
r64042 r65327 48 48 // Typically after this call the listener would update the UI to reflect that recognition is 49 49 // in progress. 50 virtual void didCompleteRecording() = 0; 50 virtual void didCompleteRecording(int) = 0; 51 // FIXME: Remove this once chromium has picked up this change. 52 virtual void didCompleteRecording() 53 { 54 didCompleteRecording(1); 55 } 51 56 52 57 // Gives results from speech recognition, either partial or the final results. … … 54 59 // available as the user keeps speaking. If the speech could not be recognized properly 55 60 // or if there was any other errors in the process, this method may never be called. 56 virtual void setRecognitionResult(const WebString&) = 0; 61 virtual void setRecognitionResult(int, const WebString&) = 0; 62 // FIXME: Remove this once chromium has picked up this change. 63 virtual void setRecognitionResult(const WebString& result) 64 { 65 setRecognitionResult(1, result); 66 } 57 67 58 68 // Informs that speech recognition has completed. This gets invoked irrespective of whether … … 60 70 // handler typically frees up any temporary resources allocated and waits for the next speech 61 71 // recognition request. 62 virtual void didCompleteRecognition() = 0; 72 virtual void didCompleteRecognition(int) = 0; 73 // FIXME: Remove this once chromium has picked up this change. 74 virtual void didCompleteRecognition() 75 { 76 didCompleteRecognition(1); 77 } 63 78 64 79 protected: -
trunk/WebKit/chromium/src/SpeechInputClientImpl.cpp
r64352 r65327 52 52 } 53 53 54 bool SpeechInputClientImpl::startRecognition(WebCore::SpeechInputListener* listener)54 void SpeechInputClientImpl::setListener(WebCore::SpeechInputListener* listener) 55 55 { 56 56 m_listener = listener; 57 return m_controller->startRecognition();58 57 } 59 58 60 void SpeechInputClientImpl::stopRecording()59 bool SpeechInputClientImpl::startRecognition(int requestId) 61 60 { 62 61 ASSERT(m_listener); 63 m_controller->stopRecording();62 return m_controller->startRecognition(requestId); 64 63 } 65 64 66 void SpeechInputClientImpl:: cancelRecognition()65 void SpeechInputClientImpl::stopRecording(int requestId) 67 66 { 68 67 ASSERT(m_listener); 69 m_controller-> cancelRecognition();68 m_controller->stopRecording(requestId); 70 69 } 71 70 72 void SpeechInputClientImpl:: didCompleteRecording()71 void SpeechInputClientImpl::cancelRecognition(int requestId) 73 72 { 74 73 ASSERT(m_listener); 75 m_ listener->didCompleteRecording();74 m_controller->cancelRecognition(requestId); 76 75 } 77 76 78 void SpeechInputClientImpl::didCompleteReco gnition()77 void SpeechInputClientImpl::didCompleteRecording(int requestId) 79 78 { 80 79 ASSERT(m_listener); 81 m_listener->didCompleteRecognition(); 82 m_listener = 0; 80 m_listener->didCompleteRecording(requestId); 83 81 } 84 82 85 void SpeechInputClientImpl:: setRecognitionResult(const WebString& result)83 void SpeechInputClientImpl::didCompleteRecognition(int requestId) 86 84 { 87 85 ASSERT(m_listener); 88 m_listener->setRecognitionResult(result); 86 m_listener->didCompleteRecognition(requestId); 87 } 88 89 void SpeechInputClientImpl::setRecognitionResult(int requestId, const WebString& result) 90 { 91 ASSERT(m_listener); 92 m_listener->setRecognitionResult(requestId, result); 89 93 } 90 94 -
trunk/WebKit/chromium/src/SpeechInputClientImpl.h
r64111 r65327 54 54 55 55 // SpeechInputClient methods. 56 bool startRecognition(WebCore::SpeechInputListener*); 57 void stopRecording(); 58 void cancelRecognition(); 56 void setListener(WebCore::SpeechInputListener*); 57 bool startRecognition(int); 58 void stopRecording(int); 59 void cancelRecognition(int); 59 60 60 61 // WebSpeechInputListener methods. 61 void didCompleteRecording( );62 void setRecognitionResult( const WebString&);63 void didCompleteRecognition( );62 void didCompleteRecording(int); 63 void setRecognitionResult(int, const WebString&); 64 void didCompleteRecognition(int); 64 65 65 66 private: 66 67 WebSpeechInputController* m_controller; // To call into the embedder. 67 WebCore::SpeechInputListener* m_listener; // Valid when recognition is in progress.68 WebCore::SpeechInputListener* m_listener; 68 69 }; 69 70 -
trunk/WebKit/chromium/src/WebSpeechInputControllerMockImpl.cpp
r65021 r65327 47 47 , m_listener(listener) 48 48 { 49 m_webcoreMock->setListener(this); 50 } 51 52 WebSpeechInputControllerMockImpl::~WebSpeechInputControllerMockImpl() 53 { 54 m_webcoreMock->setListener(0); 49 55 } 50 56 … … 54 60 } 55 61 56 void WebSpeechInputControllerMockImpl::didCompleteRecording( )62 void WebSpeechInputControllerMockImpl::didCompleteRecording(int requestId) 57 63 { 58 m_listener->didCompleteRecording( );64 m_listener->didCompleteRecording(requestId); 59 65 } 60 66 61 void WebSpeechInputControllerMockImpl::didCompleteRecognition( )67 void WebSpeechInputControllerMockImpl::didCompleteRecognition(int requestId) 62 68 { 63 m_listener->didCompleteRecognition( );69 m_listener->didCompleteRecognition(requestId); 64 70 } 65 71 66 void WebSpeechInputControllerMockImpl::setRecognitionResult( const WTF::String& result)72 void WebSpeechInputControllerMockImpl::setRecognitionResult(int requestId, const WTF::String& result) 67 73 { 68 m_listener->setRecognitionResult(re sult);74 m_listener->setRecognitionResult(requestId, result); 69 75 } 70 76 71 bool WebSpeechInputControllerMockImpl::startRecognition( )77 bool WebSpeechInputControllerMockImpl::startRecognition(int requestId) 72 78 { 73 return m_webcoreMock->startRecognition( this);79 return m_webcoreMock->startRecognition(requestId); 74 80 } 75 81 76 void WebSpeechInputControllerMockImpl::cancelRecognition( )82 void WebSpeechInputControllerMockImpl::cancelRecognition(int requestId) 77 83 { 78 m_webcoreMock->cancelRecognition( );84 m_webcoreMock->cancelRecognition(requestId); 79 85 } 80 86 81 void WebSpeechInputControllerMockImpl::stopRecording( )87 void WebSpeechInputControllerMockImpl::stopRecording(int requestId) 82 88 { 83 m_webcoreMock->stopRecording( );89 m_webcoreMock->stopRecording(requestId); 84 90 } 85 91 -
trunk/WebKit/chromium/src/WebSpeechInputControllerMockImpl.h
r65021 r65327 48 48 public: 49 49 WebSpeechInputControllerMockImpl(WebSpeechInputListener*); 50 virtual ~WebSpeechInputControllerMockImpl(); 50 51 51 52 // WebCore::SpeechInputListener methods. 52 void didCompleteRecording( );53 void didCompleteRecognition( );54 void setRecognitionResult( const WTF::String& result);53 void didCompleteRecording(int requestId); 54 void didCompleteRecognition(int requestId); 55 void setRecognitionResult(int requestId, const WTF::String& result); 55 56 56 57 // WebSpeechInputController methods. 57 bool startRecognition( );58 void cancelRecognition( );59 void stopRecording( );58 bool startRecognition(int requestId); 59 void cancelRecognition(int requestId); 60 void stopRecording(int requestId); 60 61 61 62 // WebSpeechInputControllerMock methods.
Note: See TracChangeset
for help on using the changeset viewer.