Title: [185069] trunk/Source/WebCore
Revision
185069
Author
[email protected]
Date
2015-06-01 12:05:44 -0700 (Mon, 01 Jun 2015)

Log Message

Add stub implementation of MediaRemoteControls, part of the Media Session spec.
https://bugs.webkit.org/show_bug.cgi?id=145462

Patch by Matt Rajca <[email protected]> on 2015-06-01
Reviewed by Eric Carlson.

* CMakeLists.txt: Added IDL file as well as the corresponding implementation file.
* DerivedSources.make: Included the new IDL file.
* Modules/mediasession/MediaRemoteControls.cpp: Added an empty implementation file.
(MediaRemoteControls::~MediaRemoteControls):
* Modules/mediasession/MediaRemoteControls.h: Added a stubbed header file with accessors for the four attributes declared in the IDL file.
(WebCore::MediaRemoteControls::previousTrackEnabled):
(WebCore::MediaRemoteControls::setPreviousTrackEnabled):
(WebCore::MediaRemoteControls::nextTrackEnabled):
(WebCore::MediaRemoteControls::setNextTrackEnabled):
(WebCore::MediaRemoteControls::seekForwardEnabled):
(WebCore::MediaRemoteControls::setSeekForwardEnabled):
(WebCore::MediaRemoteControls::seekBackwardEnabled):
(WebCore::MediaRemoteControls::setSeekBackwardEnabled):
* Modules/mediasession/MediaRemoteControls.idl: Added from the Media Session spec.
* WebCore.xcodeproj/project.pbxproj: Included the new IDL file and MediaRemoteControls.cpp/.h sources.

Modified Paths

Added Paths

Diff

Modified: trunk/Source/WebCore/CMakeLists.txt (185068 => 185069)


--- trunk/Source/WebCore/CMakeLists.txt	2015-06-01 18:40:57 UTC (rev 185068)
+++ trunk/Source/WebCore/CMakeLists.txt	2015-06-01 19:05:44 UTC (rev 185069)
@@ -144,6 +144,7 @@
     Modules/geolocation
     Modules/indexeddb
     Modules/indieui
+    Modules/mediasession
     Modules/mediastream
     Modules/notifications
     Modules/proximity
@@ -217,6 +218,8 @@
 
     Modules/mediacontrols/MediaControlsHost.idl
 
+    Modules/mediasession/MediaRemoteControls.idl
+
     Modules/mediasource/DOMURLMediaSource.idl
     Modules/mediasource/MediaSource.idl
     Modules/mediasource/SourceBuffer.idl
@@ -870,6 +873,8 @@
 
     Modules/mediacontrols/MediaControlsHost.cpp
 
+    Modules/mediasession/MediaRemoteControls.cpp
+
     Modules/mediasource/DOMURLMediaSource.cpp
     Modules/mediasource/MediaSource.cpp
     Modules/mediasource/MediaSourceRegistry.cpp

Modified: trunk/Source/WebCore/ChangeLog (185068 => 185069)


--- trunk/Source/WebCore/ChangeLog	2015-06-01 18:40:57 UTC (rev 185068)
+++ trunk/Source/WebCore/ChangeLog	2015-06-01 19:05:44 UTC (rev 185069)
@@ -1,3 +1,26 @@
+2015-06-01  Matt Rajca  <[email protected]>
+
+        Add stub implementation of MediaRemoteControls, part of the Media Session spec.
+        https://bugs.webkit.org/show_bug.cgi?id=145462
+
+        Reviewed by Eric Carlson.
+
+        * CMakeLists.txt: Added IDL file as well as the corresponding implementation file.
+        * DerivedSources.make: Included the new IDL file.
+        * Modules/mediasession/MediaRemoteControls.cpp: Added an empty implementation file.
+        (MediaRemoteControls::~MediaRemoteControls):
+        * Modules/mediasession/MediaRemoteControls.h: Added a stubbed header file with accessors for the four attributes declared in the IDL file.
+        (WebCore::MediaRemoteControls::previousTrackEnabled):
+        (WebCore::MediaRemoteControls::setPreviousTrackEnabled):
+        (WebCore::MediaRemoteControls::nextTrackEnabled):
+        (WebCore::MediaRemoteControls::setNextTrackEnabled):
+        (WebCore::MediaRemoteControls::seekForwardEnabled):
+        (WebCore::MediaRemoteControls::setSeekForwardEnabled):
+        (WebCore::MediaRemoteControls::seekBackwardEnabled):
+        (WebCore::MediaRemoteControls::setSeekBackwardEnabled):
+        * Modules/mediasession/MediaRemoteControls.idl: Added from the Media Session spec.
+        * WebCore.xcodeproj/project.pbxproj: Included the new IDL file and MediaRemoteControls.cpp/.h sources.
+
 2015-06-01  Sergio Villar Senin  <[email protected]>
 
         [CSS Grid Layout] Simplify the interface of GridResolvedPosition

Modified: trunk/Source/WebCore/DerivedSources.make (185068 => 185069)


--- trunk/Source/WebCore/DerivedSources.make	2015-06-01 18:40:57 UTC (rev 185068)
+++ trunk/Source/WebCore/DerivedSources.make	2015-06-01 19:05:44 UTC (rev 185069)
@@ -35,6 +35,7 @@
     $(WebCore)/Modules/indexeddb \
     $(WebCore)/Modules/indieui \
     $(WebCore)/Modules/mediacontrols \
+    $(WebCore)/Modules/mediasession \
     $(WebCore)/Modules/mediasource \
     $(WebCore)/Modules/mediastream \
     $(WebCore)/Modules/notifications \
@@ -103,6 +104,7 @@
     $(WebCore)/Modules/indexeddb/WorkerGlobalScopeIndexedDatabase.idl \
     $(WebCore)/Modules/indieui/UIRequestEvent.idl \
     $(WebCore)/Modules/mediacontrols/MediaControlsHost.idl \
+    $(WebCore)/Modules/mediasession/MediaRemoteControls.idl \
 	$(WebCore)/Modules/mediasource/DOMURLMediaSource.idl \
 	$(WebCore)/Modules/mediasource/AudioTrackMediaSource.idl \
 	$(WebCore)/Modules/mediasource/MediaSource.idl \

Added: trunk/Source/WebCore/Modules/mediasession/MediaRemoteControls.cpp (0 => 185069)


--- trunk/Source/WebCore/Modules/mediasession/MediaRemoteControls.cpp	                        (rev 0)
+++ trunk/Source/WebCore/Modules/mediasession/MediaRemoteControls.cpp	2015-06-01 19:05:44 UTC (rev 185069)
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2015 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. ``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
+ * 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 "MediaRemoteControls.h"
+
+#if ENABLE(MEDIA_SESSION)
+
+namespace WebCore {
+
+MediaRemoteControls::~MediaRemoteControls()
+{
+    
+}
+
+}
+
+#endif /* ENABLE(MEDIA_SESSION) */

Added: trunk/Source/WebCore/Modules/mediasession/MediaRemoteControls.h (0 => 185069)


--- trunk/Source/WebCore/Modules/mediasession/MediaRemoteControls.h	                        (rev 0)
+++ trunk/Source/WebCore/Modules/mediasession/MediaRemoteControls.h	2015-06-01 19:05:44 UTC (rev 185069)
@@ -0,0 +1,72 @@
+/*
+ * Copyright (C) 2015 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. ``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
+ * 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.
+ */
+
+#ifndef MediaRemoteControls_h
+#define MediaRemoteControls_h
+
+#if ENABLE(MEDIA_SESSION)
+
+#include "EventTarget.h"
+#include <wtf/RefCounted.h>
+
+namespace WebCore {
+
+class MediaRemoteControls : public RefCounted<MediaRemoteControls>, public EventTargetWithInlineData {
+public:
+    bool previousTrackEnabled() const { return m_previousTrackEnabled; }
+    void setPreviousTrackEnabled(bool enabled) { m_previousTrackEnabled = enabled; }
+
+    bool nextTrackEnabled() const { return m_nextTrackEnabled; }
+    void setNextTrackEnabled(bool enabled) { m_nextTrackEnabled = enabled; }
+
+    bool seekForwardEnabled() const { return m_seekForwardEnabled; }
+    void setSeekForwardEnabled(bool enabled) { m_seekForwardEnabled = enabled; }
+
+    bool seekBackwardEnabled() const { return m_seekBackwardEnabled; }
+    void setSeekBackwardEnabled(bool enabled) { m_seekBackwardEnabled = enabled; }
+
+    using RefCounted<MediaRemoteControls>::ref;
+    using RefCounted<MediaRemoteControls>::deref;
+
+    virtual ~MediaRemoteControls();
+
+protected:
+    MediaRemoteControls() = default;
+
+private:
+    bool m_previousTrackEnabled;
+    bool m_nextTrackEnabled;
+    bool m_seekForwardEnabled;
+    bool m_seekBackwardEnabled;
+
+    virtual void refEventTarget() override final { ref(); }
+    virtual void derefEventTarget() override final { deref(); }
+};
+
+} // namespace WebCore
+
+#endif /* ENABLE(MEDIA_SESSION) */
+
+#endif /* MediaRemoteControls_h */

Added: trunk/Source/WebCore/Modules/mediasession/MediaRemoteControls.idl (0 => 185069)


--- trunk/Source/WebCore/Modules/mediasession/MediaRemoteControls.idl	                        (rev 0)
+++ trunk/Source/WebCore/Modules/mediasession/MediaRemoteControls.idl	2015-06-01 19:05:44 UTC (rev 185069)
@@ -0,0 +1,39 @@
+/*
+ * Copyright (C) 2015 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. ``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
+ * 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. 
+ */
+
+[
+    Conditional=MEDIA_SESSION,
+    EventTarget,
+] interface MediaRemoteControls : EventTarget {
+    attribute boolean previousTrackEnabled;
+    attribute boolean nextTrackEnabled;
+    attribute boolean seekForwardEnabled;
+    attribute boolean seekBackwardEnabled;
+
+    attribute EventHandler onprevioustrack;
+    attribute EventHandler onnexttrack;
+    attribute EventHandler onseekforward;
+    attribute EventHandler onseekbackward;
+};

Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (185068 => 185069)


--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2015-06-01 18:40:57 UTC (rev 185068)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2015-06-01 19:05:44 UTC (rev 185069)
@@ -5684,6 +5684,8 @@
 		C6F0917F143A2BB900685849 /* JSMutationObserverCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C6F0917E143A2BB900685849 /* JSMutationObserverCustom.cpp */; };
 		C6F420A216B7164E0052A9F2 /* JSMutationCallback.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C6F420A016B7164E0052A9F2 /* JSMutationCallback.cpp */; };
 		C6F420A316B7164E0052A9F2 /* JSMutationCallback.h in Headers */ = {isa = PBXBuildFile; fileRef = C6F420A116B7164E0052A9F2 /* JSMutationCallback.h */; };
+		C90843CF1B18E47D00B68564 /* MediaRemoteControls.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C90843CD1B18E47D00B68564 /* MediaRemoteControls.cpp */; };
+		C90843D01B18E47D00B68564 /* MediaRemoteControls.h in Headers */ = {isa = PBXBuildFile; fileRef = C90843CE1B18E47D00B68564 /* MediaRemoteControls.h */; };
 		CA3BF67C10D99BAE00E6CE53 /* ScrollAnimator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CA3BF67B10D99BAE00E6CE53 /* ScrollAnimator.cpp */; };
 		CA3BF67E10D99BAE00E6CE53 /* ScrollAnimator.h in Headers */ = {isa = PBXBuildFile; fileRef = CA3BF67D10D99BAE00E6CE53 /* ScrollAnimator.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		CAE9F90F146441F000C245B0 /* CSSAspectRatioValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CAE9F90D146441F000C245B0 /* CSSAspectRatioValue.cpp */; };
@@ -13235,6 +13237,9 @@
 		C6F0917E143A2BB900685849 /* JSMutationObserverCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSMutationObserverCustom.cpp; sourceTree = "<group>"; };
 		C6F420A016B7164E0052A9F2 /* JSMutationCallback.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSMutationCallback.cpp; sourceTree = "<group>"; };
 		C6F420A116B7164E0052A9F2 /* JSMutationCallback.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSMutationCallback.h; sourceTree = "<group>"; };
+		C90843CD1B18E47D00B68564 /* MediaRemoteControls.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MediaRemoteControls.cpp; sourceTree = "<group>"; };
+		C90843CE1B18E47D00B68564 /* MediaRemoteControls.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaRemoteControls.h; sourceTree = "<group>"; };
+		C93458BB1B18D77E0088EE12 /* MediaRemoteControls.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = MediaRemoteControls.idl; sourceTree = "<group>"; };
 		CA3BF67B10D99BAE00E6CE53 /* ScrollAnimator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScrollAnimator.cpp; sourceTree = "<group>"; };
 		CA3BF67D10D99BAE00E6CE53 /* ScrollAnimator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollAnimator.h; sourceTree = "<group>"; };
 		CAE9F90D146441F000C245B0 /* CSSAspectRatioValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CSSAspectRatioValue.cpp; sourceTree = "<group>"; };
@@ -14578,6 +14583,9 @@
 		0709D78B1AE5552E004E42F8 /* mediasession */ = {
 			isa = PBXGroup;
 			children = (
+				C90843CD1B18E47D00B68564 /* MediaRemoteControls.cpp */,
+				C90843CE1B18E47D00B68564 /* MediaRemoteControls.h */,
+				C93458BB1B18D77E0088EE12 /* MediaRemoteControls.idl */,
 				0709D78C1AE55554004E42F8 /* WebMediaSessionManager.cpp */,
 				0709D78D1AE55554004E42F8 /* WebMediaSessionManager.h */,
 				0709D7941AE55A29004E42F8 /* WebMediaSessionManagerClient.h */,
@@ -25794,6 +25802,7 @@
 				D3A94A39122DABAC00A37BBC /* MediaQueryList.h in Headers */,
 				D3A94A3B122DABAC00A37BBC /* MediaQueryListListener.h in Headers */,
 				D3AA10F4123A98AA0092152B /* MediaQueryMatcher.h in Headers */,
+				C90843D01B18E47D00B68564 /* MediaRemoteControls.h in Headers */,
 				CEEFCD7A19DB31F7003876D7 /* MediaResourceLoader.h in Headers */,
 				CDBEAEAD19D92B6C00BEBA88 /* MediaSelectionGroupAVFObjC.h in Headers */,
 				07F944161864D046005D31CB /* MediaSessionManager.h in Headers */,
@@ -29372,6 +29381,7 @@
 				4E19592D0A39DACC00220FE5 /* MediaQueryExp.cpp in Sources */,
 				D3A94A38122DABAC00A37BBC /* MediaQueryList.cpp in Sources */,
 				D3AA10F3123A98AA0092152B /* MediaQueryMatcher.cpp in Sources */,
+				C90843CF1B18E47D00B68564 /* MediaRemoteControls.cpp in Sources */,
 				CEEFCD7919DB31F7003876D7 /* MediaResourceLoader.cpp in Sources */,
 				CDBEAEAC19D92B6C00BEBA88 /* MediaSelectionGroupAVFObjC.mm in Sources */,
 				CDAE8C091746B95700532D78 /* MediaSessionManager.cpp in Sources */,
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to