Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(33)

Side by Side Diff: third_party/WebKit/Source/modules/mediarecorder/MediaRecorder.cpp

Issue 2614663008: Migrate WTF::Vector::append() to ::push_back() [part 13 of N] (Closed)
Patch Set: Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 359 matching lines...) Expand 10 before | Expand all | Expand 10 after
370 DCHECK(m_state != State::Inactive); 370 DCHECK(m_state != State::Inactive);
371 m_state = State::Inactive; 371 m_state = State::Inactive;
372 372
373 m_recorderHandler->stop(); 373 m_recorderHandler->stop();
374 374
375 writeData(nullptr /* data */, 0 /* length */, true /* lastInSlice */); 375 writeData(nullptr /* data */, 0 /* length */, true /* lastInSlice */);
376 scheduleDispatchEvent(Event::create(EventTypeNames::stop)); 376 scheduleDispatchEvent(Event::create(EventTypeNames::stop));
377 } 377 }
378 378
379 void MediaRecorder::scheduleDispatchEvent(Event* event) { 379 void MediaRecorder::scheduleDispatchEvent(Event* event) {
380 m_scheduledEvents.append(event); 380 m_scheduledEvents.push_back(event);
381 381
382 m_dispatchScheduledEventRunner->runAsync(); 382 m_dispatchScheduledEventRunner->runAsync();
383 } 383 }
384 384
385 void MediaRecorder::dispatchScheduledEvent() { 385 void MediaRecorder::dispatchScheduledEvent() {
386 HeapVector<Member<Event>> events; 386 HeapVector<Member<Event>> events;
387 events.swap(m_scheduledEvents); 387 events.swap(m_scheduledEvents);
388 388
389 for (const auto& event : events) 389 for (const auto& event : events)
390 dispatchEvent(event); 390 dispatchEvent(event);
391 } 391 }
392 392
393 DEFINE_TRACE(MediaRecorder) { 393 DEFINE_TRACE(MediaRecorder) {
394 visitor->trace(m_stream); 394 visitor->trace(m_stream);
395 visitor->trace(m_dispatchScheduledEventRunner); 395 visitor->trace(m_dispatchScheduledEventRunner);
396 visitor->trace(m_scheduledEvents); 396 visitor->trace(m_scheduledEvents);
397 EventTargetWithInlineData::trace(visitor); 397 EventTargetWithInlineData::trace(visitor);
398 SuspendableObject::trace(visitor); 398 SuspendableObject::trace(visitor);
399 } 399 }
400 400
401 } // namespace blink 401 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698