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

Unified Diff: media/cast/logging/stats_event_subscriber.h

Issue 210303003: Cast: Remove LoggingStats in favor of event subscribers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix compile Created 6 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: media/cast/logging/stats_event_subscriber.h
diff --git a/media/cast/logging/stats_event_subscriber.h b/media/cast/logging/stats_event_subscriber.h
new file mode 100644
index 0000000000000000000000000000000000000000..85419823a6c6e55e30d790f5e6c024522d00f40e
--- /dev/null
+++ b/media/cast/logging/stats_event_subscriber.h
@@ -0,0 +1,53 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef MEDIA_CAST_LOGGING_STATS_EVENT_SUBSCRIBER_H_
+#define MEDIA_CAST_LOGGING_STATS_EVENT_SUBSCRIBER_H_
+
+#include "base/threading/thread_checker.h"
+#include "media/cast/logging/logging_defines.h"
+#include "media/cast/logging/raw_event_subscriber.h"
+
+namespace media {
+namespace cast {
+
+// A RawEventSubscriber implementation that subscribes to events,
+// and aggregates them into stats.
+class StatsEventSubscriber : public RawEventSubscriber {
+ public:
+ StatsEventSubscriber(EventMediaType media_type);
+
+ virtual ~StatsEventSubscriber();
+
+ // RawReventSubscriber implementations.
+ virtual void OnReceiveFrameEvent(const FrameEvent& frame_event) OVERRIDE;
+ virtual void OnReceivePacketEvent(const PacketEvent& packet_event) OVERRIDE;
+ virtual void OnReceiveGenericEvent(const GenericEvent& generic_event)
+ OVERRIDE;
+
+ // Assigns |frame_stats_map| with frame stats.
+ void GetFrameStats(FrameStatsMap* frame_stats_map) const;
+
+ // Assigns |packet_stats_map| with packet stats.
+ void GetPacketStats(PacketStatsMap* packet_stats_map) const;
+
+ // Assigns |generic_stats_map| with generic stats data.
+ void GetGenericStats(GenericStatsMap* generic_stats_map) const;
+
+ // Resets all stats maps in this object.
+ void Reset();
+
+ private:
+ EventMediaType event_media_type_;
+ FrameStatsMap frame_stats_;
+ PacketStatsMap packet_stats_;
+ GenericStatsMap generic_stats_;
+ base::ThreadChecker thread_checker_;
+ DISALLOW_COPY_AND_ASSIGN(StatsEventSubscriber);
+};
+
+} // namespace cast
+} // namespace media
+
+#endif // MEDIA_CAST_LOGGING_STATS_EVENT_SUBSCRIBER_H_
« no previous file with comments | « media/cast/logging/simple_event_subscriber_unittest.cc ('k') | media/cast/logging/stats_event_subscriber.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698