| 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 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 325 { | 325 { |
| 326 ASSERT(m_state != State::Inactive); | 326 ASSERT(m_state != State::Inactive); |
| 327 m_state = State::Inactive; | 327 m_state = State::Inactive; |
| 328 | 328 |
| 329 m_recorderHandler->stop(); | 329 m_recorderHandler->stop(); |
| 330 | 330 |
| 331 writeData(nullptr /* data */, 0 /* length */, true /* lastInSlice */); | 331 writeData(nullptr /* data */, 0 /* length */, true /* lastInSlice */); |
| 332 scheduleDispatchEvent(Event::create(EventTypeNames::stop)); | 332 scheduleDispatchEvent(Event::create(EventTypeNames::stop)); |
| 333 } | 333 } |
| 334 | 334 |
| 335 void MediaRecorder::scheduleDispatchEvent(PassRefPtrWillBeRawPtr<Event> event) | 335 void MediaRecorder::scheduleDispatchEvent(RawPtr<Event> event) |
| 336 { | 336 { |
| 337 m_scheduledEvents.append(event); | 337 m_scheduledEvents.append(event); |
| 338 | 338 |
| 339 m_dispatchScheduledEventRunner->runAsync(); | 339 m_dispatchScheduledEventRunner->runAsync(); |
| 340 } | 340 } |
| 341 | 341 |
| 342 void MediaRecorder::dispatchScheduledEvent() | 342 void MediaRecorder::dispatchScheduledEvent() |
| 343 { | 343 { |
| 344 WillBeHeapVector<RefPtrWillBeMember<Event>> events; | 344 HeapVector<Member<Event>> events; |
| 345 events.swap(m_scheduledEvents); | 345 events.swap(m_scheduledEvents); |
| 346 | 346 |
| 347 for (const auto& event : events) | 347 for (const auto& event : events) |
| 348 dispatchEvent(event); | 348 dispatchEvent(event); |
| 349 } | 349 } |
| 350 | 350 |
| 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 RefCountedGarbageCollectedEventTargetWithInlineData<MediaRecorder>::trace(vi
sitor); | 356 RefCountedGarbageCollectedEventTargetWithInlineData<MediaRecorder>::trace(vi
sitor); |
| 357 ActiveDOMObject::trace(visitor); | 357 ActiveDOMObject::trace(visitor); |
| 358 } | 358 } |
| 359 | 359 |
| 360 } // namespace blink | 360 } // namespace blink |
| OLD | NEW |