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"
9 #include "base/logging.h"
14 SimpleEventSubscriber::SimpleEventSubscriber() {}
16 SimpleEventSubscriber::~SimpleEventSubscriber() {
17 DCHECK(thread_checker_
.CalledOnValidThread());
20 void SimpleEventSubscriber::OnReceiveFrameEvent(const FrameEvent
& frame_event
) {
21 DCHECK(thread_checker_
.CalledOnValidThread());
22 frame_events_
.push_back(frame_event
);
25 void SimpleEventSubscriber::OnReceivePacketEvent(
26 const PacketEvent
& packet_event
) {
27 DCHECK(thread_checker_
.CalledOnValidThread());
28 packet_events_
.push_back(packet_event
);
31 void SimpleEventSubscriber::GetFrameEventsAndReset(
32 std::vector
<FrameEvent
>* frame_events
) {
33 DCHECK(thread_checker_
.CalledOnValidThread());
34 frame_events
->swap(frame_events_
);
35 frame_events_
.clear();
38 void SimpleEventSubscriber::GetPacketEventsAndReset(
39 std::vector
<PacketEvent
>* packet_events
) {
40 DCHECK(thread_checker_
.CalledOnValidThread());
41 packet_events
->swap(packet_events_
);
42 packet_events_
.clear();