| 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 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 273 m_dispatchScheduledEventRunner->resume(); | 273 m_dispatchScheduledEventRunner->resume(); |
| 274 } | 274 } |
| 275 | 275 |
| 276 void MediaRecorder::stop() | 276 void MediaRecorder::stop() |
| 277 { | 277 { |
| 278 if (m_stopped) | 278 if (m_stopped) |
| 279 return; | 279 return; |
| 280 | 280 |
| 281 m_stopped = true; | 281 m_stopped = true; |
| 282 m_stream.clear(); | 282 m_stream.clear(); |
| 283 m_recorderHandler.clear(); | 283 m_recorderHandler.reset(); |
| 284 } | 284 } |
| 285 | 285 |
| 286 void MediaRecorder::writeData(const char* data, size_t length, bool lastInSlice) | 286 void MediaRecorder::writeData(const char* data, size_t length, bool lastInSlice) |
| 287 { | 287 { |
| 288 if (m_stopped && !lastInSlice) { | 288 if (m_stopped && !lastInSlice) { |
| 289 m_stopped = false; | 289 m_stopped = false; |
| 290 scheduleDispatchEvent(Event::create(EventTypeNames::start)); | 290 scheduleDispatchEvent(Event::create(EventTypeNames::start)); |
| 291 } | 291 } |
| 292 if (m_stream && m_streamAmountOfTracks != m_stream->getTracks().size()) { | 292 if (m_stream && m_streamAmountOfTracks != m_stream->getTracks().size()) { |
| 293 m_streamAmountOfTracks = m_stream->getTracks().size(); | 293 m_streamAmountOfTracks = m_stream->getTracks().size(); |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 351 DEFINE_TRACE(MediaRecorder) | 351 DEFINE_TRACE(MediaRecorder) |
| 352 { | 352 { |
| 353 visitor->trace(m_stream); | 353 visitor->trace(m_stream); |
| 354 visitor->trace(m_dispatchScheduledEventRunner); | 354 visitor->trace(m_dispatchScheduledEventRunner); |
| 355 visitor->trace(m_scheduledEvents); | 355 visitor->trace(m_scheduledEvents); |
| 356 EventTargetWithInlineData::trace(visitor); | 356 EventTargetWithInlineData::trace(visitor); |
| 357 ActiveDOMObject::trace(visitor); | 357 ActiveDOMObject::trace(visitor); |
| 358 } | 358 } |
| 359 | 359 |
| 360 } // namespace blink | 360 } // namespace blink |
| OLD | NEW |