| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "modules/mediarecorder/MediaRecorder.h" | 5 #include "modules/mediarecorder/MediaRecorder.h" |
| 6 | 6 |
| 7 #include "bindings/core/v8/Dictionary.h" | 7 #include "bindings/core/v8/Dictionary.h" |
| 8 #include "core/events/Event.h" | 8 #include "core/events/Event.h" |
| 9 #include "core/fileapi/Blob.h" | 9 #include "core/fileapi/Blob.h" |
| 10 #include "core/inspector/ConsoleMessage.h" | 10 #include "core/inspector/ConsoleMessage.h" |
| (...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 267 if (m_state == State::Recording) | 267 if (m_state == State::Recording) |
| 268 return; | 268 return; |
| 269 | 269 |
| 270 m_state = State::Recording; | 270 m_state = State::Recording; |
| 271 | 271 |
| 272 m_recorderHandler->resume(); | 272 m_recorderHandler->resume(); |
| 273 scheduleDispatchEvent(Event::create(EventTypeNames::resume)); | 273 scheduleDispatchEvent(Event::create(EventTypeNames::resume)); |
| 274 } | 274 } |
| 275 | 275 |
| 276 void MediaRecorder::requestData(ExceptionState& exceptionState) { | 276 void MediaRecorder::requestData(ExceptionState& exceptionState) { |
| 277 if (m_state != State::Recording) { | 277 if (m_state == State::Inactive) { |
| 278 exceptionState.throwDOMException( | 278 exceptionState.throwDOMException( |
| 279 InvalidStateError, | 279 InvalidStateError, |
| 280 "The MediaRecorder's state is '" + stateToString(m_state) + "'."); | 280 "The MediaRecorder's state is '" + stateToString(m_state) + "'."); |
| 281 return; | 281 return; |
| 282 } | 282 } |
| 283 writeData(nullptr /* data */, 0 /* length */, true /* lastInSlice */); | 283 writeData(nullptr /* data */, 0 /* length */, true /* lastInSlice */); |
| 284 } | 284 } |
| 285 | 285 |
| 286 bool MediaRecorder::isTypeSupported(const String& type) { | 286 bool MediaRecorder::isTypeSupported(const String& type) { |
| 287 WebMediaRecorderHandler* handler = | 287 WebMediaRecorderHandler* handler = |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 393 | 393 |
| 394 DEFINE_TRACE(MediaRecorder) { | 394 DEFINE_TRACE(MediaRecorder) { |
| 395 visitor->trace(m_stream); | 395 visitor->trace(m_stream); |
| 396 visitor->trace(m_dispatchScheduledEventRunner); | 396 visitor->trace(m_dispatchScheduledEventRunner); |
| 397 visitor->trace(m_scheduledEvents); | 397 visitor->trace(m_scheduledEvents); |
| 398 EventTargetWithInlineData::trace(visitor); | 398 EventTargetWithInlineData::trace(visitor); |
| 399 SuspendableObject::trace(visitor); | 399 SuspendableObject::trace(visitor); |
| 400 } | 400 } |
| 401 | 401 |
| 402 } // namespace blink | 402 } // namespace blink |
| OLD | NEW |