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

Side by Side Diff: media/cast/logging/logging_impl.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 unified diff | Download patch
« no previous file with comments | « media/cast/logging/logging_defines.cc ('k') | media/cast/logging/logging_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 #ifndef MEDIA_CAST_LOGGING_LOGGING_IMPL_H_ 4 #ifndef MEDIA_CAST_LOGGING_LOGGING_IMPL_H_
5 #define MEDIA_CAST_LOGGING_LOGGING_IMPL_H_ 5 #define MEDIA_CAST_LOGGING_LOGGING_IMPL_H_
6 6
7 // Generic class that handles event logging for the cast library. 7 // Generic class that handles event logging for the cast library.
8 // Logging has three possible optional forms: 8 // Logging has three possible optional forms:
9 // 1. Raw data and stats accessible by the application. 9 // 1. Raw data and stats accessible by the application.
10 // 2. Tracing of raw events. 10 // 2. Tracing of raw events.
11 11
12 #include "base/memory/ref_counted.h" 12 #include "base/memory/ref_counted.h"
13 #include "base/threading/thread_checker.h" 13 #include "base/threading/thread_checker.h"
14 #include "media/cast/cast_config.h" 14 #include "media/cast/cast_config.h"
15 #include "media/cast/logging/logging_defines.h" 15 #include "media/cast/logging/logging_defines.h"
16 #include "media/cast/logging/logging_raw.h" 16 #include "media/cast/logging/logging_raw.h"
17 #include "media/cast/logging/logging_stats.h"
18 17
19 namespace media { 18 namespace media {
20 namespace cast { 19 namespace cast {
21 20
22 class LoggingImpl { 21 class LoggingImpl {
23 public: 22 public:
24 explicit LoggingImpl(const CastLoggingConfig& config); 23 LoggingImpl();
25
26 ~LoggingImpl(); 24 ~LoggingImpl();
27 25
28 // Note: All methods below should be called from the same thread. 26 // Note: All methods below should be called from the same thread.
29 27
30 void InsertFrameEvent(const base::TimeTicks& time_of_event, 28 void InsertFrameEvent(const base::TimeTicks& time_of_event,
31 CastLoggingEvent event, uint32 rtp_timestamp, 29 CastLoggingEvent event, uint32 rtp_timestamp,
32 uint32 frame_id); 30 uint32 frame_id);
33 31
34 void InsertFrameEventWithSize(const base::TimeTicks& time_of_event, 32 void InsertFrameEventWithSize(const base::TimeTicks& time_of_event,
35 CastLoggingEvent event, uint32 rtp_timestamp, 33 CastLoggingEvent event, uint32 rtp_timestamp,
(...skipping 18 matching lines...) Expand all
54 void InsertGenericEvent(const base::TimeTicks& time_of_event, 52 void InsertGenericEvent(const base::TimeTicks& time_of_event,
55 CastLoggingEvent event, int value); 53 CastLoggingEvent event, int value);
56 54
57 55
58 // Delegates to |LoggingRaw::AddRawEventSubscriber()|. 56 // Delegates to |LoggingRaw::AddRawEventSubscriber()|.
59 void AddRawEventSubscriber(RawEventSubscriber* subscriber); 57 void AddRawEventSubscriber(RawEventSubscriber* subscriber);
60 58
61 // Delegates to |LoggingRaw::RemoveRawEventSubscriber()|. 59 // Delegates to |LoggingRaw::RemoveRawEventSubscriber()|.
62 void RemoveRawEventSubscriber(RawEventSubscriber* subscriber); 60 void RemoveRawEventSubscriber(RawEventSubscriber* subscriber);
63 61
64 // Get stats only.
65 FrameStatsMap GetFrameStatsData(EventMediaType media_type) const;
66 PacketStatsMap GetPacketStatsData(EventMediaType media_type) const;
67 GenericStatsMap GetGenericStatsData() const;
68
69 // Reset stats logging data.
70 void ResetStats();
71
72 private: 62 private:
73 base::ThreadChecker thread_checker_; 63 base::ThreadChecker thread_checker_;
74 const CastLoggingConfig config_;
75 LoggingRaw raw_; 64 LoggingRaw raw_;
76 LoggingStats stats_;
77 65
78 DISALLOW_COPY_AND_ASSIGN(LoggingImpl); 66 DISALLOW_COPY_AND_ASSIGN(LoggingImpl);
79 }; 67 };
80 68
81 } // namespace cast 69 } // namespace cast
82 } // namespace media 70 } // namespace media
83 71
84 #endif // MEDIA_CAST_LOGGING_LOGGING_IMPL_H_ 72 #endif // MEDIA_CAST_LOGGING_LOGGING_IMPL_H_
OLDNEW
« no previous file with comments | « media/cast/logging/logging_defines.cc ('k') | media/cast/logging/logging_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698