Changeset 140305 in webkit


Ignore:
Timestamp:
Jan 20, 2013 11:45:23 PM (11 years ago)
Author:
haraken@chromium.org
Message:

Implement MediaStreamEvent constructor
https://bugs.webkit.org/show_bug.cgi?id=107411

Reviewed by Adam Barth.

Spec: http://www.w3.org/TR/webrtc/#mediastreamevent

Test: fast/events/constructors/media-stream-event-constructor.html

Source/WebCore:

  • Modules/mediastream/MediaStreamEvent.cpp:

(WebCore::MediaStreamEventInit::MediaStreamEventInit):
(WebCore):
(WebCore::MediaStreamEvent::create):
(WebCore::MediaStreamEvent::MediaStreamEvent):

  • Modules/mediastream/MediaStreamEvent.h:

(MediaStreamEventInit):
(WebCore):
(MediaStreamEvent):

  • Modules/mediastream/MediaStreamEvent.idl:
  • bindings/js/JSDictionary.cpp:

(WebCore):
(WebCore::JSDictionary::convertValue):

  • bindings/js/JSDictionary.h:

(WebCore):

  • bindings/v8/Dictionary.cpp:

(WebCore):
(WebCore::Dictionary::get):

  • bindings/v8/Dictionary.h:

(Dictionary):

LayoutTests:

  • fast/events/constructors/media-stream-event-constructor-expected.txt: Added.
  • fast/events/constructors/media-stream-event-constructor.html: Added.
  • platform/chromium-android/TestExpectations:
  • platform/efl/TestExpectations:
  • platform/gtk/TestExpectations:
  • platform/mac/TestExpectations:
  • platform/qt/TestExpectations:
  • platform/win/TestExpectations:
  • platform/wincairo/TestExpectations:
Location:
trunk
Files:
2 added
16 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r140300 r140305  
     12013-01-20  Kentaro Hara  <haraken@chromium.org>
     2
     3        Implement MediaStreamEvent constructor
     4        https://bugs.webkit.org/show_bug.cgi?id=107411
     5
     6        Reviewed by Adam Barth.
     7
     8        Spec: http://www.w3.org/TR/webrtc/#mediastreamevent
     9
     10        Test: fast/events/constructors/media-stream-event-constructor.html
     11
     12        * fast/events/constructors/media-stream-event-constructor-expected.txt: Added.
     13        * fast/events/constructors/media-stream-event-constructor.html: Added.
     14        * platform/chromium-android/TestExpectations:
     15        * platform/efl/TestExpectations:
     16        * platform/gtk/TestExpectations:
     17        * platform/mac/TestExpectations:
     18        * platform/qt/TestExpectations:
     19        * platform/win/TestExpectations:
     20        * platform/wincairo/TestExpectations:
     21
    1222013-01-20  Mike Lawther  <mikelawther@chromium.org>
    223
  • trunk/LayoutTests/platform/chromium-android/TestExpectations

    r137208 r140305  
    4545crbug.com/145338 fast/forms/date
    4646crbug.com/145338 fast/mediastream
     47crbug.com/145338 fast/events/constructors/media-stream-event-constructor.html
    4748crbug.com/145338 fast/notifications
    4849crbug.com/145338 fast/speech
  • trunk/LayoutTests/platform/efl/TestExpectations

    r140286 r140305  
    12321232# Requires MEDIA_STREAM support.
    12331233webkit.org/b/87662 fast/mediastream [ Skip ]
     1234webkit.org/b/87662 fast/events/constructors/media-stream-event-constructor.html [ Skip ]
    12341235
    12351236# The EFL port has no support for x-webkit-speech
  • trunk/LayoutTests/platform/gtk/TestExpectations

    r140286 r140305  
    361361# Mediastream implementation is not complete yet.
    362362webkit.org/b/79203 fast/mediastream [ Skip ]
     363webkit.org/b/79203 fast/events/constructors/media-stream-event-constructor.html [ Skip ]
    363364
    364365# CSS Variables are not yet enabled.
  • trunk/LayoutTests/platform/mac/TestExpectations

    r140286 r140305  
    197197# Media Stream API is not yet enabled.
    198198fast/mediastream
     199fast/events/constructors/media-stream-event-constructor.html
    199200
    200201# Needs to be fixed at image decoder layer for Safari.
  • trunk/LayoutTests/platform/qt/TestExpectations

    r140286 r140305  
    100100# ENABLE(MEDIA_STREAM) is disabled.
    101101fast/mediastream
     102fast/events/constructors/media-stream-event-constructor.html
    102103
    103104# ENABLE(DIRECTORY_UPLOAD) is disabled.
  • trunk/LayoutTests/platform/win/TestExpectations

    r140286 r140305  
    12061206# Media Stream API is not yet enabled.
    12071207fast/mediastream
     1208fast/events/constructors/media-stream-event-constructor.html
    12081209
    12091210# Needs to be fixed at image decoder layer for Safari.
  • trunk/LayoutTests/platform/wincairo/TestExpectations

    r140286 r140305  
    17331733# Media Stream API is not yet enabled.
    17341734fast/mediastream
     1735fast/events/constructors/media-stream-event-constructor.html
    17351736
    17361737# Needs to be fixed at image decoder layer for Safari.
  • trunk/Source/WebCore/ChangeLog

    r140304 r140305  
     12013-01-20  Kentaro Hara  <haraken@chromium.org>
     2
     3        Implement MediaStreamEvent constructor
     4        https://bugs.webkit.org/show_bug.cgi?id=107411
     5
     6        Reviewed by Adam Barth.
     7
     8        Spec: http://www.w3.org/TR/webrtc/#mediastreamevent
     9
     10        Test: fast/events/constructors/media-stream-event-constructor.html
     11
     12        * Modules/mediastream/MediaStreamEvent.cpp:
     13        (WebCore::MediaStreamEventInit::MediaStreamEventInit):
     14        (WebCore):
     15        (WebCore::MediaStreamEvent::create):
     16        (WebCore::MediaStreamEvent::MediaStreamEvent):
     17        * Modules/mediastream/MediaStreamEvent.h:
     18        (MediaStreamEventInit):
     19        (WebCore):
     20        (MediaStreamEvent):
     21        * Modules/mediastream/MediaStreamEvent.idl:
     22        * bindings/js/JSDictionary.cpp:
     23        (WebCore):
     24        (WebCore::JSDictionary::convertValue):
     25        * bindings/js/JSDictionary.h:
     26        (WebCore):
     27        * bindings/v8/Dictionary.cpp:
     28        (WebCore):
     29        (WebCore::Dictionary::get):
     30        * bindings/v8/Dictionary.h:
     31        (Dictionary):
     32
    1332013-01-20  Vladislav Kaznacheev  <kaznacheev@chromium.org>
    234
  • trunk/Source/WebCore/Modules/mediastream/MediaStreamEvent.cpp

    r100425 r140305  
    3333namespace WebCore {
    3434
     35MediaStreamEventInit::MediaStreamEventInit()
     36    : stream(0)
     37{
     38}
     39
    3540PassRefPtr<MediaStreamEvent> MediaStreamEvent::create()
    3641{
     
    4348}
    4449
     50PassRefPtr<MediaStreamEvent> MediaStreamEvent::create(const AtomicString& type, const MediaStreamEventInit& initializer)
     51{
     52    return adoptRef(new MediaStreamEvent(type, initializer));
     53}
    4554
    4655MediaStreamEvent::MediaStreamEvent()
     
    5160    : Event(type, canBubble, cancelable)
    5261    , m_stream(stream)
     62{
     63}
     64
     65MediaStreamEvent::MediaStreamEvent(const AtomicString& type, const MediaStreamEventInit& initializer)
     66    : Event(type, initializer)
     67    , m_stream(initializer.stream)
    5368{
    5469}
  • trunk/Source/WebCore/Modules/mediastream/MediaStreamEvent.h

    r127752 r140305  
    3434namespace WebCore {
    3535
     36struct MediaStreamEventInit : public EventInit {
     37    MediaStreamEventInit();
     38
     39    RefPtr<MediaStream> stream;
     40};
     41
    3642class MediaStreamEvent : public Event {
    3743public:
     
    4046    static PassRefPtr<MediaStreamEvent> create();
    4147    static PassRefPtr<MediaStreamEvent> create(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtr<MediaStream>);
     48    static PassRefPtr<MediaStreamEvent> create(const AtomicString& type, const MediaStreamEventInit& initializer);
    4249
    4350    MediaStream* stream() const;
     
    4855    MediaStreamEvent();
    4956    MediaStreamEvent(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtr<MediaStream>);
     57    MediaStreamEvent(const AtomicString& type, const MediaStreamEventInit&);
    5058
    5159    RefPtr<MediaStream> m_stream;
  • trunk/Source/WebCore/Modules/mediastream/MediaStreamEvent.idl

    r131172 r140305  
    2323 */
    2424
    25 // According to the WHATWG specification:
    26 // http://www.whatwg.org/specs/web-apps/current-work/multipage/video-conferencing-and-peer-to-peer-communication.html#mediastreamevent
    2725[
    2826    Conditional=MEDIA_STREAM,
     27    ConstructorTemplate=Event
    2928] interface MediaStreamEvent : Event {
    30    readonly attribute MediaStream stream;
     29   [InitializedByEventConstructor] readonly attribute MediaStream stream;
    3130};
    3231
  • trunk/Source/WebCore/bindings/js/JSDictionary.cpp

    r138811 r140305  
    4646#endif
    4747
     48#if ENABLE(MEDIA_STREAM)
     49#include "JSMediaStream.h"
     50#endif
     51
    4852using namespace JSC;
    4953
     
    216220#endif
    217221
     222#if ENABLE(MEDIA_STREAM)
     223void JSDictionary::convertValue(JSC::ExecState*, JSC::JSValue value, RefPtr<MediaStream>& result)
     224{
     225    result = toMediaStream(value);
     226}
     227#endif
     228
    218229bool JSDictionary::getWithUndefinedOrNullCheck(const String& propertyName, String& result) const
    219230{
  • trunk/Source/WebCore/bindings/js/JSDictionary.h

    r139541 r140305  
    4141class EventTarget;
    4242class MediaKeyError;
     43class MediaStream;
    4344class Node;
    4445class ScriptValue;
     
    116117    static void convertValue(JSC::ExecState*, JSC::JSValue, RefPtr<MediaKeyError>& result);
    117118#endif
     119#if ENABLE(MEDIA_STREAM)
     120    static void convertValue(JSC::ExecState*, JSC::JSValue, RefPtr<MediaStream>& result);
     121#endif
    118122
    119123    JSC::ExecState* m_exec;
  • trunk/Source/WebCore/bindings/v8/Dictionary.cpp

    r136822 r140305  
    5959#endif
    6060
     61#if ENABLE(MEDIA_STREAM)
     62#include "MediaStream.h"
     63#include "V8MediaStream.h"
     64#endif
     65
    6166namespace WebCore {
    6267
     
    433438}
    434439
     440#endif
     441
     442#if ENABLE(MEDIA_STREAM)
     443bool Dictionary::get(const String& key, RefPtr<MediaStream>& value) const
     444{
     445    v8::Local<v8::Value> v8Value;
     446    if (!getKey(key, v8Value))
     447        return false;
     448
     449    MediaStream* stream = 0;
     450    if (v8Value->IsObject()) {
     451        v8::Handle<v8::Object> wrapper = v8::Handle<v8::Object>::Cast(v8Value);
     452        v8::Handle<v8::Object> error = wrapper->FindInstanceInPrototypeChain(V8MediaStream::GetTemplate());
     453        if (!error.IsEmpty())
     454            stream = V8MediaStream::toNative(error);
     455    }
     456    value = stream;
     457    return true;
     458}
    435459#endif
    436460
  • trunk/Source/WebCore/bindings/v8/Dictionary.h

    r136392 r140305  
    8686    bool get(const String&, RefPtr<SpeechRecognitionResultList>&) const;
    8787#endif
     88#if ENABLE(MEDIA_STREAM)
     89    bool get(const String&, RefPtr<MediaStream>&) const;
     90#endif
    8891    bool get(const String&, HashSet<AtomicString>&) const;
    8992    bool get(const String&, Dictionary&) const;
Note: See TracChangeset for help on using the changeset viewer.