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 29 matching lines...) Expand all Loading... |
40 { | 40 { |
41 RefPtr<SpeechRecognition> speechRecognition(adoptRef(new SpeechRecognition(c
ontext))); | 41 RefPtr<SpeechRecognition> speechRecognition(adoptRef(new SpeechRecognition(c
ontext))); |
42 speechRecognition->suspendIfNeeded(); | 42 speechRecognition->suspendIfNeeded(); |
43 return speechRecognition.release(); | 43 return speechRecognition.release(); |
44 } | 44 } |
45 | 45 |
46 void SpeechRecognition::start(ExceptionCode& ec) | 46 void SpeechRecognition::start(ExceptionCode& ec) |
47 { | 47 { |
48 ASSERT(m_controller); | 48 ASSERT(m_controller); |
49 if (m_started) { | 49 if (m_started) { |
50 ec = INVALID_STATE_ERR; | 50 ec = InvalidStateError; |
51 return; | 51 return; |
52 } | 52 } |
53 | 53 |
54 setPendingActivity(this); | 54 setPendingActivity(this); |
55 m_finalResults.clear(); | 55 m_finalResults.clear(); |
56 m_controller->start(this, m_grammars.get(), m_lang, m_continuous, m_interimR
esults, m_maxAlternatives); | 56 m_controller->start(this, m_grammars.get(), m_lang, m_continuous, m_interimR
esults, m_maxAlternatives); |
57 m_started = true; | 57 m_started = true; |
58 } | 58 } |
59 | 59 |
60 void SpeechRecognition::stopFunction() | 60 void SpeechRecognition::stopFunction() |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 ASSERT(m_controller); | 182 ASSERT(m_controller); |
183 | 183 |
184 // FIXME: Need to hook up with Page to get notified when the visibility chan
ges. | 184 // FIXME: Need to hook up with Page to get notified when the visibility chan
ges. |
185 } | 185 } |
186 | 186 |
187 SpeechRecognition::~SpeechRecognition() | 187 SpeechRecognition::~SpeechRecognition() |
188 { | 188 { |
189 } | 189 } |
190 | 190 |
191 } // namespace WebCore | 191 } // namespace WebCore |
OLD | NEW |