| Differences between
and this patch
- Source/WebCore/ChangeLog +17 lines
Lines 1-3 Source/WebCore/ChangeLog_sec1
1
2016-11-16  Ryosuke Niwa  <rniwa@webkit.org>
2
3
        Fix build on macOS Sierra when WEB_PLAYBACK_CONTROLS_MANAGER is enabled
4
        https://bugs.webkit.org/show_bug.cgi?id=164845
5
6
        Reviewed by NOBODY (OOPS!).
7
8
        Fix builds after r208802 by wrapping code inside USE(APPLE_INTERNAL_SDK).
9
10
        * platform/mac/WebPlaybackControlsManager.h:
11
        * platform/mac/WebPlaybackControlsManager.mm:
12
        * platform/mac/WebPlaybackSessionInterfaceMac.mm:
13
        (WebCore::WebPlaybackSessionInterfaceMac::seekableRangesChanged):
14
        (WebCore::WebPlaybackSessionInterfaceMac::audioMediaSelectionOptionsChanged):
15
        (WebCore::WebPlaybackSessionInterfaceMac::legibleMediaSelectionOptionsChanged):
16
        (WebCore::WebPlaybackSessionInterfaceMac::setPlayBackControlsManager):
17
1
2016-11-16  Chris Dumez  <cdumez@apple.com>
18
2016-11-16  Chris Dumez  <cdumez@apple.com>
2
19
3
        ScriptExecutionContext::processMessagePortMessagesSoon() should only post task when necessary
20
        ScriptExecutionContext::processMessagePortMessagesSoon() should only post task when necessary
- Source/WebCore/platform/mac/WebPlaybackControlsManager.h -1 / +4 lines
Lines 46-56 Source/WebCore/platform/mac/WebPlaybackControlsManager.h_sec1
46
    RetainPtr<NSArray> _seekableTimeRanges;
46
    RetainPtr<NSArray> _seekableTimeRanges;
47
    BOOL _hasEnabledAudio;
47
    BOOL _hasEnabledAudio;
48
    BOOL _hasEnabledVideo;
48
    BOOL _hasEnabledVideo;
49
#if USE(APPLE_INTERNAL_SDK)
49
    RetainPtr<NSArray<AVFunctionBarMediaSelectionOption *>> _audioFunctionBarMediaSelectionOptions;
50
    RetainPtr<NSArray<AVFunctionBarMediaSelectionOption *>> _audioFunctionBarMediaSelectionOptions;
50
    RetainPtr<AVFunctionBarMediaSelectionOption> _currentAudioFunctionBarMediaSelectionOption;
51
    RetainPtr<AVFunctionBarMediaSelectionOption> _currentAudioFunctionBarMediaSelectionOption;
51
    RetainPtr<NSArray<AVFunctionBarMediaSelectionOption *>> _legibleFunctionBarMediaSelectionOptions;
52
    RetainPtr<NSArray<AVFunctionBarMediaSelectionOption *>> _legibleFunctionBarMediaSelectionOptions;
52
    RetainPtr<AVFunctionBarMediaSelectionOption> _currentLegibleFunctionBarMediaSelectionOption;
53
    RetainPtr<AVFunctionBarMediaSelectionOption> _currentLegibleFunctionBarMediaSelectionOption;
53
54
#endif
54
    float _rate;
55
    float _rate;
55
    BOOL _playing;
56
    BOOL _playing;
56
    BOOL _canTogglePlayback;
57
    BOOL _canTogglePlayback;
Lines 71-76 Source/WebCore/platform/mac/WebPlaybackControlsManager.h_sec2
71
72
72
@property (nonatomic) float rate;
73
@property (nonatomic) float rate;
73
74
75
#if USE(APPLE_INTERNAL_SDK)
74
- (AVFunctionBarMediaSelectionOption *)currentAudioFunctionBarMediaSelectionOption;
76
- (AVFunctionBarMediaSelectionOption *)currentAudioFunctionBarMediaSelectionOption;
75
- (void)setCurrentAudioFunctionBarMediaSelectionOption:(AVFunctionBarMediaSelectionOption *)option;
77
- (void)setCurrentAudioFunctionBarMediaSelectionOption:(AVFunctionBarMediaSelectionOption *)option;
76
- (AVFunctionBarMediaSelectionOption *)currentLegibleFunctionBarMediaSelectionOption;
78
- (AVFunctionBarMediaSelectionOption *)currentLegibleFunctionBarMediaSelectionOption;
Lines 77-82 Source/WebCore/platform/mac/WebPlaybackControlsManager.h_sec3
77
- (void)setCurrentLegibleFunctionBarMediaSelectionOption:(AVFunctionBarMediaSelectionOption *)option;
79
- (void)setCurrentLegibleFunctionBarMediaSelectionOption:(AVFunctionBarMediaSelectionOption *)option;
78
- (void)setAudioMediaSelectionOptions:(const Vector<WTF::String>&)options withSelectedIndex:(NSUInteger)selectedIndex;
80
- (void)setAudioMediaSelectionOptions:(const Vector<WTF::String>&)options withSelectedIndex:(NSUInteger)selectedIndex;
79
- (void)setLegibleMediaSelectionOptions:(const Vector<WTF::String>&)options withSelectedIndex:(NSUInteger)selectedIndex;
81
- (void)setLegibleMediaSelectionOptions:(const Vector<WTF::String>&)options withSelectedIndex:(NSUInteger)selectedIndex;
82
#endif
80
@end
83
@end
81
84
82
#endif // ENABLE(WEB_PLAYBACK_CONTROLS_MANAGER)
85
#endif // ENABLE(WEB_PLAYBACK_CONTROLS_MANAGER)
- Source/WebCore/platform/mac/WebPlaybackControlsManager.mm -1 / +4 lines
Lines 90-95 Source/WebCore/platform/mac/WebPlaybackControlsManager.mm_sec1
90
{
90
{
91
}
91
}
92
92
93
#if USE(APPLE_INTERNAL_SDK)
93
- (void)generateFunctionBarThumbnailsForTimes:(NSArray<NSNumber *> *)thumbnailTimes size:(NSSize)size completionHandler:(void (^)(NSArray<AVThumbnail *> *thumbnails, NSError *error))completionHandler
94
- (void)generateFunctionBarThumbnailsForTimes:(NSArray<NSNumber *> *)thumbnailTimes size:(NSSize)size completionHandler:(void (^)(NSArray<AVThumbnail *> *thumbnails, NSError *error))completionHandler
94
{
95
{
95
    UNUSED_PARAM(thumbnailTimes);
96
    UNUSED_PARAM(thumbnailTimes);
Lines 102-107 Source/WebCore/platform/mac/WebPlaybackControlsManager.mm_sec2
102
    UNUSED_PARAM(numberOfSamples);
103
    UNUSED_PARAM(numberOfSamples);
103
    completionHandler(@[ ], nil);
104
    completionHandler(@[ ], nil);
104
}
105
}
106
#endif
105
107
106
-(BOOL)canBeginFunctionBarScrubbing
108
-(BOOL)canBeginFunctionBarScrubbing
107
{
109
{
Lines 121-126 Source/WebCore/platform/mac/WebPlaybackControlsManager.mm_sec3
121
    _webPlaybackSessionInterfaceMac->endScrubbing();
123
    _webPlaybackSessionInterfaceMac->endScrubbing();
122
}
124
}
123
125
126
#if USE(APPLE_INTERNAL_SDK)
124
- (NSArray<AVFunctionBarMediaSelectionOption *> *)audioFunctionBarMediaSelectionOptions
127
- (NSArray<AVFunctionBarMediaSelectionOption *> *)audioFunctionBarMediaSelectionOptions
125
{
128
{
126
    return _audioFunctionBarMediaSelectionOptions.get();
129
    return _audioFunctionBarMediaSelectionOptions.get();
Lines 206-212 Source/WebCore/platform/mac/WebPlaybackControlsManager.mm_sec4
206
    if (selectedIndex < [webOptions count])
209
    if (selectedIndex < [webOptions count])
207
        [self setCurrentLegibleFunctionBarMediaSelectionOption:[webOptions objectAtIndex:selectedIndex]];
210
        [self setCurrentLegibleFunctionBarMediaSelectionOption:[webOptions objectAtIndex:selectedIndex]];
208
}
211
}
209
212
#endif
210
- (WebCore::WebPlaybackSessionInterfaceMac*)webPlaybackSessionInterfaceMac
213
- (WebCore::WebPlaybackSessionInterfaceMac*)webPlaybackSessionInterfaceMac
211
{
214
{
212
    return _webPlaybackSessionInterfaceMac.get();
215
    return _webPlaybackSessionInterfaceMac.get();
- Source/WebCore/platform/mac/WebPlaybackSessionInterfaceMac.mm -3 / +5 lines
Lines 131-137 Source/WebCore/platform/mac/WebPlaybackSessionInterfaceMac.mm_sec1
131
131
132
void WebPlaybackSessionInterfaceMac::seekableRangesChanged(const TimeRanges& timeRanges)
132
void WebPlaybackSessionInterfaceMac::seekableRangesChanged(const TimeRanges& timeRanges)
133
{
133
{
134
#if ENABLE(WEB_PLAYBACK_CONTROLS_MANAGER)
134
#if ENABLE(WEB_PLAYBACK_CONTROLS_MANAGER) && USE(APPLE_INTERNAL_SDK)
135
    [playBackControlsManager() setSeekableTimeRanges:timeRangesToArray(timeRanges).get()];
135
    [playBackControlsManager() setSeekableTimeRanges:timeRangesToArray(timeRanges).get()];
136
#else
136
#else
137
    UNUSED_PARAM(timeRanges);
137
    UNUSED_PARAM(timeRanges);
Lines 140-146 Source/WebCore/platform/mac/WebPlaybackSessionInterfaceMac.mm_sec2
140
140
141
void WebPlaybackSessionInterfaceMac::audioMediaSelectionOptionsChanged(const Vector<WTF::String>& options, uint64_t selectedIndex)
141
void WebPlaybackSessionInterfaceMac::audioMediaSelectionOptionsChanged(const Vector<WTF::String>& options, uint64_t selectedIndex)
142
{
142
{
143
#if ENABLE(WEB_PLAYBACK_CONTROLS_MANAGER)
143
#if ENABLE(WEB_PLAYBACK_CONTROLS_MANAGER) && USE(APPLE_INTERNAL_SDK)
144
    [playBackControlsManager() setAudioMediaSelectionOptions:options withSelectedIndex:static_cast<NSUInteger>(selectedIndex)];
144
    [playBackControlsManager() setAudioMediaSelectionOptions:options withSelectedIndex:static_cast<NSUInteger>(selectedIndex)];
145
#else
145
#else
146
    UNUSED_PARAM(options);
146
    UNUSED_PARAM(options);
Lines 150-156 Source/WebCore/platform/mac/WebPlaybackSessionInterfaceMac.mm_sec3
150
150
151
void WebPlaybackSessionInterfaceMac::legibleMediaSelectionOptionsChanged(const Vector<WTF::String>& options, uint64_t selectedIndex)
151
void WebPlaybackSessionInterfaceMac::legibleMediaSelectionOptionsChanged(const Vector<WTF::String>& options, uint64_t selectedIndex)
152
{
152
{
153
#if ENABLE(WEB_PLAYBACK_CONTROLS_MANAGER)
153
#if ENABLE(WEB_PLAYBACK_CONTROLS_MANAGER) && USE(APPLE_INTERNAL_SDK)
154
    [playBackControlsManager() setLegibleMediaSelectionOptions:options withSelectedIndex:static_cast<NSUInteger>(selectedIndex)];
154
    [playBackControlsManager() setLegibleMediaSelectionOptions:options withSelectedIndex:static_cast<NSUInteger>(selectedIndex)];
155
#else
155
#else
156
    UNUSED_PARAM(options);
156
    UNUSED_PARAM(options);
Lines 198-205 Source/WebCore/platform/mac/WebPlaybackSessionInterfaceMac.mm_sec4
198
    manager.seekableTimeRanges = timeRangesToArray(m_playbackSessionModel->seekableRanges()).get();
198
    manager.seekableTimeRanges = timeRangesToArray(m_playbackSessionModel->seekableRanges()).get();
199
    manager.canTogglePlayback = YES;
199
    manager.canTogglePlayback = YES;
200
    manager.playing = m_playbackSessionModel->isPlaying();
200
    manager.playing = m_playbackSessionModel->isPlaying();
201
#if USE(APPLE_INTERNAL_SDK)
201
    [manager setAudioMediaSelectionOptions:m_playbackSessionModel->audioMediaSelectionOptions() withSelectedIndex:static_cast<NSUInteger>(m_playbackSessionModel->audioMediaSelectedIndex())];
202
    [manager setAudioMediaSelectionOptions:m_playbackSessionModel->audioMediaSelectionOptions() withSelectedIndex:static_cast<NSUInteger>(m_playbackSessionModel->audioMediaSelectedIndex())];
202
    [manager setLegibleMediaSelectionOptions:m_playbackSessionModel->legibleMediaSelectionOptions() withSelectedIndex:static_cast<NSUInteger>(m_playbackSessionModel->legibleMediaSelectedIndex())];
203
    [manager setLegibleMediaSelectionOptions:m_playbackSessionModel->legibleMediaSelectionOptions() withSelectedIndex:static_cast<NSUInteger>(m_playbackSessionModel->legibleMediaSelectedIndex())];
204
#endif
203
}
205
}
204
206
205
void WebPlaybackSessionInterfaceMac::updatePlaybackControlsManagerTiming(double currentTime, double anchorTime, double playbackRate, bool isPlaying)
207
void WebPlaybackSessionInterfaceMac::updatePlaybackControlsManagerTiming(double currentTime, double anchorTime, double playbackRate, bool isPlaying)

Return to Bug 164845