Remove Unused AsTextButtonBorder RTTI helper.
[chromium-blink-merge.git] / media / cast / logging / simple_event_subscriber.h
blob3cf890ae975c1f8159fa9e0c2dfd58764937a017
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 #ifndef MEDIA_CAST_LOGGING_SIMPLE_EVENT_SUBSCRIBER_H_
6 #define MEDIA_CAST_LOGGING_SIMPLE_EVENT_SUBSCRIBER_H_
8 #include <vector>
10 #include "base/threading/thread_checker.h"
11 #include "media/cast/logging/raw_event_subscriber.h"
13 namespace media {
14 namespace cast {
16 // RawEventSubscriber implementation that records all incoming raw events
17 // in std::vector's.
18 // The user of this class can call the GetXXXEventsAndReset functions to get
19 // list of events that have acccumulated since last inovcation.
20 class SimpleEventSubscriber : public RawEventSubscriber {
21 public:
22 SimpleEventSubscriber();
24 virtual ~SimpleEventSubscriber();
26 // RawEventSubscriber implementations.
27 virtual void OnReceiveFrameEvent(const FrameEvent& frame_event) OVERRIDE;
28 virtual void OnReceivePacketEvent(const PacketEvent& packet_event) OVERRIDE;
29 virtual void OnReceiveGenericEvent(const GenericEvent& generic_event)
30 OVERRIDE;
32 // Assigns frame events received so far to |frame_events| and clears them
33 // from this object.
34 void GetFrameEventsAndReset(std::vector<FrameEvent>* frame_events);
36 // Assigns packet events received so far to |packet_events| and clears them
37 // from this object.
38 void GetPacketEventsAndReset(std::vector<PacketEvent>* packet_events);
40 // Assigns generic events received so far to |generic_events| and clears them
41 // from this object.
42 void GetGenericEventsAndReset(std::vector<GenericEvent>* generic_events);
44 private:
45 std::vector<FrameEvent> frame_events_;
46 std::vector<PacketEvent> packet_events_;
47 std::vector<GenericEvent> generic_events_;
49 // All functions must be called on the main thread.
50 base::ThreadChecker thread_checker_;
52 DISALLOW_COPY_AND_ASSIGN(SimpleEventSubscriber);
55 } // namespace cast
56 } // namespace media
58 #endif // MEDIA_CAST_LOGGING_SIMPLE_EVENT_SUBSCRIBER_H_