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

Side by Side Diff: content/renderer/media/renderer_webmediaplayer_delegate.h

Issue 2496653002: Part 2 of base::IDMap refactor to eliminate IDMapOwnPointer/IDMapExternalPointer modes (Closed)
Patch Set: typedefs => using statements, update comments in base/id_map.h Created 4 years 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
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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_RENDERER_MEDIA_RENDERER_WEBMEDIAPLAYER_DELEGATE_H_ 5 #ifndef CONTENT_RENDERER_MEDIA_RENDERER_WEBMEDIAPLAYER_DELEGATE_H_
6 #define CONTENT_RENDERER_MEDIA_RENDERER_WEBMEDIAPLAYER_DELEGATE_H_ 6 #define CONTENT_RENDERER_MEDIA_RENDERER_WEBMEDIAPLAYER_DELEGATE_H_
7 7
8 #include <map> 8 #include <map>
9 #include <memory> 9 #include <memory>
10 #include <set> 10 #include <set>
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 void RemoveIdleDelegate(int delegate_id); 84 void RemoveIdleDelegate(int delegate_id);
85 85
86 // Runs periodically to suspend idle delegates in |idle_delegate_map_| which 86 // Runs periodically to suspend idle delegates in |idle_delegate_map_| which
87 // have been idle for longer than |timeout|. 87 // have been idle for longer than |timeout|.
88 void CleanupIdleDelegates(base::TimeDelta timeout); 88 void CleanupIdleDelegates(base::TimeDelta timeout);
89 89
90 // Setter for |is_playing_background_video_| that updates the metrics. 90 // Setter for |is_playing_background_video_| that updates the metrics.
91 void SetIsPlayingBackgroundVideo(bool is_playing); 91 void SetIsPlayingBackgroundVideo(bool is_playing);
92 92
93 bool has_played_media_ = false; 93 bool has_played_media_ = false;
94 IDMap<Observer> id_map_; 94 IDMap<Observer*> id_map_;
95 95
96 // Tracks which delegates have entered an idle state. After some period of 96 // Tracks which delegates have entered an idle state. After some period of
97 // inactivity these players will be suspended to release unused resources. 97 // inactivity these players will be suspended to release unused resources.
98 bool idle_cleanup_running_ = false; 98 bool idle_cleanup_running_ = false;
99 std::map<int, base::TimeTicks> idle_delegate_map_; 99 std::map<int, base::TimeTicks> idle_delegate_map_;
100 base::Timer idle_cleanup_timer_; 100 base::Timer idle_cleanup_timer_;
101 101
102 // Amount of time allowed to elapse after a delegate enters the paused before 102 // Amount of time allowed to elapse after a delegate enters the paused before
103 // the delegate is suspended. 103 // the delegate is suspended.
104 base::TimeDelta idle_timeout_; 104 base::TimeDelta idle_timeout_;
(...skipping 25 matching lines...) Expand all
130 // Determined at construction time based on system information; determines 130 // Determined at construction time based on system information; determines
131 // when the idle cleanup timer should be fired more aggressively. 131 // when the idle cleanup timer should be fired more aggressively.
132 bool is_low_end_device_; 132 bool is_low_end_device_;
133 133
134 DISALLOW_COPY_AND_ASSIGN(RendererWebMediaPlayerDelegate); 134 DISALLOW_COPY_AND_ASSIGN(RendererWebMediaPlayerDelegate);
135 }; 135 };
136 136
137 } // namespace media 137 } // namespace media
138 138
139 #endif // CONTENT_RENDERER_MEDIA_RENDERER_WEBMEDIAPLAYER_DELEGATE_H_ 139 #endif // CONTENT_RENDERER_MEDIA_RENDERER_WEBMEDIAPLAYER_DELEGATE_H_
OLDNEW
« no previous file with comments | « content/renderer/media/audio_message_filter.cc ('k') | content/renderer/media/renderer_webmediaplayer_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698