Changeset 265019 in webkit
- Timestamp:
- Jul 28, 2020 4:21:53 PM (4 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r265014 r265019 1 2020-07-28 Peng Liu <peng.liu6@apple.com> 2 3 Clean up PlaybackSessionInterface[Mac|AVKit] 4 https://bugs.webkit.org/show_bug.cgi?id=214895 5 6 Reviewed by Eric Carlson. 7 8 No new tests, no functional change. 9 10 * platform/ios/PlaybackSessionInterfaceAVKit.h: 11 * platform/ios/PlaybackSessionInterfaceAVKit.mm: 12 (WebCore::PlaybackSessionInterfaceAVKit::PlaybackSessionInterfaceAVKit): 13 (WebCore::PlaybackSessionInterfaceAVKit::playbackSessionModel const): 14 Remove unnecessary WEBCORE_EXPORT. 15 Include the correct header for Ref. 16 Replace "protected" with "private". 17 Use WeakPtr of PlaybackSessionModel instead of a raw pointer. 18 19 * platform/mac/PlaybackSessionInterfaceMac.h: 20 Add "final" to ensureControlsManager(). 21 Some small cleanup. 22 1 23 2020-07-28 Chris Dumez <cdumez@apple.com> 2 24 -
trunk/Source/WebCore/platform/ios/PlaybackSessionInterfaceAVKit.h
r260729 r265019 36 36 #include <objc/objc.h> 37 37 #include <wtf/Forward.h> 38 #include <wtf/Ref.h> 38 39 #include <wtf/RefCounted.h> 39 #include <wtf/RefPtr.h>40 40 #include <wtf/RetainPtr.h> 41 #include <wtf/WeakPtr.h> 41 42 42 43 OBJC_CLASS WebAVPlayerController; … … 60 61 61 62 // PlaybackSessionModelClient 62 WEBCORE_EXPORTvoid durationChanged(double) override;63 WEBCORE_EXPORTvoid currentTimeChanged(double currentTime, double anchorTime) override;64 WEBCORE_EXPORTvoid bufferedTimeChanged(double) override;65 WEBCORE_EXPORTvoid rateChanged(bool isPlaying, float playbackRate) override;66 WEBCORE_EXPORTvoid seekableRangesChanged(const TimeRanges&, double lastModifiedTime, double liveUpdateInterval) override;67 WEBCORE_EXPORTvoid canPlayFastReverseChanged(bool) override;68 WEBCORE_EXPORTvoid audioMediaSelectionOptionsChanged(const Vector<MediaSelectionOption>& options, uint64_t selectedIndex) override;69 WEBCORE_EXPORTvoid legibleMediaSelectionOptionsChanged(const Vector<MediaSelectionOption>& options, uint64_t selectedIndex) override;70 WEBCORE_EXPORTvoid externalPlaybackChanged(bool enabled, PlaybackSessionModel::ExternalPlaybackTargetType, const String& localizedDeviceName) override;71 WEBCORE_EXPORTvoid wirelessVideoPlaybackDisabledChanged(bool) override;72 WEBCORE_EXPORTvoid mutedChanged(bool) override;73 WEBCORE_EXPORTvoid volumeChanged(double) override;74 WEBCORE_EXPORTvoid modelDestroyed() override;63 void durationChanged(double) override; 64 void currentTimeChanged(double currentTime, double anchorTime) override; 65 void bufferedTimeChanged(double) override; 66 void rateChanged(bool isPlaying, float playbackRate) override; 67 void seekableRangesChanged(const TimeRanges&, double lastModifiedTime, double liveUpdateInterval) override; 68 void canPlayFastReverseChanged(bool) override; 69 void audioMediaSelectionOptionsChanged(const Vector<MediaSelectionOption>& options, uint64_t selectedIndex) override; 70 void legibleMediaSelectionOptionsChanged(const Vector<MediaSelectionOption>& options, uint64_t selectedIndex) override; 71 void externalPlaybackChanged(bool enabled, PlaybackSessionModel::ExternalPlaybackTargetType, const String& localizedDeviceName) override; 72 void wirelessVideoPlaybackDisabledChanged(bool) override; 73 void mutedChanged(bool) override; 74 void volumeChanged(double) override; 75 void modelDestroyed() override; 75 76 76 WEBCORE_EXPORT virtualvoid invalidate();77 void invalidate(); 77 78 78 79 WebAVPlayerController *playerController() const { return m_playerController.get(); } 79 80 80 protected: 81 WEBCORE_EXPORT PlaybackSessionInterfaceAVKit(PlaybackSessionModel&); 82 81 private: 82 PlaybackSessionInterfaceAVKit(PlaybackSessionModel&); 83 83 RetainPtr<WebAVPlayerController> m_playerController; 84 PlaybackSessionModel* m_playbackSessionModel { nullptr };84 WeakPtr<PlaybackSessionModel> m_playbackSessionModel; 85 85 }; 86 86 -
trunk/Source/WebCore/platform/ios/PlaybackSessionInterfaceAVKit.mm
r263990 r265019 52 52 PlaybackSessionInterfaceAVKit::PlaybackSessionInterfaceAVKit(PlaybackSessionModel& model) 53 53 : m_playerController(adoptNS([[WebAVPlayerController alloc] init])) 54 , m_playbackSessionModel( &model)54 , m_playbackSessionModel(makeWeakPtr(model)) 55 55 { 56 56 ASSERT(isUIThread()); … … 82 82 PlaybackSessionModel* PlaybackSessionInterfaceAVKit::playbackSessionModel() const 83 83 { 84 return m_playbackSessionModel ;84 return m_playbackSessionModel.get(); 85 85 } 86 86 -
trunk/Source/WebCore/platform/mac/PlaybackSessionInterfaceMac.h
r260729 r265019 61 61 void externalPlaybackChanged(bool /* enabled */, PlaybackSessionModel::ExternalPlaybackTargetType, const String& /* localizedDeviceName */) final; 62 62 void isPictureInPictureSupportedChanged(bool) final; 63 void ensureControlsManager() final; 63 64 64 void invalidate();65 void ensureControlsManager();66 65 #if ENABLE(WEB_PLAYBACK_CONTROLS_MANAGER) 67 66 void setPlayBackControlsManager(WebPlaybackControlsManager *); … … 73 72 void endScrubbing(); 74 73 74 void invalidate(); 75 75 76 private: 76 77 PlaybackSessionInterfaceMac(PlaybackSessionModel&); … … 81 82 void updatePlaybackControlsManagerTiming(double currentTime, double anchorTime, double playbackRate, bool isPlaying); 82 83 #endif 83 84 84 }; 85 85
Note: See TracChangeset
for help on using the changeset viewer.