| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * * Redistributions of source code must retain the above copyright | 7 * * Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * * Redistributions in binary form must reproduce the above copyright | 9 * * Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 SpeechRecognition* SpeechRecognition::create(ExecutionContext* context) | 41 SpeechRecognition* SpeechRecognition::create(ExecutionContext* context) |
| 42 { | 42 { |
| 43 ASSERT(context && context->isDocument()); | 43 ASSERT(context && context->isDocument()); |
| 44 Document* document = toDocument(context); | 44 Document* document = toDocument(context); |
| 45 ASSERT(document); | 45 ASSERT(document); |
| 46 SpeechRecognition* speechRecognition = new SpeechRecognition(document->page(
), context); | 46 SpeechRecognition* speechRecognition = new SpeechRecognition(document->page(
), context); |
| 47 speechRecognition->suspendIfNeeded(); | 47 speechRecognition->suspendIfNeeded(); |
| 48 return speechRecognition; | 48 return speechRecognition; |
| 49 } | 49 } |
| 50 | 50 |
| 51 MediaStreamTrack* SpeechRecognition::audioTrack() const | |
| 52 { | |
| 53 return m_audioTrack; | |
| 54 } | |
| 55 | |
| 56 void SpeechRecognition::setAudioTrack(MediaStreamTrack* audioTrack) | |
| 57 { | |
| 58 m_audioTrack = audioTrack; | |
| 59 } | |
| 60 | |
| 61 void SpeechRecognition::start(ExceptionState& exceptionState) | 51 void SpeechRecognition::start(ExceptionState& exceptionState) |
| 62 { | 52 { |
| 63 if (!m_controller) | 53 if (!m_controller) |
| 64 return; | 54 return; |
| 65 | 55 |
| 66 if (m_started) { | 56 if (m_started) { |
| 67 exceptionState.throwDOMException(InvalidStateError, "recognition has alr
eady started."); | 57 exceptionState.throwDOMException(InvalidStateError, "recognition has alr
eady started."); |
| 68 return; | 58 return; |
| 69 } | 59 } |
| 70 | 60 |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 216 visitor->trace(m_grammars); | 206 visitor->trace(m_grammars); |
| 217 visitor->trace(m_audioTrack); | 207 visitor->trace(m_audioTrack); |
| 218 visitor->trace(m_controller); | 208 visitor->trace(m_controller); |
| 219 visitor->trace(m_finalResults); | 209 visitor->trace(m_finalResults); |
| 220 RefCountedGarbageCollectedEventTargetWithInlineData<SpeechRecognition>::trac
e(visitor); | 210 RefCountedGarbageCollectedEventTargetWithInlineData<SpeechRecognition>::trac
e(visitor); |
| 221 PageLifecycleObserver::trace(visitor); | 211 PageLifecycleObserver::trace(visitor); |
| 222 ActiveDOMObject::trace(visitor); | 212 ActiveDOMObject::trace(visitor); |
| 223 } | 213 } |
| 224 | 214 |
| 225 } // namespace blink | 215 } // namespace blink |
| OLD | NEW |