| OLD | NEW |
| 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_WEBMEDIAPLAYER_ANDROID_H_ | 5 #ifndef CONTENT_RENDERER_MEDIA_ANDROID_WEBMEDIAPLAYER_ANDROID_H_ |
| 6 #define CONTENT_RENDERER_MEDIA_ANDROID_WEBMEDIAPLAYER_ANDROID_H_ | 6 #define CONTENT_RENDERER_MEDIA_ANDROID_WEBMEDIAPLAYER_ANDROID_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 // Construct a WebMediaPlayerAndroid object. This class communicates with the | 75 // Construct a WebMediaPlayerAndroid object. This class communicates with the |
| 76 // MediaPlayerAndroid object in the browser process through |proxy|. | 76 // MediaPlayerAndroid object in the browser process through |proxy|. |
| 77 // TODO(qinmin): |frame| argument is used to determine whether the current | 77 // TODO(qinmin): |frame| argument is used to determine whether the current |
| 78 // player can enter fullscreen. This logic should probably be moved into | 78 // player can enter fullscreen. This logic should probably be moved into |
| 79 // blink, so that enteredFullscreen() will not be called if another video is | 79 // blink, so that enteredFullscreen() will not be called if another video is |
| 80 // already in fullscreen. | 80 // already in fullscreen. |
| 81 WebMediaPlayerAndroid( | 81 WebMediaPlayerAndroid( |
| 82 blink::WebFrame* frame, | 82 blink::WebFrame* frame, |
| 83 blink::WebMediaPlayerClient* client, | 83 blink::WebMediaPlayerClient* client, |
| 84 blink::WebMediaPlayerEncryptedMediaClient* encrypted_client, | 84 blink::WebMediaPlayerEncryptedMediaClient* encrypted_client, |
| 85 base::WeakPtr<media::WebMediaPlayerDelegate> delegate, | 85 media::WebMediaPlayerDelegate* delegate, |
| 86 RendererMediaPlayerManager* player_manager, | 86 RendererMediaPlayerManager* player_manager, |
| 87 scoped_refptr<StreamTextureFactory> factory, | 87 scoped_refptr<StreamTextureFactory> factory, |
| 88 int frame_id, | 88 int frame_id, |
| 89 bool enable_texture_copy, | 89 bool enable_texture_copy, |
| 90 const media::WebMediaPlayerParams& params); | 90 const media::WebMediaPlayerParams& params); |
| 91 ~WebMediaPlayerAndroid() override; | 91 ~WebMediaPlayerAndroid() override; |
| 92 | 92 |
| 93 // blink::WebMediaPlayer implementation. | 93 // blink::WebMediaPlayer implementation. |
| 94 bool supportsOverlayFullscreenVideo() override; | 94 bool supportsOverlayFullscreenVideo() override; |
| 95 void enteredFullscreen() override; | 95 void enteredFullscreen() override; |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 270 bool IsBackgroundVideoCandidate() const; | 270 bool IsBackgroundVideoCandidate() const; |
| 271 | 271 |
| 272 blink::WebFrame* const frame_; | 272 blink::WebFrame* const frame_; |
| 273 | 273 |
| 274 blink::WebMediaPlayerClient* const client_; | 274 blink::WebMediaPlayerClient* const client_; |
| 275 | 275 |
| 276 // WebMediaPlayer notifies the |delegate_| of playback state changes using | 276 // WebMediaPlayer notifies the |delegate_| of playback state changes using |
| 277 // |delegate_id_|; an id provided after registering with the delegate. The | 277 // |delegate_id_|; an id provided after registering with the delegate. The |
| 278 // WebMediaPlayer may also receive directives (play, pause) from the delegate | 278 // WebMediaPlayer may also receive directives (play, pause) from the delegate |
| 279 // via the WebMediaPlayerDelegate::Observer interface after registration. | 279 // via the WebMediaPlayerDelegate::Observer interface after registration. |
| 280 base::WeakPtr<media::WebMediaPlayerDelegate> delegate_; | 280 // |
| 281 // NOTE: HTMLMediaElement is a Blink::SuspendableObject, and will receive a |
| 282 // call to contextDestroyed() when Blink::Document::shutdown() is called. |
| 283 // Document::shutdown() is called before the frame detaches (and before the |
| 284 // frame is destroyed). RenderFrameImpl owns |delegate_| and is guaranteed |
| 285 // to outlive |this|; thus it is safe to store |delegate_| as a raw pointer. |
| 286 media::WebMediaPlayerDelegate* delegate_; |
| 281 int delegate_id_; | 287 int delegate_id_; |
| 282 | 288 |
| 283 // Callback responsible for determining if loading of media should be deferred | 289 // Callback responsible for determining if loading of media should be deferred |
| 284 // for external reasons; called during load(). | 290 // for external reasons; called during load(). |
| 285 media::WebMediaPlayerParams::DeferLoadCB defer_load_cb_; | 291 media::WebMediaPlayerParams::DeferLoadCB defer_load_cb_; |
| 286 | 292 |
| 287 // Save the list of buffered time ranges. | 293 // Save the list of buffered time ranges. |
| 288 blink::WebTimeRanges buffered_; | 294 blink::WebTimeRanges buffered_; |
| 289 | 295 |
| 290 // Size of the video. | 296 // Size of the video. |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 425 | 431 |
| 426 // NOTE: Weak pointers must be invalidated before all other member variables. | 432 // NOTE: Weak pointers must be invalidated before all other member variables. |
| 427 base::WeakPtrFactory<WebMediaPlayerAndroid> weak_factory_; | 433 base::WeakPtrFactory<WebMediaPlayerAndroid> weak_factory_; |
| 428 | 434 |
| 429 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerAndroid); | 435 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerAndroid); |
| 430 }; | 436 }; |
| 431 | 437 |
| 432 } // namespace content | 438 } // namespace content |
| 433 | 439 |
| 434 #endif // CONTENT_RENDERER_MEDIA_ANDROID_WEBMEDIAPLAYER_ANDROID_H_ | 440 #endif // CONTENT_RENDERER_MEDIA_ANDROID_WEBMEDIAPLAYER_ANDROID_H_ |
| OLD | NEW |