• tommyw@google.com's avatar
    MediaStream API: Update MediaStreamTrack to match the specification · 887c7bfe
    tommyw@google.com authored
    https://bugs.webkit.org/show_bug.cgi?id=90180
    
    Reviewed by Adam Barth.
    
    Source/Platform:
    
    * chromium/public/WebMediaStreamDescriptor.h:
    (WebMediaStreamDescriptor):
    * chromium/public/WebMediaStreamSource.h:
    (WebMediaStreamSource):
    
    Source/WebCore:
    
    MediaStreamTracks are now required to show the status of the underlying source,
    and trigger events when that status changes.
    
    Test: fast/mediastream/MediaStreamTrack.html
    
    * GNUmakefile.list.am:
    * Modules/mediastream/MediaStream.cpp:
    (WebCore::MediaStream::MediaStream):
    (WebCore::MediaStream::addTrack):
    * Modules/mediastream/MediaStreamTrack.cpp:
    (WebCore::MediaStreamTrack::create):
    (WebCore::MediaStreamTrack::MediaStreamTrack):
    (WebCore::MediaStreamTrack::~MediaStreamTrack):
    (WebCore::MediaStreamTrack::setEnabled):
    (WebCore::MediaStreamTrack::readyState):
    (WebCore):
    (WebCore::MediaStreamTrack::sourceChangedState):
    (WebCore::MediaStreamTrack::stop):
    (WebCore::MediaStreamTrack::interfaceName):
    (WebCore::MediaStreamTrack::scriptExecutionContext):
    (WebCore::MediaStreamTrack::eventTargetData):
    (WebCore::MediaStreamTrack::ensureEventTargetData):
    * Modules/mediastream/MediaStreamTrack.h:
    * Modules/mediastream/MediaStreamTrack.idl:
    * WebCore.gypi:
    * dom/EventNames.h:
    (WebCore):
    * dom/EventTargetFactory.in:
    * platform/chromium/support/WebMediaStreamDescriptor.cpp:
    * platform/chromium/support/WebMediaStreamSource.cpp:
    (WebKit::WebMediaStreamSource::setReadyState):
    (WebKit):
    (WebKit::WebMediaStreamSource::readyState):
    * platform/mediastream/MediaStreamSource.cpp: Copied from Source/WebCore/platform/mediastream/MediaStreamSource.h.
    (WebCore):
    (WebCore::MediaStreamSource::create):
    (WebCore::MediaStreamSource::MediaStreamSource):
    (WebCore::MediaStreamSource::setReadyState):
    (WebCore::MediaStreamSource::addObserver):
    (WebCore::MediaStreamSource::removeObserver):
    * platform/mediastream/MediaStreamSource.h:
    (Observer):
    (WebCore::MediaStreamSource::Observer::~Observer):
    (MediaStreamSource):
    (WebCore::MediaStreamSource::readyState):
    * platform/mediastream/chromium/MediaStreamCenterChromium.cpp:
    (WebCore::MediaStreamCenterChromium::queryMediaStreamSources):
    (WebCore::MediaStreamCenterChromium::didCreateMediaStream):
    
    Tools:
    
    Adding a Mock WebMediaStreamCenter to enable better LayoutTests.
    
    * DumpRenderTree/DumpRenderTree.gypi:
    * DumpRenderTree/chromium/MockWebKitPlatformSupport.cpp:
    (MockWebKitPlatformSupport::createMediaStreamCenter):
    * DumpRenderTree/chromium/MockWebMediaStreamCenter.cpp: Added.
    (WebKit):
    (WebKit::MockWebMediaStreamCenter::MockWebMediaStreamCenter):
    (WebKit::MockWebMediaStreamCenter::queryMediaStreamSources):
    (WebKit::MockWebMediaStreamCenter::didEnableMediaStreamTrack):
    (WebKit::MockWebMediaStreamCenter::didDisableMediaStreamTrack):
    (WebKit::MockWebMediaStreamCenter::didStopLocalMediaStream):
    (WebKit::MockWebMediaStreamCenter::didCreateMediaStream):
    (WebKit::MockWebMediaStreamCenter::constructSDP):
    * DumpRenderTree/chromium/MockWebMediaStreamCenter.h: Copied from Tools/DumpRenderTree/chromium/MockWebKitPlatformSupport.cpp.
    (WebKit):
    (MockWebMediaStreamCenter):
    (WebKit::MockWebMediaStreamCenter::MockWebMediaStreamCenter):
    
    LayoutTests:
    
    * fast/mediastream/MediaStreamTrack-expected.txt: Added.
    * fast/mediastream/MediaStreamTrack.html: Added.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@123499 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    887c7bfe
MediaStreamTrack.idl 2.32 KB