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

Side by Side Diff: content/browser/media/audible_metrics.h

Issue 1591453005: Add metrics regarding concurrent audible tabs in Chromium. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nits Created 4 years, 11 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
OLDNEW
(Empty)
1 // Copyright 2016 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.
4
5 #ifndef CONTENT_BROWSER_MEDIA_AUDIBLE_METRICS_H_
6 #define CONTENT_BROWSER_MEDIA_AUDIBLE_METRICS_H_
7
8 #include <set>
9
10 #include "base/memory/scoped_ptr.h"
11 #include "base/time/tick_clock.h"
12 #include "content/common/content_export.h"
13
14 namespace content {
15
16 class WebContents;
17
18 // This class handles metrics regarding audible WebContents.
19 // It does register three different information:
20 // - how many WebContents are audible when a WebContents become audible.
21 // - how long multiple WebContents are audible at the same time.
22 // - for a browsing session, how often and how many WebContents get audible at
23 // the same time.
24 class CONTENT_EXPORT AudibleMetrics {
25 public:
26 AudibleMetrics();
27 ~AudibleMetrics();
28
29 void UpdateAudibleWebContentsState(const WebContents* web_contents,
30 bool audible);
31
32 void SetClockForTest(scoped_ptr<base::TickClock> test_clock);
33
34 private:
35 void AddAudibleWebContents(const WebContents* web_contents);
36 void RemoveAudibleWebContents(const WebContents* web_contents);
37
38 base::TimeTicks concurrent_web_contents_start_time_;
39 size_t max_concurrent_audible_web_contents_in_session_;
40 scoped_ptr<base::TickClock> clock_;
41
42 std::set<const WebContents*> audible_web_contents_;
43
44 DISALLOW_COPY_AND_ASSIGN(AudibleMetrics);
45 };
46
47 } // namespace content
48
49 #endif // CONTENT_BROWSER_MEDIA_AUDIBLE_METRICS_H_
OLDNEW
« no previous file with comments | « no previous file | content/browser/media/audible_metrics.cc » ('j') | content/browser/media/audible_metrics.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698