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