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

Side by Side Diff: content/browser/media/android/browser_media_player_manager.h

Issue 2794283003: Remove MediaThrottler and MediaThrottleInfoBar (Closed)
Patch Set: Add comment Created 3 years, 8 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
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_ANDROID_BROWSER_MEDIA_PLAYER_MANAGER_H_ 5 #ifndef CONTENT_BROWSER_MEDIA_ANDROID_BROWSER_MEDIA_PLAYER_MANAGER_H_
6 #define CONTENT_BROWSER_MEDIA_ANDROID_BROWSER_MEDIA_PLAYER_MANAGER_H_ 6 #define CONTENT_BROWSER_MEDIA_ANDROID_BROWSER_MEDIA_PLAYER_MANAGER_H_
7 7
8 #include <map> 8 #include <map>
9 #include <memory> 9 #include <memory>
10 #include <vector> 10 #include <vector>
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 private: 153 private:
154 // Constructs a MediaPlayerAndroid object. 154 // Constructs a MediaPlayerAndroid object.
155 std::unique_ptr<media::MediaPlayerAndroid> CreateMediaPlayer( 155 std::unique_ptr<media::MediaPlayerAndroid> CreateMediaPlayer(
156 const MediaPlayerHostMsg_Initialize_Params& media_player_params, 156 const MediaPlayerHostMsg_Initialize_Params& media_player_params,
157 bool hide_url_log); 157 bool hide_url_log);
158 158
159 // Instructs |player| to release its java player. This will not remove the 159 // Instructs |player| to release its java player. This will not remove the
160 // player from |players_|. 160 // player from |players_|.
161 void ReleasePlayer(media::MediaPlayerAndroid* player); 161 void ReleasePlayer(media::MediaPlayerAndroid* player);
162 162
163 // Called when user approves media playback after being throttled.
164 void OnPlaybackPermissionGranted(int player_id, bool granted);
165
166 // Helper method to start playback.
167 void StartInternal(int player_id);
168
169 RenderFrameHost* const render_frame_host_; 163 RenderFrameHost* const render_frame_host_;
170 164
171 // An array of managed players. 165 // An array of managed players.
172 std::vector<std::unique_ptr<media::MediaPlayerAndroid>> players_; 166 std::vector<std::unique_ptr<media::MediaPlayerAndroid>> players_;
173 167
174 typedef std::map<int, bool> ActivePlayerMap; 168 typedef std::map<int, bool> ActivePlayerMap;
175 // Players that have requested decoding resources. Even though resource is 169 // Players that have requested decoding resources. Even though resource is
176 // requested, a player may be in a paused or error state and the manager 170 // requested, a player may be in a paused or error state and the manager
177 // will release its resources later. 171 // will release its resources later.
178 ActivePlayerMap active_players_; 172 ActivePlayerMap active_players_;
(...skipping 19 matching lines...) Expand all
198 192
199 // NOTE: Weak pointers must be invalidated before all other member variables. 193 // NOTE: Weak pointers must be invalidated before all other member variables.
200 base::WeakPtrFactory<BrowserMediaPlayerManager> weak_ptr_factory_; 194 base::WeakPtrFactory<BrowserMediaPlayerManager> weak_ptr_factory_;
201 195
202 DISALLOW_COPY_AND_ASSIGN(BrowserMediaPlayerManager); 196 DISALLOW_COPY_AND_ASSIGN(BrowserMediaPlayerManager);
203 }; 197 };
204 198
205 } // namespace content 199 } // namespace content
206 200
207 #endif // CONTENT_BROWSER_MEDIA_ANDROID_BROWSER_MEDIA_PLAYER_MANAGER_H_ 201 #endif // CONTENT_BROWSER_MEDIA_ANDROID_BROWSER_MEDIA_PLAYER_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698