Changeset 185077 in webkit


Ignore:
Timestamp:
Jun 1, 2015 3:26:20 PM (9 years ago)
Author:
commit-queue@webkit.org
Message:

Implemented the eventTargetInterface and scriptExecutionContext methods required by EventTarget, as well as
some required infrastructure.
https://bugs.webkit.org/show_bug.cgi?id=145523

Patch by Matt Rajca <mrajca@apple.com> on 2015-06-01
Reviewed by Eric Carlson.

  • Modules/mediasession/MediaRemoteControls.cpp:

(WebCore::MediaRemoteControls::MediaRemoteControls): Initialize all instance variables.

  • Modules/mediasession/MediaRemoteControls.h: MediaRemoteControl's constructor now takes a script execution context, which we provide to EventTarget. The required eventTargetInterface method has also been implemented.

(WebCore::MediaRemoteControls::create):

  • Modules/mediasession/MediaRemoteControls.idl: Indicate MediaRemoteControls now takes a constructor that is passed in a script execution context. To prevent build errors, event handlers have been removed until they are implemented.
  • WebCore.xcodeproj/project.pbxproj: We should be building the derived JSMediaRemoteControls class with WebCore.
  • dom/EventTargetFactory.in: Ensure a MediaRemoteControlsEventTargetInterfaceType is generated.
Location:
trunk/Source/WebCore
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r185071 r185077  
     12015-06-01  Matt Rajca  <mrajca@apple.com>
     2
     3        Implemented the `eventTargetInterface` and `scriptExecutionContext` methods required by EventTarget, as well as
     4        some required infrastructure.
     5        https://bugs.webkit.org/show_bug.cgi?id=145523
     6
     7        Reviewed by Eric Carlson.
     8
     9        * Modules/mediasession/MediaRemoteControls.cpp:
     10        (WebCore::MediaRemoteControls::MediaRemoteControls): Initialize all instance variables.
     11        * Modules/mediasession/MediaRemoteControls.h: MediaRemoteControl's constructor now takes a script execution
     12          context, which we provide to EventTarget. The required eventTargetInterface method has also been implemented.
     13        (WebCore::MediaRemoteControls::create):
     14        * Modules/mediasession/MediaRemoteControls.idl: Indicate MediaRemoteControls now takes a constructor that is
     15          passed in a script execution context. To prevent build errors, event handlers have been removed until they are
     16          implemented.
     17        * WebCore.xcodeproj/project.pbxproj: We should be building the derived JSMediaRemoteControls class with WebCore.
     18        * dom/EventTargetFactory.in: Ensure a MediaRemoteControlsEventTargetInterfaceType is generated.
     19
    1202015-06-01  Benjamin Poulain  <bpoulain@apple.com>
    221
  • trunk/Source/WebCore/Modules/mediasession/MediaRemoteControls.cpp

    r185069 r185077  
    3131namespace WebCore {
    3232
     33MediaRemoteControls::MediaRemoteControls(ScriptExecutionContext& context)
     34    : m_scriptExecutionContext(context)
     35{
     36}
     37
    3338MediaRemoteControls::~MediaRemoteControls()
    3439{
  • trunk/Source/WebCore/Modules/mediasession/MediaRemoteControls.h

    r185069 r185077  
    3636class MediaRemoteControls : public RefCounted<MediaRemoteControls>, public EventTargetWithInlineData {
    3737public:
     38    static Ref<MediaRemoteControls> create(ScriptExecutionContext& context)
     39    {
     40        return adoptRef(*new MediaRemoteControls(context));
     41    }
     42
    3843    bool previousTrackEnabled() const { return m_previousTrackEnabled; }
    3944    void setPreviousTrackEnabled(bool enabled) { m_previousTrackEnabled = enabled; }
     
    5358    virtual ~MediaRemoteControls();
    5459
    55 protected:
    56     MediaRemoteControls() = default;
     60    MediaRemoteControls(ScriptExecutionContext&);
     61
     62    virtual EventTargetInterface eventTargetInterface() const override { return MediaRemoteControlsEventTargetInterfaceType; }
     63    virtual ScriptExecutionContext* scriptExecutionContext() const override { return &m_scriptExecutionContext; }
    5764
    5865private:
    59     bool m_previousTrackEnabled;
    60     bool m_nextTrackEnabled;
    61     bool m_seekForwardEnabled;
    62     bool m_seekBackwardEnabled;
     66    ScriptExecutionContext& m_scriptExecutionContext;
     67
     68    bool m_previousTrackEnabled { false };
     69    bool m_nextTrackEnabled { false };
     70    bool m_seekForwardEnabled { false };
     71    bool m_seekBackwardEnabled { false };
    6372
    6473    virtual void refEventTarget() override final { ref(); }
  • trunk/Source/WebCore/Modules/mediasession/MediaRemoteControls.idl

    r185069 r185077  
    2626[
    2727    Conditional=MEDIA_SESSION,
     28    Constructor,
     29    ConstructorCallWith=ScriptExecutionContext,
    2830    EventTarget,
    2931] interface MediaRemoteControls : EventTarget {
     
    3234    attribute boolean seekForwardEnabled;
    3335    attribute boolean seekBackwardEnabled;
    34 
    35     attribute EventHandler onprevioustrack;
    36     attribute EventHandler onnexttrack;
    37     attribute EventHandler onseekforward;
    38     attribute EventHandler onseekbackward;
    3936};
  • trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj

    r185069 r185077  
    56855685                C6F420A216B7164E0052A9F2 /* JSMutationCallback.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C6F420A016B7164E0052A9F2 /* JSMutationCallback.cpp */; };
    56865686                C6F420A316B7164E0052A9F2 /* JSMutationCallback.h in Headers */ = {isa = PBXBuildFile; fileRef = C6F420A116B7164E0052A9F2 /* JSMutationCallback.h */; };
     5687                C9026B651B1CF5FE001D99A7 /* JSMediaRemoteControls.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C9026B631B1CF5AB001D99A7 /* JSMediaRemoteControls.cpp */; };
    56875688                C90843CF1B18E47D00B68564 /* MediaRemoteControls.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C90843CD1B18E47D00B68564 /* MediaRemoteControls.cpp */; };
    56885689                C90843D01B18E47D00B68564 /* MediaRemoteControls.h in Headers */ = {isa = PBXBuildFile; fileRef = C90843CE1B18E47D00B68564 /* MediaRemoteControls.h */; };
     
    1323813239                C6F420A016B7164E0052A9F2 /* JSMutationCallback.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSMutationCallback.cpp; sourceTree = "<group>"; };
    1323913240                C6F420A116B7164E0052A9F2 /* JSMutationCallback.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSMutationCallback.h; sourceTree = "<group>"; };
     13241                C9026B631B1CF5AB001D99A7 /* JSMediaRemoteControls.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = JSMediaRemoteControls.cpp; path = "JSMediaRemoteControls.cpp"; sourceTree = "<group>"; };
     13242                C9026B641B1CF5AB001D99A7 /* JSMediaRemoteControls.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JSMediaRemoteControls.h; path = "JSMediaRemoteControls.h"; sourceTree = "<group>"; };
    1324013243                C90843CD1B18E47D00B68564 /* MediaRemoteControls.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MediaRemoteControls.cpp; sourceTree = "<group>"; };
    1324113244                C90843CE1B18E47D00B68564 /* MediaRemoteControls.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaRemoteControls.h; sourceTree = "<group>"; };
     
    1920219205                                CDB859F8160D493E00E5B07F /* JSMediaKeyEvent.cpp */,
    1920319206                                CDB859F9160D493E00E5B07F /* JSMediaKeyEvent.h */,
     19207                                C9026B631B1CF5AB001D99A7 /* JSMediaRemoteControls.cpp */,
     19208                                C9026B641B1CF5AB001D99A7 /* JSMediaRemoteControls.h */,
    1920419209                                7E46F6F81627A2C900062223 /* JSOESElementIndexUint.cpp */,
    1920519210                                7E46F6F91627A2C900062223 /* JSOESElementIndexUint.h */,
     
    2889728902                                D3A94A46122DC40F00A37BBC /* JSMediaQueryList.cpp in Sources */,
    2889828903                                7C5343FC17B74B63004232F0 /* JSMediaQueryListListener.cpp in Sources */,
     28904                                C9026B651B1CF5FE001D99A7 /* JSMediaRemoteControls.cpp in Sources */,
    2889928905                                CD9DE17417AAC74C00EA386D /* JSMediaSource.cpp in Sources */,
    2890028906                                07C59B7117F79C7C000FBCBB /* JSMediaSourceStates.cpp in Sources */,
  • trunk/Source/WebCore/dom/EventTargetFactory.in

    r179810 r185077  
    1717MediaKeySession conditional=ENCRYPTED_MEDIA_V2
    1818MediaController conditional=VIDEO
     19MediaRemoteControls conditional=MEDIA_SESSION
    1920MediaSource conditional=MEDIA_SOURCE
    2021MediaStream conditional=MEDIA_STREAM
Note: See TracChangeset for help on using the changeset viewer.