Diff
Modified: trunk/Source/WTF/ChangeLog (202641 => 202642)
--- trunk/Source/WTF/ChangeLog 2016-06-29 19:22:59 UTC (rev 202641)
+++ trunk/Source/WTF/ChangeLog 2016-06-29 19:29:07 UTC (rev 202642)
@@ -1,3 +1,14 @@
+2016-06-29 Jer Noble <[email protected]>
+
+ Adopt MediaRemote.
+ https://bugs.webkit.org/show_bug.cgi?id=159250
+
+ Reviewed by Eric Carlson.
+
+ Add USE_MEDIAREMOTE.
+
+ * wtf/Platform.h:
+
2016-06-28 Commit Queue <[email protected]>
Unreviewed, rolling out r202580.
Modified: trunk/Source/WTF/wtf/Platform.h (202641 => 202642)
--- trunk/Source/WTF/wtf/Platform.h 2016-06-29 19:22:59 UTC (rev 202641)
+++ trunk/Source/WTF/wtf/Platform.h 2016-06-29 19:29:07 UTC (rev 202642)
@@ -1212,4 +1212,8 @@
#endif
#endif
+#if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101200
+#define USE_MEDIAREMOTE 1
+#endif
+
#endif /* WTF_Platform_h */
Modified: trunk/Source/WebCore/ChangeLog (202641 => 202642)
--- trunk/Source/WebCore/ChangeLog 2016-06-29 19:22:59 UTC (rev 202641)
+++ trunk/Source/WebCore/ChangeLog 2016-06-29 19:29:07 UTC (rev 202642)
@@ -1,5 +1,43 @@
2016-06-29 Jer Noble <[email protected]>
+ Adopt MediaRemote.
+ https://bugs.webkit.org/show_bug.cgi?id=159250
+
+ Reviewed by Eric Carlson.
+
+ Adopt MediaRemote and use the framework to implement MediaSessionManageMac
+ and RemoteCommandListenerMac.
+
+ * WebCore.xcodeproj/project.pbxproj:
+ * platform/RemoteCommandListener.cpp:
+ * platform/audio/PlatformMediaSessionManager.cpp:
+ * platform/audio/cocoa/MediaSessionManagerCocoa.cpp: Renamed from Source/WebCore/platform/audio/mac/MediaSessionManagerMac.cpp.
+ (PlatformMediaSessionManager::updateSessionState):
+ * platform/audio/mac/MediaSessionManagerMac.h: Added.
+ * platform/audio/mac/MediaSessionManagerMac.mm: Added.
+ (WebCore::PlatformMediaSessionManager::sharedManager):
+ (WebCore::PlatformMediaSessionManager::sharedManagerIfExists):
+ (WebCore::MediaSessionManagerMac::MediaSessionManagerMac):
+ (WebCore::MediaSessionManagerMac::~MediaSessionManagerMac):
+ (WebCore::MediaSessionManagerMac::sessionWillBeginPlayback):
+ (WebCore::MediaSessionManagerMac::removeSession):
+ (WebCore::MediaSessionManagerMac::sessionWillEndPlayback):
+ (WebCore::MediaSessionManagerMac::clientCharacteristicsChanged):
+ (WebCore::MediaSessionManagerMac::nowPlayingEligibleSession):
+ (WebCore::MediaSessionManagerMac::updateNowPlayingInfo):
+ * platform/cocoa/SoftLinking.h:
+ * platform/mac/MediaRemoteSoftLink.cpp: Added.
+ * platform/mac/MediaRemoteSoftLink.h: Added.
+ * platform/mac/RemoteCommandListenerMac.h: Added.
+ (WebCore::RemoteCommandListenerMac::createWeakPtr):
+ * platform/mac/RemoteCommandListenerMac.mm: Added.
+ (WebCore::RemoteCommandListener::create):
+ (WebCore::RemoteCommandListenerMac::RemoteCommandListenerMac):
+ (WebCore::RemoteCommandListenerMac::~RemoteCommandListenerMac):
+ * platform/spi/mac/MediaRemoteSPI.h: Added.
+
+2016-06-29 Jer Noble <[email protected]>
+
Cannot clear a MediaSource SourceBuffer in Safari 9 and WebKit nightly
https://bugs.webkit.org/show_bug.cgi?id=159230
Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (202641 => 202642)
--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2016-06-29 19:22:59 UTC (rev 202641)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2016-06-29 19:29:07 UTC (rev 202642)
@@ -319,7 +319,7 @@
07E3DFD11A9E786500764CA8 /* MediaPlaybackTarget.h in Headers */ = {isa = PBXBuildFile; fileRef = 07E3DFD01A9E786500764CA8 /* MediaPlaybackTarget.h */; settings = {ATTRIBUTES = (Private, ); }; };
07E9E12E18F5E2760011A3A4 /* InbandMetadataTextTrackPrivateAVF.h in Headers */ = {isa = PBXBuildFile; fileRef = 07E9E12D18F5E2760011A3A4 /* InbandMetadataTextTrackPrivateAVF.h */; };
07E9E13018F62B370011A3A4 /* InbandMetadataTextTrackPrivateAVF.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 07E9E12F18F62B370011A3A4 /* InbandMetadataTextTrackPrivateAVF.cpp */; };
- 07EDC3EE1AACB75D00983EB5 /* MediaSessionManagerMac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 07EDC3ED1AACB75D00983EB5 /* MediaSessionManagerMac.cpp */; };
+ 07EDC3EE1AACB75D00983EB5 /* MediaSessionManagerMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 07EDC3ED1AACB75D00983EB5 /* MediaSessionManagerMac.mm */; };
07EE76EB1BE96DB000F89133 /* MockRealtimeVideoSource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 07EE76E91BE96DB000F89133 /* MockRealtimeVideoSource.cpp */; };
07EE76EC1BE96DB000F89133 /* MockRealtimeVideoSource.h in Headers */ = {isa = PBXBuildFile; fileRef = 07EE76EA1BE96DB000F89133 /* MockRealtimeVideoSource.h */; };
07EE76EF1BEA619800F89133 /* MockRealtimeVideoSourceMac.h in Headers */ = {isa = PBXBuildFile; fileRef = 07EE76ED1BEA619800F89133 /* MockRealtimeVideoSourceMac.h */; };
@@ -6127,6 +6127,7 @@
CD641EB41818F5ED00EE4C41 /* SourceBufferPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = CD641EB21818F5ED00EE4C41 /* SourceBufferPrivate.h */; };
CD641EBF1819B36000EE4C41 /* MediaTimeAVFoundation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CD641EBD1819B35900EE4C41 /* MediaTimeAVFoundation.cpp */; };
CD641EC01819B36000EE4C41 /* MediaTimeAVFoundation.h in Headers */ = {isa = PBXBuildFile; fileRef = CD641EBE1819B35900EE4C41 /* MediaTimeAVFoundation.h */; };
+ CD669D681D23364B004D1866 /* MediaSessionManagerCocoa.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CD669D661D232DFF004D1866 /* MediaSessionManagerCocoa.cpp */; };
CD7D33431C7A123F00041293 /* PixelBufferConformerCV.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CD7D33411C7A123F00041293 /* PixelBufferConformerCV.cpp */; };
CD7D33441C7A123F00041293 /* PixelBufferConformerCV.h in Headers */ = {isa = PBXBuildFile; fileRef = CD7D33421C7A123F00041293 /* PixelBufferConformerCV.h */; };
CD7D33471C7A16BF00041293 /* CoreVideoSoftLink.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CD7D33451C7A16BF00041293 /* CoreVideoSoftLink.cpp */; };
@@ -6142,6 +6143,11 @@
CD8203111395ACE700F956C6 /* WebWindowAnimation.mm in Sources */ = {isa = PBXBuildFile; fileRef = CD82030F1395ACE700F956C6 /* WebWindowAnimation.mm */; };
CD8A7BBB197735FE00CBD643 /* AudioSourceProviderAVFObjC.mm in Sources */ = {isa = PBXBuildFile; fileRef = CD8A7BB9197735FE00CBD643 /* AudioSourceProviderAVFObjC.mm */; };
CD8A7BBC197735FE00CBD643 /* AudioSourceProviderAVFObjC.h in Headers */ = {isa = PBXBuildFile; fileRef = CD8A7BBA197735FE00CBD643 /* AudioSourceProviderAVFObjC.h */; };
+ CD8ACA881D237AA200ECC59E /* RemoteCommandListenerMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = CD8ACA861D237AA200ECC59E /* RemoteCommandListenerMac.mm */; };
+ CD8ACA891D237AA200ECC59E /* RemoteCommandListenerMac.h in Headers */ = {isa = PBXBuildFile; fileRef = CD8ACA871D237AA200ECC59E /* RemoteCommandListenerMac.h */; };
+ CD8ACA8B1D23946400ECC59E /* MediaRemoteSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = CD8ACA8A1D23946400ECC59E /* MediaRemoteSPI.h */; };
+ CD8ACA8E1D23971900ECC59E /* MediaRemoteSoftLink.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CD8ACA8C1D23971900ECC59E /* MediaRemoteSoftLink.cpp */; };
+ CD8ACA8F1D23971900ECC59E /* MediaRemoteSoftLink.h in Headers */ = {isa = PBXBuildFile; fileRef = CD8ACA8D1D23971900ECC59E /* MediaRemoteSoftLink.h */; };
CD8B5A42180D149A008B8E65 /* VideoTrackPrivateMediaSourceAVFObjC.mm in Sources */ = {isa = PBXBuildFile; fileRef = CD8B5A40180D149A008B8E65 /* VideoTrackPrivateMediaSourceAVFObjC.mm */; };
CD8B5A43180D149A008B8E65 /* VideoTrackPrivateMediaSourceAVFObjC.h in Headers */ = {isa = PBXBuildFile; fileRef = CD8B5A41180D149A008B8E65 /* VideoTrackPrivateMediaSourceAVFObjC.h */; };
CD8B5A46180DFF4E008B8E65 /* VideoTrackMediaSource.h in Headers */ = {isa = PBXBuildFile; fileRef = CD8B5A45180DFF4E008B8E65 /* VideoTrackMediaSource.h */; };
@@ -7786,7 +7792,7 @@
07E3DFD01A9E786500764CA8 /* MediaPlaybackTarget.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaPlaybackTarget.h; sourceTree = "<group>"; };
07E9E12D18F5E2760011A3A4 /* InbandMetadataTextTrackPrivateAVF.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InbandMetadataTextTrackPrivateAVF.h; sourceTree = "<group>"; };
07E9E12F18F62B370011A3A4 /* InbandMetadataTextTrackPrivateAVF.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InbandMetadataTextTrackPrivateAVF.cpp; sourceTree = "<group>"; };
- 07EDC3ED1AACB75D00983EB5 /* MediaSessionManagerMac.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MediaSessionManagerMac.cpp; sourceTree = "<group>"; };
+ 07EDC3ED1AACB75D00983EB5 /* MediaSessionManagerMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MediaSessionManagerMac.mm; sourceTree = "<group>"; };
07EE76E91BE96DB000F89133 /* MockRealtimeVideoSource.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MockRealtimeVideoSource.cpp; sourceTree = "<group>"; };
07EE76EA1BE96DB000F89133 /* MockRealtimeVideoSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MockRealtimeVideoSource.h; sourceTree = "<group>"; };
07EE76ED1BEA619800F89133 /* MockRealtimeVideoSourceMac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MockRealtimeVideoSourceMac.h; sourceTree = "<group>"; };
@@ -14185,6 +14191,8 @@
CD641EBD1819B35900EE4C41 /* MediaTimeAVFoundation.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = MediaTimeAVFoundation.cpp; sourceTree = "<group>"; };
CD641EBE1819B35900EE4C41 /* MediaTimeAVFoundation.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MediaTimeAVFoundation.h; sourceTree = "<group>"; };
CD641EC7181ED60100EE4C41 /* MediaSample.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MediaSample.h; sourceTree = "<group>"; };
+ CD669D661D232DFF004D1866 /* MediaSessionManagerCocoa.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = MediaSessionManagerCocoa.cpp; path = cocoa/MediaSessionManagerCocoa.cpp; sourceTree = "<group>"; };
+ CD669D671D232E10004D1866 /* MediaSessionManagerMac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaSessionManagerMac.h; sourceTree = "<group>"; };
CD7D33411C7A123F00041293 /* PixelBufferConformerCV.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PixelBufferConformerCV.cpp; path = ../cv/PixelBufferConformerCV.cpp; sourceTree = "<group>"; };
CD7D33421C7A123F00041293 /* PixelBufferConformerCV.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PixelBufferConformerCV.h; path = ../cv/PixelBufferConformerCV.h; sourceTree = "<group>"; };
CD7D33451C7A16BF00041293 /* CoreVideoSoftLink.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CoreVideoSoftLink.cpp; sourceTree = "<group>"; };
@@ -14201,6 +14209,11 @@
CD82030F1395ACE700F956C6 /* WebWindowAnimation.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebWindowAnimation.mm; sourceTree = "<group>"; };
CD8A7BB9197735FE00CBD643 /* AudioSourceProviderAVFObjC.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = AudioSourceProviderAVFObjC.mm; sourceTree = "<group>"; };
CD8A7BBA197735FE00CBD643 /* AudioSourceProviderAVFObjC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AudioSourceProviderAVFObjC.h; sourceTree = "<group>"; };
+ CD8ACA861D237AA200ECC59E /* RemoteCommandListenerMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RemoteCommandListenerMac.mm; sourceTree = "<group>"; };
+ CD8ACA871D237AA200ECC59E /* RemoteCommandListenerMac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RemoteCommandListenerMac.h; sourceTree = "<group>"; };
+ CD8ACA8A1D23946400ECC59E /* MediaRemoteSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaRemoteSPI.h; sourceTree = "<group>"; };
+ CD8ACA8C1D23971900ECC59E /* MediaRemoteSoftLink.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MediaRemoteSoftLink.cpp; sourceTree = "<group>"; };
+ CD8ACA8D1D23971900ECC59E /* MediaRemoteSoftLink.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaRemoteSoftLink.h; sourceTree = "<group>"; };
CD8B5A40180D149A008B8E65 /* VideoTrackPrivateMediaSourceAVFObjC.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = VideoTrackPrivateMediaSourceAVFObjC.mm; sourceTree = "<group>"; };
CD8B5A41180D149A008B8E65 /* VideoTrackPrivateMediaSourceAVFObjC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VideoTrackPrivateMediaSourceAVFObjC.h; sourceTree = "<group>"; };
CD8B5A44180DD8D6008B8E65 /* VideoTrackMediaSource.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = VideoTrackMediaSource.idl; sourceTree = "<group>"; };
@@ -18072,6 +18085,8 @@
06E81ED60AB5D5E900C87837 /* LocalCurrentGraphicsContext.h */,
06E81EEB0AB5DA9700C87837 /* LocalCurrentGraphicsContext.mm */,
1402645D0AFDC19B005919E2 /* LoggingMac.mm */,
+ CD8ACA8C1D23971900ECC59E /* MediaRemoteSoftLink.cpp */,
+ CD8ACA8D1D23971900ECC59E /* MediaRemoteSoftLink.h */,
93500F3113FDE3BE0099EC24 /* NSScrollerImpDetails.h */,
52F52E1014A0134F00ACC397 /* NSScrollerImpDetails.mm */,
4B2709810AF2E5E00065127F /* PasteboardMac.mm */,
@@ -18087,6 +18102,8 @@
4634592B1AC2271000ECB71C /* PowerObserverMac.cpp */,
46DBB64E1AB8C96F00D9A813 /* PowerObserverMac.h */,
0081FEFE16B0A2B6008AAA7A /* PublicSuffixMac.mm */,
+ CD8ACA861D237AA200ECC59E /* RemoteCommandListenerMac.mm */,
+ CD8ACA871D237AA200ECC59E /* RemoteCommandListenerMac.h */,
BCAE1FA512939DB7004CB026 /* ScrollAnimatorMac.h */,
BC51156D12B1749C00C96754 /* ScrollAnimatorMac.mm */,
BC8B853C0E7C7F1100AB6984 /* ScrollbarThemeMac.h */,
@@ -19231,6 +19248,7 @@
07F0B97B1AC5DB4600E535D9 /* AVFoundationSPI.h */,
2D59F1BE1A0044C6001F3D29 /* DataDetectorsSPI.h */,
2D413F601A187A3F0041A521 /* LookupSPI.h */,
+ CD8ACA8A1D23946400ECC59E /* MediaRemoteSPI.h */,
2D77AC261BF2B9860072470A /* NSAccessibilitySPI.h */,
2D77AC271BF2B9860072470A /* NSApplicationSPI.h */,
2DB9C4A91B3231F40070F27F /* NSEventSPI.h */,
@@ -23342,6 +23360,14 @@
name = MediaSource;
sourceTree = "<group>";
};
+ CD669D651D232DF4004D1866 /* cocoa */ = {
+ isa = PBXGroup;
+ children = (
+ CD669D661D232DFF004D1866 /* MediaSessionManagerCocoa.cpp */,
+ );
+ name = cocoa;
+ sourceTree = "<group>";
+ };
CD9A37F517C7D93600C5FA7A /* mediacontrols */ = {
isa = PBXGroup;
children = (
@@ -25042,6 +25068,7 @@
FD31604012B026A300C1A359 /* audio */ = {
isa = PBXGroup;
children = (
+ CD669D651D232DF4004D1866 /* cocoa */,
CD0EEE0D14743E48003EAFA2 /* ios */,
FD3160B012B0270700C1A359 /* mac */,
FD31604412B026F700C1A359 /* AudioArray.h */,
@@ -25144,7 +25171,8 @@
CDC734121977896C0046BFC5 /* CARingBuffer.cpp */,
CDC734131977896C0046BFC5 /* CARingBuffer.h */,
FD3160BA12B0272A00C1A359 /* FFTFrameMac.cpp */,
- 07EDC3ED1AACB75D00983EB5 /* MediaSessionManagerMac.cpp */,
+ 07EDC3ED1AACB75D00983EB5 /* MediaSessionManagerMac.mm */,
+ CD669D671D232E10004D1866 /* MediaSessionManagerMac.h */,
);
path = mac;
sourceTree = "<group>";
@@ -26460,6 +26488,7 @@
93F199E508245E59001E9ABC /* HTMLCanvasElement.h in Headers */,
A8DF3FD0097FA0FC0052981B /* HTMLCollection.h in Headers */,
977B3865122883E900B81FF8 /* HTMLConstructionSite.h in Headers */,
+ CD8ACA8F1D23971900ECC59E /* MediaRemoteSoftLink.h in Headers */,
7C3E510A18DF8F3500C112F7 /* HTMLConverter.h in Headers */,
83120C711C56F3FB001CB112 /* HTMLDataElement.h in Headers */,
F5C041DB0FFCA7CE00839D4A /* HTMLDataListElement.h in Headers */,
@@ -27078,6 +27107,7 @@
9BDA64D81B975CF2009C4387 /* JSShadowRoot.h in Headers */,
CD9DE17B17AAC75B00EA386D /* JSSourceBuffer.h in Headers */,
CD9DE17D17AAC75B00EA386D /* JSSourceBufferList.h in Headers */,
+ CD8ACA8B1D23946400ECC59E /* MediaRemoteSPI.h in Headers */,
076306E117E16089005A7C4E /* JSSourceInfo.h in Headers */,
AA7FEEAD16A4E74B004C0C33 /* JSSpeechSynthesis.h in Headers */,
AA2A5AD216A4860A00976A25 /* JSSpeechSynthesisEvent.h in Headers */,
@@ -28800,6 +28830,7 @@
CDC979F51C498C0900DB50D4 /* WebCoreNSErrorExtras.h in Headers */,
934D9BA70B8C1175007B42A9 /* WebCoreNSStringExtras.h in Headers */,
C5B4C24D1509236C00A6EF37 /* WebCoreNSURLExtras.h in Headers */,
+ CD8ACA891D237AA200ECC59E /* RemoteCommandListenerMac.h in Headers */,
CD225C0C1C46FBF400140761 /* WebCoreNSURLSession.h in Headers */,
DD05FE0D0B8BA3C6009ACDFE /* WebCoreObjCExtras.h in Headers */,
EDEC98030AED7E170059137F /* WebCorePrefix.h in Headers */,
@@ -29652,6 +29683,7 @@
BC772B3D0C4EA91E0083285F /* CSSParser.cpp in Sources */,
BC02A5400E099C5A004B6D2B /* CSSParserValues.cpp in Sources */,
977B3862122883E900B81FF8 /* CSSPreloadScanner.cpp in Sources */,
+ CD669D681D23364B004D1866 /* MediaSessionManagerCocoa.cpp in Sources */,
A80E6D050A1989CA007FB8C5 /* CSSPrimitiveValue.cpp in Sources */,
A80E6CF70A1989CA007FB8C5 /* CSSProperty.cpp in Sources */,
78D02BC5154A18DF00B62D05 /* CSSPropertyAnimation.cpp in Sources */,
@@ -31286,7 +31318,7 @@
C96F5EC61B5872260091EA9D /* MediaSessionInterruptionProviderMac.mm in Sources */,
C90F65551B2253B1002163A1 /* MediaSessionManager.cpp in Sources */,
07638A9A1884487200E15A1B /* MediaSessionManagerIOS.mm in Sources */,
- 07EDC3EE1AACB75D00983EB5 /* MediaSessionManagerMac.cpp in Sources */,
+ 07EDC3EE1AACB75D00983EB5 /* MediaSessionManagerMac.mm in Sources */,
CD3A495E17A9D01B00274E42 /* MediaSource.cpp in Sources */,
CDC8B5A6180474F70016E685 /* MediaSourcePrivateAVFObjC.mm in Sources */,
CD61FE671794AADB004101EB /* MediaSourceRegistry.cpp in Sources */,
@@ -31390,6 +31422,7 @@
1A569D130D7E2B82007C3983 /* objc_class.mm in Sources */,
1A569D160D7E2B82007C3983 /* objc_instance.mm in Sources */,
1A569D180D7E2B82007C3983 /* objc_runtime.mm in Sources */,
+ CD8ACA881D237AA200ECC59E /* RemoteCommandListenerMac.mm in Sources */,
1A569D1A0D7E2B82007C3983 /* objc_utility.mm in Sources */,
1CF6BDFB0E9BB26A0025E1CD /* ObjCEventListener.mm in Sources */,
1CF6BE140E9BB4670025E1CD /* ObjCNodeFilterCondition.mm in Sources */,
@@ -32199,6 +32232,7 @@
7AA3A699194A64E7001CBD24 /* TileController.cpp in Sources */,
1F72BF0A187FD4490009BCB3 /* TileControllerMemoryHandlerIOS.cpp in Sources */,
7AA3A6A3194B5C22001CBD24 /* TileCoverageMap.cpp in Sources */,
+ CD8ACA8E1D23971900ECC59E /* MediaRemoteSoftLink.cpp in Sources */,
7AA3A69B194A64E7001CBD24 /* TileGrid.cpp in Sources */,
498770F21242C535002226BA /* TilingData.cpp in Sources */,
F55B3DDB1251F12D003EF269 /* TimeInputType.cpp in Sources */,
Modified: trunk/Source/WebCore/platform/RemoteCommandListener.cpp (202641 => 202642)
--- trunk/Source/WebCore/platform/RemoteCommandListener.cpp 2016-06-29 19:22:59 UTC (rev 202641)
+++ trunk/Source/WebCore/platform/RemoteCommandListener.cpp 2016-06-29 19:29:07 UTC (rev 202642)
@@ -28,7 +28,7 @@
namespace WebCore {
-#if !PLATFORM(IOS)
+#if !PLATFORM(IOS) && !PLATFORM(MAC)
std::unique_ptr<RemoteCommandListener> RemoteCommandListener::create(RemoteCommandListenerClient& client)
{
return std::make_unique<RemoteCommandListener>(client);
Modified: trunk/Source/WebCore/platform/audio/PlatformMediaSessionManager.cpp (202641 => 202642)
--- trunk/Source/WebCore/platform/audio/PlatformMediaSessionManager.cpp 2016-06-29 19:22:59 UTC (rev 202641)
+++ trunk/Source/WebCore/platform/audio/PlatformMediaSessionManager.cpp 2016-06-29 19:29:07 UTC (rev 202642)
@@ -36,7 +36,7 @@
namespace WebCore {
-#if !PLATFORM(IOS)
+#if !PLATFORM(IOS) && !PLATFORM(MAC)
static PlatformMediaSessionManager* platformMediaSessionManager = nullptr;
PlatformMediaSessionManager& PlatformMediaSessionManager::sharedManager()
Copied: trunk/Source/WebCore/platform/audio/cocoa/MediaSessionManagerCocoa.cpp (from rev 202641, trunk/Source/WebCore/platform/audio/mac/MediaSessionManagerMac.cpp) (0 => 202642)
--- trunk/Source/WebCore/platform/audio/cocoa/MediaSessionManagerCocoa.cpp (rev 0)
+++ trunk/Source/WebCore/platform/audio/cocoa/MediaSessionManagerCocoa.cpp 2016-06-29 19:29:07 UTC (rev 202642)
@@ -0,0 +1,73 @@
+/*
+ * Copyright (C) 2013-2014 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "PlatformMediaSessionManager.h"
+
+#if USE(AUDIO_SESSION)
+
+#include "AudioSession.h"
+#include "Logging.h"
+#include "Settings.h"
+
+using namespace WebCore;
+
+static const size_t kWebAudioBufferSize = 128;
+static const size_t kLowPowerVideoBufferSize = 4096;
+
+void PlatformMediaSessionManager::updateSessionState()
+{
+ LOG(Media, "PlatformMediaSessionManager::updateSessionState() - types: Video(%d), Audio(%d), WebAudio(%d)", count(PlatformMediaSession::Video), count(PlatformMediaSession::Audio), count(PlatformMediaSession::WebAudio));
+
+ if (has(PlatformMediaSession::WebAudio))
+ AudioSession::sharedSession().setPreferredBufferSize(kWebAudioBufferSize);
+ else if ((has(PlatformMediaSession::Video) || has(PlatformMediaSession::Audio)) && Settings::lowPowerVideoAudioBufferSizeEnabled()) {
+ // FIXME: <http://webkit.org/b/116725> Figure out why enabling the code below
+ // causes media LayoutTests to fail on 10.8.
+
+ size_t bufferSize;
+ if (m_audioHardwareListener && m_audioHardwareListener->outputDeviceSupportsLowPowerMode())
+ bufferSize = kLowPowerVideoBufferSize;
+ else
+ bufferSize = kWebAudioBufferSize;
+
+ AudioSession::sharedSession().setPreferredBufferSize(bufferSize);
+ }
+
+#if PLATFORM(IOS)
+ if (!Settings::shouldManageAudioSessionCategory())
+ return;
+
+ if (has(PlatformMediaSession::Video) || has(PlatformMediaSession::Audio)) {
+ if (canProduceAudio())
+ AudioSession::sharedSession().setCategory(AudioSession::MediaPlayback);
+ else
+ AudioSession::sharedSession().setCategory(AudioSession::AmbientSound);
+ } else if (has(PlatformMediaSession::WebAudio))
+ AudioSession::sharedSession().setCategory(AudioSession::AmbientSound);
+#endif
+}
+
+#endif // USE(AUDIO_SESSION)
Deleted: trunk/Source/WebCore/platform/audio/mac/MediaSessionManagerMac.cpp (202641 => 202642)
--- trunk/Source/WebCore/platform/audio/mac/MediaSessionManagerMac.cpp 2016-06-29 19:22:59 UTC (rev 202641)
+++ trunk/Source/WebCore/platform/audio/mac/MediaSessionManagerMac.cpp 2016-06-29 19:29:07 UTC (rev 202642)
@@ -1,74 +0,0 @@
-/*
- * Copyright (C) 2013-2014 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "PlatformMediaSessionManager.h"
-
-#if USE(AUDIO_SESSION)
-
-#include "AudioSession.h"
-#include "Logging.h"
-#include "Settings.h"
-
-using namespace WebCore;
-
-static const size_t kWebAudioBufferSize = 128;
-static const size_t kLowPowerVideoBufferSize = 4096;
-
-void PlatformMediaSessionManager::updateSessionState()
-{
- LOG(Media, "PlatformMediaSessionManager::updateSessionState() - types: Video(%d), Audio(%d), WebAudio(%d)", count(PlatformMediaSession::Video), count(PlatformMediaSession::Audio), count(PlatformMediaSession::WebAudio));
-
- if (has(PlatformMediaSession::WebAudio))
- AudioSession::sharedSession().setPreferredBufferSize(kWebAudioBufferSize);
- else if ((has(PlatformMediaSession::Video) || has(PlatformMediaSession::Audio)) && Settings::lowPowerVideoAudioBufferSizeEnabled()) {
- // FIXME: <http://webkit.org/b/116725> Figure out why enabling the code below
- // causes media LayoutTests to fail on 10.8.
-
- size_t bufferSize;
- if (m_audioHardwareListener && m_audioHardwareListener->outputDeviceSupportsLowPowerMode())
- bufferSize = kLowPowerVideoBufferSize;
- else
- bufferSize = kWebAudioBufferSize;
-
- AudioSession::sharedSession().setPreferredBufferSize(bufferSize);
- }
-
-#if PLATFORM(IOS)
- if (!Settings::shouldManageAudioSessionCategory())
- return;
-
- if (has(PlatformMediaSession::Video) || has(PlatformMediaSession::Audio)) {
- if (canProduceAudio())
- AudioSession::sharedSession().setCategory(AudioSession::MediaPlayback);
- else
- AudioSession::sharedSession().setCategory(AudioSession::AmbientSound);
- }
- else if (has(PlatformMediaSession::WebAudio))
- AudioSession::sharedSession().setCategory(AudioSession::AmbientSound);
-#endif
-}
-
-#endif // USE(AUDIO_SESSION)
Added: trunk/Source/WebCore/platform/audio/mac/MediaSessionManagerMac.h (0 => 202642)
--- trunk/Source/WebCore/platform/audio/mac/MediaSessionManagerMac.h (rev 0)
+++ trunk/Source/WebCore/platform/audio/mac/MediaSessionManagerMac.h 2016-06-29 19:29:07 UTC (rev 202642)
@@ -0,0 +1,63 @@
+/*
+ * Copyright (C) 2016 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#if PLATFORM(MAC)
+
+#include "PlatformMediaSessionManager.h"
+#include <wtf/RetainPtr.h>
+
+namespace WebCore {
+
+class MediaSessionManagerMac : public PlatformMediaSessionManager {
+public:
+ virtual ~MediaSessionManagerMac();
+
+private:
+ friend class PlatformMediaSessionManager;
+
+ MediaSessionManagerMac();
+
+ void removeSession(PlatformMediaSession&) override;
+
+ bool sessionWillBeginPlayback(PlatformMediaSession&) override;
+ void sessionWillEndPlayback(PlatformMediaSession&) override;
+ void clientCharacteristicsChanged(PlatformMediaSession&) override;
+
+ void updateNowPlayingInfo();
+
+ PlatformMediaSession* nowPlayingEligibleSession();
+
+ double m_reportedRate { 0 };
+ double m_reportedDuration { 0 };
+ String m_reportedTitle;
+ bool m_nowPlayingActive { false };
+ bool m_isInBackground { false };
+};
+
+} // namespace WebCore
+
+#endif // PLATFORM(MAC)
Added: trunk/Source/WebCore/platform/audio/mac/MediaSessionManagerMac.mm (0 => 202642)
--- trunk/Source/WebCore/platform/audio/mac/MediaSessionManagerMac.mm (rev 0)
+++ trunk/Source/WebCore/platform/audio/mac/MediaSessionManagerMac.mm 2016-06-29 19:29:07 UTC (rev 202642)
@@ -0,0 +1,181 @@
+/*
+ * Copyright (C) 2016 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import "config.h"
+#import "MediaSessionManagerMac.h"
+
+#if PLATFORM(MAC)
+
+#import "Logging.h"
+#import "MediaPlayer.h"
+#import "PlatformMediaSession.h"
+
+#import "MediaRemoteSoftLink.h"
+
+using namespace WebCore;
+
+namespace WebCore {
+
+static MediaSessionManagerMac* platformMediaSessionManager = nullptr;
+
+PlatformMediaSessionManager& PlatformMediaSessionManager::sharedManager()
+{
+ if (!platformMediaSessionManager)
+ platformMediaSessionManager = new MediaSessionManagerMac;
+ return *platformMediaSessionManager;
+}
+
+PlatformMediaSessionManager* PlatformMediaSessionManager::sharedManagerIfExists()
+{
+ return platformMediaSessionManager;
+}
+
+MediaSessionManagerMac::MediaSessionManagerMac()
+ : PlatformMediaSessionManager()
+{
+ resetRestrictions();
+}
+
+MediaSessionManagerMac::~MediaSessionManagerMac()
+{
+}
+
+bool MediaSessionManagerMac::sessionWillBeginPlayback(PlatformMediaSession& session)
+{
+ if (!PlatformMediaSessionManager::sessionWillBeginPlayback(session))
+ return false;
+
+ LOG(Media, "MediaSessionManagerMac::sessionWillBeginPlayback");
+ updateNowPlayingInfo();
+ return true;
+}
+
+void MediaSessionManagerMac::removeSession(PlatformMediaSession& session)
+{
+ PlatformMediaSessionManager::removeSession(session);
+ LOG(Media, "MediaSessionManagerMac::removeSession");
+ updateNowPlayingInfo();
+}
+
+void MediaSessionManagerMac::sessionWillEndPlayback(PlatformMediaSession& session)
+{
+ PlatformMediaSessionManager::sessionWillEndPlayback(session);
+ LOG(Media, "MediaSessionManagerMac::sessionWillEndPlayback");
+ updateNowPlayingInfo();
+}
+
+void MediaSessionManagerMac::clientCharacteristicsChanged(PlatformMediaSession&)
+{
+ LOG(Media, "MediaSessionManagerMac::clientCharacteristicsChanged");
+ updateNowPlayingInfo();
+}
+
+PlatformMediaSession* MediaSessionManagerMac::nowPlayingEligibleSession()
+{
+ for (auto session : sessions()) {
+ PlatformMediaSession::MediaType type = session->mediaType();
+ if (type != PlatformMediaSession::Video && type != PlatformMediaSession::Audio)
+ continue;
+
+ if (session->characteristics() & PlatformMediaSession::HasAudio)
+ return session;
+ }
+
+ return nullptr;
+}
+
+void MediaSessionManagerMac::updateNowPlayingInfo()
+{
+#if USE(MEDIAREMOTE)
+ if (!isMediaRemoteFrameworkAvailable())
+ return;
+
+ if (!MRMediaRemoteSetCanBeNowPlayingApplication(true)) {
+ LOG(Media, "MediaSessionManagerMac::updateNowPlayingInfo - MRMediaRemoteSetCanBeNowPlayingApplication(true) failed");
+ return;
+ }
+
+ const PlatformMediaSession* currentSession = this->nowPlayingEligibleSession();
+
+ LOG(Media, "MediaSessionManagerMac::updateNowPlayingInfo - currentSession = %p", currentSession);
+
+ if (!currentSession) {
+ if (m_nowPlayingActive) {
+ LOG(Media, "MediaSessionManagerMac::updateNowPlayingInfo - clearing now playing info");
+ MRMediaRemoteSetNowPlayingInfo(nullptr);
+ m_nowPlayingActive = false;
+ MRMediaRemoteSetNowPlayingApplicationPlaybackStateForOrigin(MRMediaRemoteGetLocalOrigin(), kMRPlaybackStateStopped, dispatch_get_main_queue(), ^(MRMediaRemoteError error) {
+ LOG(Media, "MediaSessionManagerMac::updateNowPlayingInfo - MRMediaRemoteSetNowPlayingApplicationPlaybackStateForOrigin(stopped) failed with error %ud", error);
+ });
+ }
+
+ return;
+ }
+
+ String title = currentSession->title();
+ double duration = currentSession->duration();
+ double rate = currentSession->state() == PlatformMediaSession::Playing ? 1 : 0;
+ if (m_reportedTitle == title && m_reportedRate == rate && m_reportedDuration == duration) {
+ LOG(Media, "MediaSessionManagerMac::updateNowPlayingInfo - nothing new to show");
+ return;
+ }
+
+ m_reportedRate = rate;
+ m_reportedDuration = duration;
+ m_reportedTitle = title;
+
+ auto info = adoptCF(CFDictionaryCreateMutable(kCFAllocatorDefault, 4, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks));
+
+ if (!title.isEmpty())
+ CFDictionarySetValue(info.get(), kMRMediaRemoteNowPlayingInfoTitle, title.createCFString().get());
+
+ if (std::isfinite(duration) && duration != MediaPlayer::invalidTime()) {
+ auto cfDuration = adoptCF(CFNumberCreate(kCFAllocatorDefault, kCFNumberDoubleType, &duration));
+ CFDictionarySetValue(info.get(), kMRMediaRemoteNowPlayingInfoDuration, cfDuration.get());
+ }
+
+ auto cfRate = CFNumberCreate(kCFAllocatorDefault, kCFNumberDoubleType, &rate);
+ CFDictionarySetValue(info.get(), kMRMediaRemoteNowPlayingInfoPlaybackRate, cfRate);
+
+ double currentTime = currentSession->currentTime();
+ if (std::isfinite(currentTime) && currentTime != MediaPlayer::invalidTime()) {
+ auto cfCurrentTime = adoptCF(CFNumberCreate(kCFAllocatorDefault, kCFNumberDoubleType, ¤tTime));
+ CFDictionarySetValue(info.get(), kMRMediaRemoteNowPlayingInfoElapsedTime, cfCurrentTime.get());
+ }
+
+ LOG(Media, "MediaSessionManagerMac::updateNowPlayingInfo - title = \"%s\", rate = %f, duration = %f, now = %f",
+ title.utf8().data(), rate, duration, currentTime);
+
+ m_nowPlayingActive = true;
+ MRMediaRemoteSetNowPlayingApplicationPlaybackStateForOrigin(MRMediaRemoteGetLocalOrigin(), kMRPlaybackStatePlaying, dispatch_get_main_queue(), ^(MRMediaRemoteError error) {
+ LOG(Media, "MediaSessionManagerMac::updateNowPlayingInfo - MRMediaRemoteSetNowPlayingApplicationPlaybackStateForOrigin(playing) failed with error %ud", error);
+ });
+ MRMediaRemoteSetNowPlayingInfo(info.get());
+#endif
+}
+
+} // namespace WebCore
+
+#endif // PLATFORM(MAC)
Modified: trunk/Source/WebCore/platform/cocoa/SoftLinking.h (202641 => 202642)
--- trunk/Source/WebCore/platform/cocoa/SoftLinking.h 2016-06-29 19:22:59 UTC (rev 202641)
+++ trunk/Source/WebCore/platform/cocoa/SoftLinking.h 2016-06-29 19:29:07 UTC (rev 202642)
@@ -325,6 +325,22 @@
} \
}
+#define SOFT_LINK_PRIVATE_FRAMEWORK_FOR_SOURCE(functionNamespace, framework) \
+ namespace functionNamespace { \
+ void* framework##Library(bool isOptional = false); \
+ void* framework##Library(bool isOptional) \
+ { \
+ static void* frameworkLibrary; \
+ static dispatch_once_t once; \
+ dispatch_once(&once, ^{ \
+ frameworkLibrary = dlopen("/System/Library/PrivateFrameworks/" #framework ".framework/" #framework, RTLD_NOW); \
+ if (!isOptional) \
+ RELEASE_ASSERT_WITH_MESSAGE(frameworkLibrary, "%s", dlerror()); \
+ }); \
+ return frameworkLibrary; \
+ } \
+ }
+
#define SOFT_LINK_CLASS_FOR_HEADER(functionNamespace, framework, className) \
@class className; \
namespace functionNamespace { \
Added: trunk/Source/WebCore/platform/mac/MediaRemoteSoftLink.cpp (0 => 202642)
--- trunk/Source/WebCore/platform/mac/MediaRemoteSoftLink.cpp (rev 0)
+++ trunk/Source/WebCore/platform/mac/MediaRemoteSoftLink.cpp 2016-06-29 19:29:07 UTC (rev 202642)
@@ -0,0 +1,50 @@
+/*
+ * Copyright (C) 2016 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+
+#if USE(MEDIAREMOTE)
+
+#include "MediaRemoteSPI.h"
+#include "SoftLinking.h"
+
+SOFT_LINK_PRIVATE_FRAMEWORK_FOR_SOURCE(WebCore, MediaRemote)
+SOFT_LINK_FUNCTION_FOR_SOURCE(WebCore, MediaRemote, MRMediaRemoteGetLocalOrigin, MROriginRef, (), ())
+SOFT_LINK_FUNCTION_FOR_SOURCE(WebCore, MediaRemote, MRMediaRemoteAddAsyncCommandHandlerBlock, void*, (MRMediaRemoteAsyncCommandHandlerBlock block), (block))
+SOFT_LINK_FUNCTION_FOR_SOURCE(WebCore, MediaRemote, MRMediaRemoteRemoveCommandHandlerBlock, void, (void* observer), (observer))
+SOFT_LINK_FUNCTION_FOR_SOURCE(WebCore, MediaRemote, MRMediaRemoteSetSupportedCommands, void, (CFArrayRef commands, MROriginRef origin, dispatch_queue_t replyQ, void(^completion)(MRMediaRemoteError err)), (commands, origin, replyQ, completion))
+SOFT_LINK_FUNCTION_FOR_SOURCE(WebCore, MediaRemote, MRMediaRemoteCommandInfoCreate, MRMediaRemoteCommandInfoRef, (CFAllocatorRef allocator), (allocator));
+SOFT_LINK_FUNCTION_FOR_SOURCE(WebCore, MediaRemote, MRMediaRemoteCommandInfoSetCommand, void, (MRMediaRemoteCommandInfoRef commandInfo, MRMediaRemoteCommand command), (commandInfo, command))
+SOFT_LINK_FUNCTION_FOR_SOURCE(WebCore, MediaRemote, MRMediaRemoteCommandInfoSetEnabled, void, (MRMediaRemoteCommandInfoRef commandInfo, Boolean enabled), (commandInfo, enabled))
+SOFT_LINK_FUNCTION_FOR_SOURCE(WebCore, MediaRemote, MRMediaRemoteCommandInfoSetOptions, void, (MRMediaRemoteCommandInfoRef commandInfo, CFDictionaryRef options), (commandInfo, options))
+SOFT_LINK_FUNCTION_FOR_SOURCE(WebCore, MediaRemote, MRMediaRemoteSetCanBeNowPlayingApplication, Boolean, (Boolean flag), (flag))
+SOFT_LINK_FUNCTION_FOR_SOURCE(WebCore, MediaRemote, MRMediaRemoteSetNowPlayingInfo, void, (CFDictionaryRef info), (info))
+SOFT_LINK_FUNCTION_FOR_SOURCE(WebCore, MediaRemote, MRMediaRemoteSetNowPlayingApplicationPlaybackStateForOrigin, void, (MROriginRef origin, MRPlaybackState playbackState, dispatch_queue_t replyQ, void(^completion)(MRMediaRemoteError)), (origin, playbackState, replyQ, completion))
+SOFT_LINK_CONSTANT_FOR_SOURCE(WebCore, MediaRemote, kMRMediaRemoteNowPlayingInfoTitle, CFStringRef);
+SOFT_LINK_CONSTANT_FOR_SOURCE(WebCore, MediaRemote, kMRMediaRemoteNowPlayingInfoDuration, CFStringRef);
+SOFT_LINK_CONSTANT_FOR_SOURCE(WebCore, MediaRemote, kMRMediaRemoteNowPlayingInfoElapsedTime, CFStringRef);
+SOFT_LINK_CONSTANT_FOR_SOURCE(WebCore, MediaRemote, kMRMediaRemoteNowPlayingInfoPlaybackRate, CFStringRef);
+
+#endif // USE(MEDIAREMOTE)
Added: trunk/Source/WebCore/platform/mac/MediaRemoteSoftLink.h (0 => 202642)
--- trunk/Source/WebCore/platform/mac/MediaRemoteSoftLink.h (rev 0)
+++ trunk/Source/WebCore/platform/mac/MediaRemoteSoftLink.h 2016-06-29 19:29:07 UTC (rev 202642)
@@ -0,0 +1,65 @@
+/*
+ * Copyright (C) 2016 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#if USE(MEDIAREMOTE)
+
+#include "MediaRemoteSPI.h"
+#include "SoftLinking.h"
+
+SOFT_LINK_FRAMEWORK_FOR_HEADER(WebCore, MediaRemote)
+SOFT_LINK_FUNCTION_FOR_HEADER(WebCore, MediaRemote, MRMediaRemoteGetLocalOrigin, MROriginRef, (), ())
+#define MRMediaRemoteGetLocalOrigin softLink_MediaRemote_MRMediaRemoteGetLocalOrigin
+SOFT_LINK_FUNCTION_FOR_HEADER(WebCore, MediaRemote, MRMediaRemoteAddAsyncCommandHandlerBlock, void*, (MRMediaRemoteAsyncCommandHandlerBlock block), (block))
+#define MRMediaRemoteAddAsyncCommandHandlerBlock softLink_MediaRemote_MRMediaRemoteAddAsyncCommandHandlerBlock
+SOFT_LINK_FUNCTION_FOR_HEADER(WebCore, MediaRemote, MRMediaRemoteRemoveCommandHandlerBlock, void, (void* observer), (observer))
+#define MRMediaRemoteRemoveCommandHandlerBlock softLink_MediaRemote_MRMediaRemoteRemoveCommandHandlerBlock
+SOFT_LINK_FUNCTION_FOR_HEADER(WebCore, MediaRemote, MRMediaRemoteSetSupportedCommands, void, (CFArrayRef commands, MROriginRef origin, dispatch_queue_t replyQ, void(^completion)(MRMediaRemoteError err)), (commands, origin, replyQ, completion))
+#define MRMediaRemoteSetSupportedCommands softLink_MediaRemote_MRMediaRemoteSetSupportedCommands
+SOFT_LINK_FUNCTION_FOR_HEADER(WebCore, MediaRemote, MRMediaRemoteCommandInfoCreate, MRMediaRemoteCommandInfoRef, (CFAllocatorRef allocator), (allocator));
+#define MRMediaRemoteCommandInfoCreate softLink_MediaRemote_MRMediaRemoteCommandInfoCreate
+SOFT_LINK_FUNCTION_FOR_HEADER(WebCore, MediaRemote, MRMediaRemoteCommandInfoSetCommand, void, (MRMediaRemoteCommandInfoRef commandInfo, MRMediaRemoteCommand command), (commandInfo, command))
+#define MRMediaRemoteCommandInfoSetCommand softLink_MediaRemote_MRMediaRemoteCommandInfoSetCommand
+SOFT_LINK_FUNCTION_FOR_HEADER(WebCore, MediaRemote, MRMediaRemoteCommandInfoSetEnabled, void, (MRMediaRemoteCommandInfoRef commandInfo, Boolean enabled), (commandInfo, enabled))
+#define MRMediaRemoteCommandInfoSetEnabled softLink_MediaRemote_MRMediaRemoteCommandInfoSetEnabled
+SOFT_LINK_FUNCTION_FOR_HEADER(WebCore, MediaRemote, MRMediaRemoteCommandInfoSetOptions, void, (MRMediaRemoteCommandInfoRef commandInfo, CFDictionaryRef options), (commandInfo, options))
+#define MRMediaRemoteCommandInfoSetOptions softLink_MediaRemote_MRMediaRemoteCommandInfoSetOptions
+SOFT_LINK_FUNCTION_FOR_HEADER(WebCore, MediaRemote, MRMediaRemoteSetCanBeNowPlayingApplication, Boolean, (Boolean flag), (flag))
+#define MRMediaRemoteSetCanBeNowPlayingApplication softLink_MediaRemote_MRMediaRemoteSetCanBeNowPlayingApplication
+SOFT_LINK_FUNCTION_FOR_HEADER(WebCore, MediaRemote, MRMediaRemoteSetNowPlayingInfo, void, (CFDictionaryRef info), (info))
+#define MRMediaRemoteSetNowPlayingInfo softLink_MediaRemote_MRMediaRemoteSetNowPlayingInfo
+SOFT_LINK_FUNCTION_FOR_HEADER(WebCore, MediaRemote, MRMediaRemoteSetNowPlayingApplicationPlaybackStateForOrigin, void, (MROriginRef origin, MRPlaybackState playbackState, dispatch_queue_t replyQ, void(^completion)(MRMediaRemoteError)), (origin, playbackState, replyQ, completion))
+#define MRMediaRemoteSetNowPlayingApplicationPlaybackStateForOrigin softLink_MediaRemote_MRMediaRemoteSetNowPlayingApplicationPlaybackStateForOrigin
+SOFT_LINK_CONSTANT_FOR_HEADER(WebCore, MediaRemote, kMRMediaRemoteNowPlayingInfoTitle, CFStringRef);
+#define kMRMediaRemoteNowPlayingInfoTitle get_MediaRemote_kMRMediaRemoteNowPlayingInfoTitle()
+SOFT_LINK_CONSTANT_FOR_HEADER(WebCore, MediaRemote, kMRMediaRemoteNowPlayingInfoDuration, CFStringRef);
+#define kMRMediaRemoteNowPlayingInfoDuration get_MediaRemote_kMRMediaRemoteNowPlayingInfoDuration()
+SOFT_LINK_CONSTANT_FOR_HEADER(WebCore, MediaRemote, kMRMediaRemoteNowPlayingInfoElapsedTime, CFStringRef);
+#define kMRMediaRemoteNowPlayingInfoElapsedTime get_MediaRemote_kMRMediaRemoteNowPlayingInfoElapsedTime()
+SOFT_LINK_CONSTANT_FOR_HEADER(WebCore, MediaRemote, kMRMediaRemoteNowPlayingInfoPlaybackRate, CFStringRef);
+#define kMRMediaRemoteNowPlayingInfoPlaybackRate get_MediaRemote_kMRMediaRemoteNowPlayingInfoPlaybackRate()
+
+#endif // USE(MEDIAREMOTE)
Added: trunk/Source/WebCore/platform/mac/RemoteCommandListenerMac.h (0 => 202642)
--- trunk/Source/WebCore/platform/mac/RemoteCommandListenerMac.h (rev 0)
+++ trunk/Source/WebCore/platform/mac/RemoteCommandListenerMac.h 2016-06-29 19:29:07 UTC (rev 202642)
@@ -0,0 +1,51 @@
+/*
+ * Copyright (C) 2016 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#include "RemoteCommandListener.h"
+
+#if PLATFORM(MAC)
+
+#include <wtf/RetainPtr.h>
+#include <wtf/WeakPtr.h>
+
+namespace WebCore {
+
+class RemoteCommandListenerMac : public RemoteCommandListener {
+public:
+ RemoteCommandListenerMac(RemoteCommandListenerClient&);
+ virtual ~RemoteCommandListenerMac();
+
+protected:
+ WeakPtr<RemoteCommandListenerMac> createWeakPtr() { return m_weakPtrFactory.createWeakPtr(); }
+
+ WeakPtrFactory<RemoteCommandListenerMac> m_weakPtrFactory { this };
+ void* m_commandHandler { nullptr };
+};
+
+}
+
+#endif // PLATFORM(MAC)
Added: trunk/Source/WebCore/platform/mac/RemoteCommandListenerMac.mm (0 => 202642)
--- trunk/Source/WebCore/platform/mac/RemoteCommandListenerMac.mm (rev 0)
+++ trunk/Source/WebCore/platform/mac/RemoteCommandListenerMac.mm 2016-06-29 19:29:07 UTC (rev 202642)
@@ -0,0 +1,121 @@
+/*
+ * Copyright (C) 2016 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "RemoteCommandListenerMac.h"
+
+#if PLATFORM(MAC)
+
+#import "Logging.h"
+#import <wtf/MainThread.h>
+
+#import "MediaRemoteSoftLink.h"
+
+namespace WebCore {
+
+std::unique_ptr<RemoteCommandListener> RemoteCommandListener::create(RemoteCommandListenerClient& client)
+{
+ return std::make_unique<RemoteCommandListenerMac>(client);
+}
+
+RemoteCommandListenerMac::RemoteCommandListenerMac(RemoteCommandListenerClient& client)
+ : RemoteCommandListener(client)
+{
+#if USE(MEDIAREMOTE)
+ if (!isMediaRemoteFrameworkAvailable())
+ return;
+
+ static const MRMediaRemoteCommand supportedCommands[] = {
+ MRMediaRemoteCommandPlay,
+ MRMediaRemoteCommandPause,
+ MRMediaRemoteCommandTogglePlayPause,
+ MRMediaRemoteCommandBeginFastForward,
+ MRMediaRemoteCommandEndFastForward,
+ MRMediaRemoteCommandBeginRewind,
+ MRMediaRemoteCommandEndRewind,
+ };
+
+ auto commandInfoArray = adoptCF(CFArrayCreateMutable(kCFAllocatorDefault, sizeof(supportedCommands) / sizeof(MRMediaRemoteCommand), &kCFTypeArrayCallBacks));
+
+ for (auto command : supportedCommands) {
+ auto commandInfo = adoptCF(MRMediaRemoteCommandInfoCreate(kCFAllocatorDefault));
+ MRMediaRemoteCommandInfoSetCommand(commandInfo.get(), command);
+ MRMediaRemoteCommandInfoSetEnabled(commandInfo.get(), true);
+ CFArrayAppendValue(commandInfoArray.get(), commandInfo.get());
+ }
+
+ MRMediaRemoteSetSupportedCommands(commandInfoArray.get(), MRMediaRemoteGetLocalOrigin(), nullptr, nullptr);
+
+ auto weakThis = createWeakPtr();
+ m_commandHandler = MRMediaRemoteAddAsyncCommandHandlerBlock(^(MRMediaRemoteCommand command, CFDictionaryRef options, void(^completion)(CFArrayRef)) {
+ UNUSED_PARAM(options);
+
+ PlatformMediaSession::RemoteControlCommandType platformCommand { PlatformMediaSession::NoCommand };
+
+ switch (command) {
+ case MRMediaRemoteCommandPlay:
+ platformCommand = PlatformMediaSession::PlayCommand;
+ break;
+ case MRMediaRemoteCommandPause:
+ platformCommand = PlatformMediaSession::PauseCommand;
+ break;
+ case MRMediaRemoteCommandTogglePlayPause:
+ platformCommand = PlatformMediaSession::TogglePlayPauseCommand;
+ break;
+ case MRMediaRemoteCommandBeginFastForward:
+ platformCommand = PlatformMediaSession::BeginSeekingForwardCommand;
+ break;
+ case MRMediaRemoteCommandEndFastForward:
+ platformCommand = PlatformMediaSession::EndSeekingForwardCommand;
+ break;
+ case MRMediaRemoteCommandBeginRewind:
+ platformCommand = PlatformMediaSession::BeginSeekingBackwardCommand;
+ break;
+ case MRMediaRemoteCommandEndRewind:
+ platformCommand = PlatformMediaSession::EndSeekingBackwardCommand;
+ break;
+ default:
+ ASSERT_NOT_REACHED();
+ };
+
+ if (!weakThis)
+ return;
+ weakThis->m_client.didReceiveRemoteControlCommand(platformCommand);
+ completion(static_cast<CFArrayRef>(@[@0]));
+ });
+#endif // USE(MEDIAREMOTE)
+}
+
+RemoteCommandListenerMac::~RemoteCommandListenerMac()
+{
+#if USE(MEDIAREMOTE)
+ if (m_commandHandler)
+ MRMediaRemoteRemoveCommandHandlerBlock(m_commandHandler);
+#endif
+}
+
+}
+
+#endif
Added: trunk/Source/WebCore/platform/spi/mac/MediaRemoteSPI.h (0 => 202642)
--- trunk/Source/WebCore/platform/spi/mac/MediaRemoteSPI.h (rev 0)
+++ trunk/Source/WebCore/platform/spi/mac/MediaRemoteSPI.h 2016-06-29 19:29:07 UTC (rev 202642)
@@ -0,0 +1,112 @@
+/*
+ * Copyright (C) 2016 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#if USE(MEDIAREMOTE)
+
+#if USE(APPLE_INTERNAL_SDK)
+
+#include <MediaRemote/MediaRemote.h>
+
+#else
+
+enum {
+ MRMediaRemoteCommandPlay,
+ MRMediaRemoteCommandPause,
+ MRMediaRemoteCommandTogglePlayPause,
+ MRMediaRemoteCommandStop,
+ MRMediaRemoteCommandNextTrack,
+ MRMediaRemoteCommandPreviousTrack,
+ MRMediaRemoteCommandAdvanceShuffleMode,
+ MRMediaRemoteCommandAdvanceRepeatMode,
+ MRMediaRemoteCommandBeginFastForward,
+ MRMediaRemoteCommandEndFastForward,
+ MRMediaRemoteCommandBeginRewind,
+ MRMediaRemoteCommandEndRewind,
+ MRMediaRemoteCommandRewind15Seconds,
+ MRMediaRemoteCommandFastForward15Seconds,
+ MRMediaRemoteCommandRewind30Seconds,
+ MRMediaRemoteCommandFastForward30Seconds,
+ MRMediaRemoteCommandToggleRecord,
+ MRMediaRemoteCommandSkipForward,
+ MRMediaRemoteCommandSkipBackward,
+ MRMediaRemoteCommandChangePlaybackRate,
+ MRMediaRemoteCommandRateTrack,
+ MRMediaRemoteCommandLikeTrack,
+ MRMediaRemoteCommandDislikeTrack,
+ MRMediaRemoteCommandBookmarkTrack,
+ MRMediaRemoteCommandSeekToPlaybackPosition,
+ MRMediaRemoteCommandChangeRepeatMode,
+ MRMediaRemoteCommandChangeShuffleMode,
+ MRMediaRemoteCommandEnableLanguageOption,
+ MRMediaRemoteCommandDisableLanguageOption
+};
+typedef uint32_t MRMediaRemoteCommand;
+
+enum {
+ kMRPlaybackStateUnknown = 0,
+ kMRPlaybackStatePlaying,
+ kMRPlaybackStatePaused,
+ kMRPlaybackStateStopped,
+ kMRPlaybackStateInterrupted
+};
+typedef uint32_t MRPlaybackState;
+
+typedef uint32_t MRMediaRemoteError;
+typedef struct _MROrigin *MROriginRef;
+typedef struct _MRMediaRemoteCommandInfo *MRMediaRemoteCommandInfoRef;
+typedef void(^MRMediaRemoteAsyncCommandHandlerBlock)(MRMediaRemoteCommand command, CFDictionaryRef options, void(^completion)(CFArrayRef));
+
+WTF_EXTERN_C_BEGIN
+
+#pragma mark - MRRemoteControl
+
+void* MRMediaRemoteAddAsyncCommandHandlerBlock(MRMediaRemoteAsyncCommandHandlerBlock);
+void MRMediaRemoteRemoveCommandHandlerBlock(void *observer);
+void MRMediaRemoteSetSupportedCommands(CFArrayRef commands, MROriginRef, dispatch_queue_t replyQ, void(^completion)(MRMediaRemoteError err));
+
+#pragma mark - MROrigin
+
+MROriginRef MRMediaRemoteGetLocalOrigin();
+
+#pragma mark - MRCommandInfo
+
+MRMediaRemoteCommandInfoRef MRMediaRemoteCommandInfoCreate(CFAllocatorRef);
+void MRMediaRemoteCommandInfoSetCommand(MRMediaRemoteCommandInfoRef, MRMediaRemoteCommand);
+void MRMediaRemoteCommandInfoSetEnabled(MRMediaRemoteCommandInfoRef, Boolean);
+void MRMediaRemoteCommandInfoSetOptions(MRMediaRemoteCommandInfoRef, CFDictionaryRef);
+
+#pragma mark - MRNowPlaying
+
+Boolean MRMediaRemoteSetCanBeNowPlayingApplication(Boolean);
+void MRMediaRemoteSetNowPlayingApplicationPlaybackStateForOrigin(MROriginRef, MRPlaybackState, dispatch_queue_t replyQ, void(^completion)(MRMediaRemoteError));
+void MRMediaRemoteSetNowPlayingInfo(CFDictionaryRef);
+
+WTF_EXTERN_C_END
+
+#endif // USE(APPLE_INTERNAL_SDK)
+
+#endif // USE(MEDIAREMOTE)
Modified: trunk/Source/WebKit2/ChangeLog (202641 => 202642)
--- trunk/Source/WebKit2/ChangeLog 2016-06-29 19:22:59 UTC (rev 202641)
+++ trunk/Source/WebKit2/ChangeLog 2016-06-29 19:29:07 UTC (rev 202642)
@@ -1,3 +1,14 @@
+2016-06-29 Jer Noble <[email protected]>
+
+ Adopt MediaRemote.
+ https://bugs.webkit.org/show_bug.cgi?id=159250
+
+ Reviewed by Eric Carlson.
+
+ Add a sandbox exception allowing access to the mediaremoted XPC service.
+
+ * WebProcess/com.apple.WebProcess.sb.in:
+
2016-06-29 Alex Christensen <[email protected]>
WKWebView should ask WKNavigationDelegate about bad ssl certificates
Modified: trunk/Source/WebKit2/WebProcess/com.apple.WebProcess.sb.in (202641 => 202642)
--- trunk/Source/WebKit2/WebProcess/com.apple.WebProcess.sb.in 2016-06-29 19:22:59 UTC (rev 202641)
+++ trunk/Source/WebKit2/WebProcess/com.apple.WebProcess.sb.in 2016-06-29 19:29:07 UTC (rev 202642)
@@ -200,6 +200,9 @@
#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101100
(global-name "com.apple.nesessionmanager.flow-divert-token")
#endif
+#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101200
+ (global-name "com.apple.mediaremoted.xpc")
+#endif
)
;; Security framework