Remove INJECT_EVENTS permissions from test APKs.
[chromium-blink-merge.git] / media / cast / logging / simple_event_subscriber.cc
blobcad9956a6e0cac5cd1fba2f5361c822ff40d63f3
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"
10 namespace media {
11 namespace cast {
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();
44 } // namespace cast
45 } // namespace media