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

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

Issue 2640573002: Remove WebMediaPlayerDelegate null checks (Closed)
Patch Set: Fixed WMPMS and WMPA Created 3 years, 11 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/webmediaplayer_android.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_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
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
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 media::WebMediaPlayerDelegate* delegate_;
clamy 2017/01/18 13:56:16 Could you add a comment describing why this is saf
tguilbert 2017/01/19 02:39:12 Done.
281 int delegate_id_; 281 int delegate_id_;
282 282
283 // Callback responsible for determining if loading of media should be deferred 283 // Callback responsible for determining if loading of media should be deferred
284 // for external reasons; called during load(). 284 // for external reasons; called during load().
285 media::WebMediaPlayerParams::DeferLoadCB defer_load_cb_; 285 media::WebMediaPlayerParams::DeferLoadCB defer_load_cb_;
286 286
287 // Save the list of buffered time ranges. 287 // Save the list of buffered time ranges.
288 blink::WebTimeRanges buffered_; 288 blink::WebTimeRanges buffered_;
289 289
290 // Size of the video. 290 // Size of the video.
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
425 425
426 // NOTE: Weak pointers must be invalidated before all other member variables. 426 // NOTE: Weak pointers must be invalidated before all other member variables.
427 base::WeakPtrFactory<WebMediaPlayerAndroid> weak_factory_; 427 base::WeakPtrFactory<WebMediaPlayerAndroid> weak_factory_;
428 428
429 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerAndroid); 429 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerAndroid);
430 }; 430 };
431 431
432 } // namespace content 432 } // namespace content
433 433
434 #endif // CONTENT_RENDERER_MEDIA_ANDROID_WEBMEDIAPLAYER_ANDROID_H_ 434 #endif // CONTENT_RENDERER_MEDIA_ANDROID_WEBMEDIAPLAYER_ANDROID_H_
OLDNEW
« no previous file with comments | « no previous file | content/renderer/media/android/webmediaplayer_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698