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

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: 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/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:
whywhat 2016/01/15 19:01:19 nit: s/%/It reports three different metrics/ ?
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(WebContents* web_contents, bool audible);
DaleCurtis 2016/01/15 19:02:03 const all usage of WebContents* in this class.
mlamouri (slow - plz ping) 2016/01/19 19:26:36 Done.
30
31 void SetClockForTest(scoped_ptr<base::Clock> testing_clock);
32
33 private:
34 void AddAudibleWebContents(WebContents* web_contents);
35 void RemoveAudibleWebContents(WebContents* web_contents);
36
37 base::Time concurrent_web_contents_start_time_;
DaleCurtis 2016/01/15 19:02:03 TimeTicks
DaleCurtis 2016/01/19 18:36:53 Don't see any resolution or discussion of this com
mlamouri (slow - plz ping) 2016/01/19 19:26:36 I think I missed the first file entirely. Sorry ab
38 size_t max_concurrent_audible_web_contents_in_session_;
39 scoped_ptr<base::Clock> clock_;
DaleCurtis 2016/01/15 19:02:03 TickClock to avoid time going backwards issues
mlamouri (slow - plz ping) 2016/01/19 19:26:36 Done.
40
41 std::set<WebContents*> audible_web_contents_;
42 };
DaleCurtis 2016/01/15 19:02:03 DISALLOW_COPY_AND_ASSIGN
mlamouri (slow - plz ping) 2016/01/19 19:26:36 Done.
43
44 } // namespace content
45
46 #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_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698