1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "media/cast/logging/simple_event_subscriber.h"
8 #include "base/logging.h"
13 SimpleEventSubscriber::SimpleEventSubscriber() {}
15 SimpleEventSubscriber::~SimpleEventSubscriber() {
16 DCHECK(thread_checker_
.CalledOnValidThread());
19 void SimpleEventSubscriber::OnReceiveFrameEvent(const FrameEvent
& frame_event
) {
20 DCHECK(thread_checker_
.CalledOnValidThread());
21 frame_events_
.push_back(frame_event
);
24 void SimpleEventSubscriber::OnReceivePacketEvent(
25 const PacketEvent
& packet_event
) {
26 DCHECK(thread_checker_
.CalledOnValidThread());
27 packet_events_
.push_back(packet_event
);
30 void SimpleEventSubscriber::GetFrameEventsAndReset(
31 std::vector
<FrameEvent
>* frame_events
) {
32 DCHECK(thread_checker_
.CalledOnValidThread());
33 frame_events
->swap(frame_events_
);
34 frame_events_
.clear();
37 void SimpleEventSubscriber::GetPacketEventsAndReset(
38 std::vector
<PacketEvent
>* packet_events
) {
39 DCHECK(thread_checker_
.CalledOnValidThread());
40 packet_events
->swap(packet_events_
);
41 packet_events_
.clear();