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

Unified Diff: media/base/media_log.h

Issue 2780533004: Start recording background video watch time. (Closed)
Patch Set: Add moar tests. Created 3 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/base/media_log.h
diff --git a/media/base/media_log.h b/media/base/media_log.h
index 62c9efe44614312c2a39b664b64a0a06807d0d49..2f73e9832a1c944fe924c46e6552264870d4cf44 100644
--- a/media/base/media_log.h
+++ b/media/base/media_log.h
@@ -12,6 +12,7 @@
#include <sstream>
#include <string>
+#include "base/containers/flat_set.h"
#include "base/logging.h"
#include "base/macros.h"
#include "base/memory/ref_counted.h"
@@ -90,6 +91,8 @@ class MEDIA_EXPORT MediaLog : public base::RefCountedThreadSafe<MediaLog> {
void SetBooleanProperty(const std::string& key, bool value);
// Histogram names used for reporting; also double as MediaLog key names.
+ // NOTE: If you add to this list you must update GetWatchTimeKeys() and if
+ // necessary, GetWatchTimePowerKeys().
static const char kWatchTimeAudioAll[];
static const char kWatchTimeAudioMse[];
static const char kWatchTimeAudioEme[];
@@ -104,11 +107,21 @@ class MEDIA_EXPORT MediaLog : public base::RefCountedThreadSafe<MediaLog> {
static const char kWatchTimeAudioVideoBattery[];
static const char kWatchTimeAudioVideoAc[];
static const char kWatchTimeAudioVideoEmbeddedExperience[];
+ static const char kWatchTimeAudioVideoBackgroundAll[];
+ static const char kWatchTimeAudioVideoBackgroundMse[];
+ static const char kWatchTimeAudioVideoBackgroundEme[];
+ static const char kWatchTimeAudioVideoBackgroundSrc[];
+ static const char kWatchTimeAudioVideoBackgroundBattery[];
+ static const char kWatchTimeAudioVideoBackgroundAc[];
+ static const char kWatchTimeAudioVideoBackgroundEmbeddedExperience[];
// Markers which signify the watch time should be finalized immediately.
static const char kWatchTimeFinalize[];
static const char kWatchTimeFinalizePower[];
+ static base::flat_set<base::StringPiece> GetWatchTimeKeys();
+ static base::flat_set<base::StringPiece> GetWatchTimePowerKeys();
+
protected:
friend class base::RefCountedThreadSafe<MediaLog>;
virtual ~MediaLog();

Powered by Google App Engine
This is Rietveld 408576698