OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 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 | 4 |
5 #ifndef CONTENT_BROWSER_MEDIA_SESSION_PEPPER_PLAYBACK_OBSERVER_H_ | 5 #ifndef CONTENT_BROWSER_MEDIA_SESSION_PEPPER_PLAYBACK_OBSERVER_H_ |
6 #define CONTENT_BROWSER_MEDIA_SESSION_PEPPER_PLAYBACK_OBSERVER_H_ | 6 #define CONTENT_BROWSER_MEDIA_SESSION_PEPPER_PLAYBACK_OBSERVER_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 #include <map> | 9 #include <map> |
10 #include <memory> | 10 #include <memory> |
(...skipping 17 matching lines...) Expand all Loading... |
28 void PepperInstanceDeleted(int32_t pp_instance); | 28 void PepperInstanceDeleted(int32_t pp_instance); |
29 void PepperStartsPlayback(int32_t pp_instance); | 29 void PepperStartsPlayback(int32_t pp_instance); |
30 void PepperStopsPlayback(int32_t pp_instance); | 30 void PepperStopsPlayback(int32_t pp_instance); |
31 | 31 |
32 private: | 32 private: |
33 // Owning PepperPlayerDelegates. | 33 // Owning PepperPlayerDelegates. |
34 using PlayersMap = | 34 using PlayersMap = |
35 std::map<int32_t, std::unique_ptr<PepperPlayerDelegate>>; | 35 std::map<int32_t, std::unique_ptr<PepperPlayerDelegate>>; |
36 PlayersMap players_map_; | 36 PlayersMap players_map_; |
37 | 37 |
| 38 // Map for whether Pepper players have ever played sound. |
| 39 // Used for recording UMA. |
| 40 using PlayersPlayedSoundMap = |
| 41 std::map<int32_t, bool>; |
| 42 PlayersPlayedSoundMap players_played_sound_map_; |
| 43 |
38 // Weak reference to WebContents. | 44 // Weak reference to WebContents. |
39 WebContentsImpl* contents_; | 45 WebContentsImpl* contents_; |
40 | 46 |
41 DISALLOW_COPY_AND_ASSIGN(PepperPlaybackObserver); | 47 DISALLOW_COPY_AND_ASSIGN(PepperPlaybackObserver); |
42 }; | 48 }; |
43 | 49 |
44 } // namespace content | 50 } // namespace content |
45 | 51 |
46 #endif // CONTENT_BROWSER_MEDIA_SESSION_PEPPER_PLAYBACK_OBSERVER_H_ | 52 #endif // CONTENT_BROWSER_MEDIA_SESSION_PEPPER_PLAYBACK_OBSERVER_H_ |
OLD | NEW |