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

Side by Side Diff: content/renderer/media/android/renderer_media_player_manager.h

Issue 136113015: Fix fullscreen video race condition. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address raised issues Created 6 years, 10 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
« no previous file with comments | « no previous file | content/renderer/media/android/renderer_media_player_manager.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_RENDERER_MEDIA_ANDROID_RENDERER_MEDIA_PLAYER_MANAGER_H_ 5 #ifndef CONTENT_RENDERER_MEDIA_ANDROID_RENDERER_MEDIA_PLAYER_MANAGER_H_
6 #define CONTENT_RENDERER_MEDIA_ANDROID_RENDERER_MEDIA_PLAYER_MANAGER_H_ 6 #define CONTENT_RENDERER_MEDIA_ANDROID_RENDERER_MEDIA_PLAYER_MANAGER_H_
7 7
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 // Sets the player volume. 64 // Sets the player volume.
65 void SetVolume(int player_id, double volume); 65 void SetVolume(int player_id, double volume);
66 66
67 // Releases resources for the player. 67 // Releases resources for the player.
68 void ReleaseResources(int player_id); 68 void ReleaseResources(int player_id);
69 69
70 // Destroys the player in the browser process 70 // Destroys the player in the browser process
71 void DestroyPlayer(int player_id); 71 void DestroyPlayer(int player_id);
72 72
73 // Requests the player to enter fullscreen. 73 // Requests the player to enter fullscreen.
74 void EnterFullscreen(int player_id); 74 void EnterFullscreen(int player_id, blink::WebFrame* frame);
75 75
76 // Requests the player to exit fullscreen. 76 // Requests the player to exit fullscreen.
77 void ExitFullscreen(int player_id); 77 void ExitFullscreen(int player_id);
78 78
79 #if defined(VIDEO_HOLE) 79 #if defined(VIDEO_HOLE)
80 // Requests an external surface for out-of-band compositing. 80 // Requests an external surface for out-of-band compositing.
81 void RequestExternalSurface(int player_id, const gfx::RectF& geometry); 81 void RequestExternalSurface(int player_id, const gfx::RectF& geometry);
82 82
83 // RenderViewObserver overrides. 83 // RenderViewObserver overrides.
84 virtual void DidCommitCompositorFrame() OVERRIDE; 84 virtual void DidCommitCompositorFrame() OVERRIDE;
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 // Checks whether a player can enter fullscreen. 116 // Checks whether a player can enter fullscreen.
117 bool CanEnterFullscreen(blink::WebFrame* frame); 117 bool CanEnterFullscreen(blink::WebFrame* frame);
118 118
119 // Called when a player entered or exited fullscreen. 119 // Called when a player entered or exited fullscreen.
120 void DidEnterFullscreen(blink::WebFrame* frame); 120 void DidEnterFullscreen(blink::WebFrame* frame);
121 void DidExitFullscreen(); 121 void DidExitFullscreen();
122 122
123 // Checks whether the Webframe is in fullscreen. 123 // Checks whether the Webframe is in fullscreen.
124 bool IsInFullscreen(blink::WebFrame* frame); 124 bool IsInFullscreen(blink::WebFrame* frame);
125 125
126 // True if a newly created media player should enter fullscreen.
127 bool ShouldEnterFullscreen(blink::WebFrame* frame);
128
126 // Gets the pointer to WebMediaPlayerAndroid given the |player_id|. 129 // Gets the pointer to WebMediaPlayerAndroid given the |player_id|.
127 WebMediaPlayerAndroid* GetMediaPlayer(int player_id); 130 WebMediaPlayerAndroid* GetMediaPlayer(int player_id);
128 131
129 // Gets the pointer to ProxyMediaKeys given the |media_keys_id|. 132 // Gets the pointer to ProxyMediaKeys given the |media_keys_id|.
130 ProxyMediaKeys* GetMediaKeys(int media_keys_id); 133 ProxyMediaKeys* GetMediaKeys(int media_keys_id);
131 134
132 #if defined(VIDEO_HOLE) 135 #if defined(VIDEO_HOLE)
133 // Gets the list of media players with video geometry changes. 136 // Gets the list of media players with video geometry changes.
134 void RetrieveGeometryChanges(std::map<int, gfx::RectF>* changes); 137 void RetrieveGeometryChanges(std::map<int, gfx::RectF>* changes);
135 #endif // defined(VIDEO_HOLE) 138 #endif // defined(VIDEO_HOLE)
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 179
177 // Info for all available ProxyMediaKeys. There must be at most one 180 // Info for all available ProxyMediaKeys. There must be at most one
178 // ProxyMediaKeys for each available WebMediaPlayerAndroid. 181 // ProxyMediaKeys for each available WebMediaPlayerAndroid.
179 std::map<int, ProxyMediaKeys*> media_keys_; 182 std::map<int, ProxyMediaKeys*> media_keys_;
180 183
181 int next_media_player_id_; 184 int next_media_player_id_;
182 185
183 // WebFrame of the fullscreen video. 186 // WebFrame of the fullscreen video.
184 blink::WebFrame* fullscreen_frame_; 187 blink::WebFrame* fullscreen_frame_;
185 188
189 // WebFrame of pending fullscreen request.
190 blink::WebFrame* pending_fullscreen_frame_;
191
186 DISALLOW_COPY_AND_ASSIGN(RendererMediaPlayerManager); 192 DISALLOW_COPY_AND_ASSIGN(RendererMediaPlayerManager);
187 }; 193 };
188 194
189 } // namespace content 195 } // namespace content
190 196
191 #endif // CONTENT_RENDERER_MEDIA_ANDROID_RENDERER_MEDIA_PLAYER_MANAGER_H_ 197 #endif // CONTENT_RENDERER_MEDIA_ANDROID_RENDERER_MEDIA_PLAYER_MANAGER_H_
OLDNEW
« no previous file with comments | « no previous file | content/renderer/media/android/renderer_media_player_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698