Changeset 156049 in webkit


Ignore:
Timestamp:
Sep 18, 2013 10:25:42 AM (11 years ago)
Author:
jer.noble@apple.com
Message:

Merge blink MediaSource changes since fork.
https://bugs.webkit.org/show_bug.cgi?id=118752

Rubber-stamped by Eric Carlson.

Source/WebCore:

Tests: http/tests/media/media-source/mediasource-addsourcebuffer.html

http/tests/media/media-source/mediasource-append-buffer.html
http/tests/media/media-source/mediasource-buffered.html
http/tests/media/media-source/mediasource-closed.html
http/tests/media/media-source/mediasource-config-change-mp4-a-bitrate.html
http/tests/media/media-source/mediasource-config-change-mp4-av-audio-bitrate.html
http/tests/media/media-source/mediasource-config-change-mp4-av-framesize.html
http/tests/media/media-source/mediasource-config-change-mp4-av-video-bitrate.html
http/tests/media/media-source/mediasource-config-change-mp4-v-bitrate.html
http/tests/media/media-source/mediasource-config-change-mp4-v-framerate.html
http/tests/media/media-source/mediasource-config-change-mp4-v-framesize.html
http/tests/media/media-source/mediasource-config-change-webm-a-bitrate.html
http/tests/media/media-source/mediasource-config-change-webm-av-audio-bitrate.html
http/tests/media/media-source/mediasource-config-change-webm-av-framesize.html
http/tests/media/media-source/mediasource-config-change-webm-av-video-bitrate.html
http/tests/media/media-source/mediasource-config-change-webm-v-bitrate.html
http/tests/media/media-source/mediasource-config-change-webm-v-framerate.html
http/tests/media/media-source/mediasource-config-change-webm-v-framesize.html
http/tests/media/media-source/mediasource-is-type-supported.html
http/tests/media/media-source/mediasource-multiple-attach.html
http/tests/media/media-source/mediasource-play.html
http/tests/media/media-source/mediasource-sourcebufferlist.html

Add files to project. Fix compile errors exposed by enabling.

  • WebCore.xcodeproj/project.pbxproj:
  • Modules/mediasource/MediaSourceRegistry.cpp:

(WebCore::MediaSourceRegistry::lookupMediaSource):

  • platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:

(WebCore::MediaPlayerPrivateAVFoundation::load):

  • platform/graphics/mac/MediaPlayerPrivateQTKit.h:

(WebCore::MediaPlayerPrivateQTKit::load):

  • platform/mac/MIMETypeRegistryMac.mm:

(WebCore::MIMETypeRegistry::isSupportedMediaSourceMIMEType):

  • CMakeLists.txt:
  • DerivedSources.make:
  • DerivedSources.pri:
  • GNUmakefile.list.am:

Merge
https://chromium.googlesource.com/chromium/blink/+/c38e2955db98a300a535b692869fea0e41501497
https://chromium.googlesource.com/chromium/blink/+/8568015e9bee1de7fccee28163f9e4a4b51f9baf
https://chromium.googlesource.com/chromium/blink/+/14417e8fa6294f4e7dbc1e0fac549398522b2f97
https://chromium.googlesource.com/chromium/blink/+/f43a5496f233102f8861a067a9cf8053c010d401
https://chromium.googlesource.com/chromium/blink/+/57771439806f7c6e6a272efb1ea72900f5f6a015
https://chromium.googlesource.com/chromium/blink/+/8c77a790a9d225194db0a8832399d0f9e1fa54ec
https://chromium.googlesource.com/chromium/blink/+/d33ae3fa7a8592e946503ed17f862a27c6d9dde1
https://chromium.googlesource.com/chromium/blink/+/1caaa9c51f06e1b9341d58c994f77fd59fcd236d
https://chromium.googlesource.com/chromium/blink/+/e95720393b0ebe67f19de39bb77cdf2926165512
https://chromium.googlesource.com/chromium/blink/+/bad2c1b4b70faec731b2ad3cc8a4ccf28de6cc38
https://chromium.googlesource.com/chromium/blink/+/a7873430c3d5c9373336c6f3993db3cb4228e9cd
https://chromium.googlesource.com/chromium/blink/+/508966d5e32360b3cec058f9fbae0014542fbc52
https://chromium.googlesource.com/chromium/blink/+/371dfe72f61ce6f73e6c242324da73c415d38be3

LayoutTests:

  • http/tests/media/media-source/mediasource-addsourcebuffer-expected.txt: Added.
  • http/tests/media/media-source/mediasource-addsourcebuffer.html: Added.
  • http/tests/media/media-source/mediasource-append-buffer-expected.txt: Added.
  • http/tests/media/media-source/mediasource-append-buffer.html: Added.
  • http/tests/media/media-source/mediasource-buffered-expected.txt: Added.
  • http/tests/media/media-source/mediasource-buffered.html: Added.
  • http/tests/media/media-source/mediasource-closed-expected.txt: Added.
  • http/tests/media/media-source/mediasource-closed.html: Added.
  • http/tests/media/media-source/mediasource-config-change-mp4-a-bitrate-expected.txt: Added.
  • http/tests/media/media-source/mediasource-config-change-mp4-a-bitrate.html: Added.
  • http/tests/media/media-source/mediasource-config-change-mp4-av-audio-bitrate-expected.txt: Added.
  • http/tests/media/media-source/mediasource-config-change-mp4-av-audio-bitrate.html: Added.
  • http/tests/media/media-source/mediasource-config-change-mp4-av-framesize-expected.txt: Added.
  • http/tests/media/media-source/mediasource-config-change-mp4-av-framesize.html: Added.
  • http/tests/media/media-source/mediasource-config-change-mp4-av-video-bitrate-expected.txt: Added.
  • http/tests/media/media-source/mediasource-config-change-mp4-av-video-bitrate.html: Added.
  • http/tests/media/media-source/mediasource-config-change-mp4-v-bitrate-expected.txt: Added.
  • http/tests/media/media-source/mediasource-config-change-mp4-v-bitrate.html: Added.
  • http/tests/media/media-source/mediasource-config-change-mp4-v-framerate-expected.txt: Added.
  • http/tests/media/media-source/mediasource-config-change-mp4-v-framerate.html: Added.
  • http/tests/media/media-source/mediasource-config-change-mp4-v-framesize-expected.txt: Added.
  • http/tests/media/media-source/mediasource-config-change-mp4-v-framesize.html: Added.
  • http/tests/media/media-source/mediasource-config-change-webm-a-bitrate-expected.txt: Added.
  • http/tests/media/media-source/mediasource-config-change-webm-a-bitrate.html: Added.
  • http/tests/media/media-source/mediasource-config-change-webm-av-audio-bitrate-expected.txt: Added.
  • http/tests/media/media-source/mediasource-config-change-webm-av-audio-bitrate.html: Added.
  • http/tests/media/media-source/mediasource-config-change-webm-av-framesize-expected.txt: Added.
  • http/tests/media/media-source/mediasource-config-change-webm-av-framesize.html: Added.
  • http/tests/media/media-source/mediasource-config-change-webm-av-video-bitrate-expected.txt: Added.
  • http/tests/media/media-source/mediasource-config-change-webm-av-video-bitrate.html: Added.
  • http/tests/media/media-source/mediasource-config-change-webm-v-bitrate-expected.txt: Added.
  • http/tests/media/media-source/mediasource-config-change-webm-v-bitrate.html: Added.
  • http/tests/media/media-source/mediasource-config-change-webm-v-framerate-expected.txt: Added.
  • http/tests/media/media-source/mediasource-config-change-webm-v-framerate.html: Added.
  • http/tests/media/media-source/mediasource-config-change-webm-v-framesize-expected.txt: Added.
  • http/tests/media/media-source/mediasource-config-change-webm-v-framesize.html: Added.
  • http/tests/media/media-source/mediasource-config-changes.js: Added.
  • http/tests/media/media-source/mediasource-is-type-supported-expected.txt: Added.
  • http/tests/media/media-source/mediasource-is-type-supported.html: Added.
  • http/tests/media/media-source/mediasource-multiple-attach-expected.txt: Added.
  • http/tests/media/media-source/mediasource-multiple-attach.html: Added.
  • http/tests/media/media-source/mediasource-play-expected.txt: Added.
  • http/tests/media/media-source/mediasource-play.html: Added.
  • http/tests/media/media-source/mediasource-sourcebufferlist-expected.txt: Added.
  • http/tests/media/media-source/mediasource-sourcebufferlist.html: Added.
  • http/tests/media/media-source/mediasource-util.js: Added.
  • http/tests/media/media-source/video-media-source-objects-expected.txt:
  • http/tests/media/resources/media-source/generate-config-change-tests.py: Added.
  • http/tests/media/resources/media-source/mp4/test-a-128k-44100Hz-1ch-manifest.json: Added.
  • http/tests/media/resources/media-source/mp4/test-a-192k-44100Hz-1ch-manifest.json: Added.
  • http/tests/media/resources/media-source/mp4/test-av-384k-44100Hz-1ch-320x240-30fps-10kfr-manifest.json: Added.
  • http/tests/media/resources/media-source/mp4/test-av-384k-44100Hz-1ch-640x480-30fps-10kfr-manifest.json: Added.
  • http/tests/media/resources/media-source/mp4/test-av-448k-44100Hz-1ch-640x480-30fps-10kfr-manifest.json: Added.
  • http/tests/media/resources/media-source/mp4/test-av-640k-44100Hz-1ch-640x480-30fps-10kfr-manifest.json: Added.
  • http/tests/media/resources/media-source/mp4/test-v-128k-320x240-24fps-8kfr-manifest.json: Added.
  • http/tests/media/resources/media-source/mp4/test-v-128k-320x240-30fps-10kfr-manifest.json: Added.
  • http/tests/media/resources/media-source/mp4/test-v-128k-640x480-30fps-10kfr-manifest.json: Added.
  • http/tests/media/resources/media-source/mp4/test-v-256k-320x240-30fps-10kfr-manifest.json: Added.
  • http/tests/media/resources/media-source/webm/test-a-128k-44100Hz-1ch-manifest.json: Added.
  • http/tests/media/resources/media-source/webm/test-a-192k-44100Hz-1ch-manifest.json: Added.
  • http/tests/media/resources/media-source/webm/test-av-384k-44100Hz-1ch-320x240-30fps-10kfr-manifest.json: Added.
  • http/tests/media/resources/media-source/webm/test-av-384k-44100Hz-1ch-640x480-30fps-10kfr-manifest.json: Added.
  • http/tests/media/resources/media-source/webm/test-av-448k-44100Hz-1ch-640x480-30fps-10kfr-manifest.json: Added.
  • http/tests/media/resources/media-source/webm/test-av-640k-44100Hz-1ch-640x480-30fps-10kfr-manifest.json: Added.
  • http/tests/media/resources/media-source/webm/test-v-128k-320x240-24fps-8kfr-manifest.json: Added.
  • http/tests/media/resources/media-source/webm/test-v-128k-320x240-30fps-10kfr-manifest.json: Added.
  • http/tests/media/resources/media-source/webm/test-v-128k-640x480-30fps-10kfr-manifest.json: Added.
  • http/tests/media/resources/media-source/webm/test-v-256k-320x240-30fps-10kfr-manifest.json: Added.
Location:
trunk
Files:
69 added
43 edited
20 copied

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r156047 r156049  
     12013-09-18  Jer Noble  <jer.noble@apple.com>
     2
     3        Merge blink MediaSource changes since fork.
     4        https://bugs.webkit.org/show_bug.cgi?id=118752
     5
     6        Rubber-stamped by Eric Carlson.
     7
     8        * http/tests/media/media-source/mediasource-addsourcebuffer-expected.txt: Added.
     9        * http/tests/media/media-source/mediasource-addsourcebuffer.html: Added.
     10        * http/tests/media/media-source/mediasource-append-buffer-expected.txt: Added.
     11        * http/tests/media/media-source/mediasource-append-buffer.html: Added.
     12        * http/tests/media/media-source/mediasource-buffered-expected.txt: Added.
     13        * http/tests/media/media-source/mediasource-buffered.html: Added.
     14        * http/tests/media/media-source/mediasource-closed-expected.txt: Added.
     15        * http/tests/media/media-source/mediasource-closed.html: Added.
     16        * http/tests/media/media-source/mediasource-config-change-mp4-a-bitrate-expected.txt: Added.
     17        * http/tests/media/media-source/mediasource-config-change-mp4-a-bitrate.html: Added.
     18        * http/tests/media/media-source/mediasource-config-change-mp4-av-audio-bitrate-expected.txt: Added.
     19        * http/tests/media/media-source/mediasource-config-change-mp4-av-audio-bitrate.html: Added.
     20        * http/tests/media/media-source/mediasource-config-change-mp4-av-framesize-expected.txt: Added.
     21        * http/tests/media/media-source/mediasource-config-change-mp4-av-framesize.html: Added.
     22        * http/tests/media/media-source/mediasource-config-change-mp4-av-video-bitrate-expected.txt: Added.
     23        * http/tests/media/media-source/mediasource-config-change-mp4-av-video-bitrate.html: Added.
     24        * http/tests/media/media-source/mediasource-config-change-mp4-v-bitrate-expected.txt: Added.
     25        * http/tests/media/media-source/mediasource-config-change-mp4-v-bitrate.html: Added.
     26        * http/tests/media/media-source/mediasource-config-change-mp4-v-framerate-expected.txt: Added.
     27        * http/tests/media/media-source/mediasource-config-change-mp4-v-framerate.html: Added.
     28        * http/tests/media/media-source/mediasource-config-change-mp4-v-framesize-expected.txt: Added.
     29        * http/tests/media/media-source/mediasource-config-change-mp4-v-framesize.html: Added.
     30        * http/tests/media/media-source/mediasource-config-change-webm-a-bitrate-expected.txt: Added.
     31        * http/tests/media/media-source/mediasource-config-change-webm-a-bitrate.html: Added.
     32        * http/tests/media/media-source/mediasource-config-change-webm-av-audio-bitrate-expected.txt: Added.
     33        * http/tests/media/media-source/mediasource-config-change-webm-av-audio-bitrate.html: Added.
     34        * http/tests/media/media-source/mediasource-config-change-webm-av-framesize-expected.txt: Added.
     35        * http/tests/media/media-source/mediasource-config-change-webm-av-framesize.html: Added.
     36        * http/tests/media/media-source/mediasource-config-change-webm-av-video-bitrate-expected.txt: Added.
     37        * http/tests/media/media-source/mediasource-config-change-webm-av-video-bitrate.html: Added.
     38        * http/tests/media/media-source/mediasource-config-change-webm-v-bitrate-expected.txt: Added.
     39        * http/tests/media/media-source/mediasource-config-change-webm-v-bitrate.html: Added.
     40        * http/tests/media/media-source/mediasource-config-change-webm-v-framerate-expected.txt: Added.
     41        * http/tests/media/media-source/mediasource-config-change-webm-v-framerate.html: Added.
     42        * http/tests/media/media-source/mediasource-config-change-webm-v-framesize-expected.txt: Added.
     43        * http/tests/media/media-source/mediasource-config-change-webm-v-framesize.html: Added.
     44        * http/tests/media/media-source/mediasource-config-changes.js: Added.
     45        * http/tests/media/media-source/mediasource-is-type-supported-expected.txt: Added.
     46        * http/tests/media/media-source/mediasource-is-type-supported.html: Added.
     47        * http/tests/media/media-source/mediasource-multiple-attach-expected.txt: Added.
     48        * http/tests/media/media-source/mediasource-multiple-attach.html: Added.
     49        * http/tests/media/media-source/mediasource-play-expected.txt: Added.
     50        * http/tests/media/media-source/mediasource-play.html: Added.
     51        * http/tests/media/media-source/mediasource-sourcebufferlist-expected.txt: Added.
     52        * http/tests/media/media-source/mediasource-sourcebufferlist.html: Added.
     53        * http/tests/media/media-source/mediasource-util.js: Added.
     54        * http/tests/media/media-source/video-media-source-objects-expected.txt:
     55        * http/tests/media/resources/media-source/generate-config-change-tests.py: Added.
     56        * http/tests/media/resources/media-source/mp4/test-a-128k-44100Hz-1ch-manifest.json: Added.
     57        * http/tests/media/resources/media-source/mp4/test-a-192k-44100Hz-1ch-manifest.json: Added.
     58        * http/tests/media/resources/media-source/mp4/test-av-384k-44100Hz-1ch-320x240-30fps-10kfr-manifest.json: Added.
     59        * http/tests/media/resources/media-source/mp4/test-av-384k-44100Hz-1ch-640x480-30fps-10kfr-manifest.json: Added.
     60        * http/tests/media/resources/media-source/mp4/test-av-448k-44100Hz-1ch-640x480-30fps-10kfr-manifest.json: Added.
     61        * http/tests/media/resources/media-source/mp4/test-av-640k-44100Hz-1ch-640x480-30fps-10kfr-manifest.json: Added.
     62        * http/tests/media/resources/media-source/mp4/test-v-128k-320x240-24fps-8kfr-manifest.json: Added.
     63        * http/tests/media/resources/media-source/mp4/test-v-128k-320x240-30fps-10kfr-manifest.json: Added.
     64        * http/tests/media/resources/media-source/mp4/test-v-128k-640x480-30fps-10kfr-manifest.json: Added.
     65        * http/tests/media/resources/media-source/mp4/test-v-256k-320x240-30fps-10kfr-manifest.json: Added.
     66        * http/tests/media/resources/media-source/webm/test-a-128k-44100Hz-1ch-manifest.json: Added.
     67        * http/tests/media/resources/media-source/webm/test-a-192k-44100Hz-1ch-manifest.json: Added.
     68        * http/tests/media/resources/media-source/webm/test-av-384k-44100Hz-1ch-320x240-30fps-10kfr-manifest.json: Added.
     69        * http/tests/media/resources/media-source/webm/test-av-384k-44100Hz-1ch-640x480-30fps-10kfr-manifest.json: Added.
     70        * http/tests/media/resources/media-source/webm/test-av-448k-44100Hz-1ch-640x480-30fps-10kfr-manifest.json: Added.
     71        * http/tests/media/resources/media-source/webm/test-av-640k-44100Hz-1ch-640x480-30fps-10kfr-manifest.json: Added.
     72        * http/tests/media/resources/media-source/webm/test-v-128k-320x240-24fps-8kfr-manifest.json: Added.
     73        * http/tests/media/resources/media-source/webm/test-v-128k-320x240-30fps-10kfr-manifest.json: Added.
     74        * http/tests/media/resources/media-source/webm/test-v-128k-640x480-30fps-10kfr-manifest.json: Added.
     75        * http/tests/media/resources/media-source/webm/test-v-256k-320x240-30fps-10kfr-manifest.json: Added.
     76
    1772013-09-18  Filip Pizlo  <fpizlo@apple.com>
    278
  • trunk/LayoutTests/http/tests/media/media-source/video-media-source-objects-expected.txt

    r134648 r156049  
    33EVENT(webkitsourceopen)
    44Test MediaSource object type
    5 EXPECTED (mediaSource == '[object MediaSource]') OK
     5EXPECTED (mediaSource == '[object WebKitMediaSource]') OK
    66EXPECTED (mediaSource instanceof window.WebKitMediaSource == 'true') OK
    77
     
    1212
    1313Test SourceBufferList object type:
    14 EXPECTED (mediaSource.sourceBuffers == '[object SourceBufferList]') OK
     14EXPECTED (mediaSource.sourceBuffers == '[object WebKitSourceBufferList]') OK
    1515EXPECTED (mediaSource.sourceBuffers instanceof window.WebKitSourceBufferList == 'true') OK
    1616
     
    4040RUN(mediaSource.removeSourceBuffer(segmentHelper.sourceBuffer))
    4141EXPECTED (mediaSource.sourceBuffers.length == '0') OK
    42 EXPECTED (mediaSource.sourceBuffers == '[object SourceBufferList]') OK
     42EXPECTED (mediaSource.sourceBuffers == '[object WebKitSourceBufferList]') OK
    4343
    4444Test that append() throws an error after SourceBuffer has been removed.
  • trunk/Source/WebCore/CMakeLists.txt

    r156038 r156049  
    211211    Modules/mediasource/SourceBuffer.idl
    212212    Modules/mediasource/SourceBufferList.idl
     213    Modules/mediasource/URLMediaSource.idl
     214    Modules/mediasource/WebKitMediaSource.idl
     215    Modules/mediasource/WebKitSourceBuffer.idl
     216    Modules/mediasource/WebKitSourceBufferList.idl
    213217
    214218    Modules/mediastream/MediaStream.idl
     
    14631467    html/PasswordInputType.cpp
    14641468    html/PluginDocument.cpp
     1469    html/PublicURLManager.cpp
    14651470    html/RadioInputType.cpp
    14661471    html/RadioNodeList.cpp
  • trunk/Source/WebCore/ChangeLog

    r156041 r156049  
     12013-09-18  Jer Noble  <jer.noble@apple.com>
     2
     3        Merge blink MediaSource changes since fork.
     4        https://bugs.webkit.org/show_bug.cgi?id=118752
     5
     6        Rubber-stamped by Eric Carlson.
     7
     8        Tests: http/tests/media/media-source/mediasource-addsourcebuffer.html
     9               http/tests/media/media-source/mediasource-append-buffer.html
     10               http/tests/media/media-source/mediasource-buffered.html
     11               http/tests/media/media-source/mediasource-closed.html
     12               http/tests/media/media-source/mediasource-config-change-mp4-a-bitrate.html
     13               http/tests/media/media-source/mediasource-config-change-mp4-av-audio-bitrate.html
     14               http/tests/media/media-source/mediasource-config-change-mp4-av-framesize.html
     15               http/tests/media/media-source/mediasource-config-change-mp4-av-video-bitrate.html
     16               http/tests/media/media-source/mediasource-config-change-mp4-v-bitrate.html
     17               http/tests/media/media-source/mediasource-config-change-mp4-v-framerate.html
     18               http/tests/media/media-source/mediasource-config-change-mp4-v-framesize.html
     19               http/tests/media/media-source/mediasource-config-change-webm-a-bitrate.html
     20               http/tests/media/media-source/mediasource-config-change-webm-av-audio-bitrate.html
     21               http/tests/media/media-source/mediasource-config-change-webm-av-framesize.html
     22               http/tests/media/media-source/mediasource-config-change-webm-av-video-bitrate.html
     23               http/tests/media/media-source/mediasource-config-change-webm-v-bitrate.html
     24               http/tests/media/media-source/mediasource-config-change-webm-v-framerate.html
     25               http/tests/media/media-source/mediasource-config-change-webm-v-framesize.html
     26               http/tests/media/media-source/mediasource-is-type-supported.html
     27               http/tests/media/media-source/mediasource-multiple-attach.html
     28               http/tests/media/media-source/mediasource-play.html
     29               http/tests/media/media-source/mediasource-sourcebufferlist.html
     30
     31        Add files to project. Fix compile errors exposed by enabling.
     32
     33        * WebCore.xcodeproj/project.pbxproj:
     34        * Modules/mediasource/MediaSourceRegistry.cpp:
     35        (WebCore::MediaSourceRegistry::lookupMediaSource):
     36        * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
     37        (WebCore::MediaPlayerPrivateAVFoundation::load):
     38        * platform/graphics/mac/MediaPlayerPrivateQTKit.h:
     39        (WebCore::MediaPlayerPrivateQTKit::load):
     40        * platform/mac/MIMETypeRegistryMac.mm:
     41        (WebCore::MIMETypeRegistry::isSupportedMediaSourceMIMEType):
     42        * CMakeLists.txt:
     43        * DerivedSources.make:
     44        * DerivedSources.pri:
     45        * GNUmakefile.list.am:
     46
     47        Merge
     48        https://chromium.googlesource.com/chromium/blink/+/c38e2955db98a300a535b692869fea0e41501497
     49        https://chromium.googlesource.com/chromium/blink/+/8568015e9bee1de7fccee28163f9e4a4b51f9baf
     50        https://chromium.googlesource.com/chromium/blink/+/14417e8fa6294f4e7dbc1e0fac549398522b2f97
     51        https://chromium.googlesource.com/chromium/blink/+/f43a5496f233102f8861a067a9cf8053c010d401
     52        https://chromium.googlesource.com/chromium/blink/+/57771439806f7c6e6a272efb1ea72900f5f6a015
     53        https://chromium.googlesource.com/chromium/blink/+/8c77a790a9d225194db0a8832399d0f9e1fa54ec
     54        https://chromium.googlesource.com/chromium/blink/+/d33ae3fa7a8592e946503ed17f862a27c6d9dde1
     55        https://chromium.googlesource.com/chromium/blink/+/1caaa9c51f06e1b9341d58c994f77fd59fcd236d
     56        https://chromium.googlesource.com/chromium/blink/+/e95720393b0ebe67f19de39bb77cdf2926165512
     57        https://chromium.googlesource.com/chromium/blink/+/bad2c1b4b70faec731b2ad3cc8a4ccf28de6cc38
     58        https://chromium.googlesource.com/chromium/blink/+/a7873430c3d5c9373336c6f3993db3cb4228e9cd
     59        https://chromium.googlesource.com/chromium/blink/+/508966d5e32360b3cec058f9fbae0014542fbc52
     60        https://chromium.googlesource.com/chromium/blink/+/371dfe72f61ce6f73e6c242324da73c415d38be3
     61
    1622013-09-18  Andreas Kling  <akling@apple.com>
    263
  • trunk/Source/WebCore/DerivedSources.cpp

    r155367 r156049  
    269269#include "JSMediaQueryListListener.cpp"
    270270#if ENABLE(MEDIA_SOURCE)
    271 #include "JSMediaSource.cpp"
     271#include "JSWebKitMediaSource.cpp"
    272272#endif
    273273#include "JSMessageChannel.cpp"
     
    313313#include "JSSharedWorkerGlobalScope.cpp"
    314314#if ENABLE(MEDIA_SOURCE)
    315 #include "JSSourceBuffer.cpp"
    316 #include "JSSourceBufferList.cpp"
     315#include "JSWebKitSourceBuffer.cpp"
     316#include "JSWebKitSourceBufferList.cpp"
    317317#endif
    318318#include "JSSQLError.cpp"
  • trunk/Source/WebCore/DerivedSources.make

    r155992 r156049  
    114114    $(WebCore)/Modules/indexeddb/WorkerGlobalScopeIndexedDatabase.idl \
    115115    $(WebCore)/Modules/indieui/UIRequestEvent.idl \
    116     $(WebCore)/Modules/mediasource/MediaSource.idl \
     116        $(WebCore)/Modules/mediasource/MediaSource.idl \
     117        $(WebCore)/Modules/mediasource/SourceBuffer.idl \
     118        $(WebCore)/Modules/mediasource/SourceBufferList.idl \
     119        $(WebCore)/Modules/mediasource/URLMediaSource.idl \
     120    $(WebCore)/Modules/mediasource/WebKitMediaSource.idl \
     121    $(WebCore)/Modules/mediasource/WebKitSourceBuffer.idl \
     122    $(WebCore)/Modules/mediasource/WebKitSourceBufferList.idl \
    117123    $(WebCore)/Modules/mediasource/SourceBuffer.idl \
    118124    $(WebCore)/Modules/mediasource/SourceBufferList.idl \
  • trunk/Source/WebCore/DerivedSources.pri

    r155790 r156049  
    663663    $$PWD/Modules/mediasource/MediaSource.idl \
    664664    $$PWD/Modules/mediasource/SourceBuffer.idl \
    665     $$PWD/Modules/mediasource/SourceBufferList.idl
     665    $$PWD/Modules/mediasource/SourceBufferList.idl \
     666    $$PWD/Modules/mediasource/URLMediaSource.idl \
     667    $$PWD/Modules/mediasource/WebKitMediaSource.idl \
     668    $$PWD/Modules/mediasource/WebKitSourceBuffer.idl \
     669    $$PWD/Modules/mediasource/WebKitSourceBufferList.idl
    666670}
    667671
  • trunk/Source/WebCore/GNUmakefile.list.am

    r156038 r156049  
    501501        DerivedSources/WebCore/JSMediaSource.cpp \
    502502        DerivedSources/WebCore/JSMediaSource.h \
     503        DerivedSources/WebCore/JSWebKitMediaSource.cpp \
     504        DerivedSources/WebCore/JSWebKitMediaSource.h \
    503505        DerivedSources/WebCore/JSMediaStream.cpp \
    504506        DerivedSources/WebCore/JSMediaStream.h \
     
    671673        DerivedSources/WebCore/JSSourceInfo.cpp \
    672674        DerivedSources/WebCore/JSSourceInfo.h \
     675        DerivedSources/WebCore/JSWebKitSourceBuffer.cpp \
     676        DerivedSources/WebCore/JSWebKitSourceBuffer.h \
     677        DerivedSources/WebCore/JSWebKitSourceBufferList.cpp \
     678        DerivedSources/WebCore/JSWebKitSourceBufferList.h \
    673679        DerivedSources/WebCore/JSSpeechInputEvent.cpp \
    674680        DerivedSources/WebCore/JSSpeechInputEvent.h \
     
    12431249        $(WebCore)/Modules/mediasource/SourceBuffer.idl \
    12441250        $(WebCore)/Modules/mediasource/SourceBufferList.idl \
     1251        $(WebCore)/Modules/mediasource/URLMediaSource.idl \
     1252        $(WebCore)/Modules/mediasource/WebKitMediaSource.idl \
     1253        $(WebCore)/Modules/mediasource/WebKitSourceBuffer.idl \
     1254        $(WebCore)/Modules/mediasource/WebKitSourceBufferList.idl \
    12451255        $(WebCore)/Modules/mediastream/MediaStream.idl \
    12461256        $(WebCore)/Modules/mediastream/MediaStreamEvent.idl \
     
    19431953        Source/WebCore/Modules/mediasource/MediaSource.cpp \
    19441954        Source/WebCore/Modules/mediasource/MediaSource.h \
     1955        Source/WebCore/Modules/mediasource/MediaSourceBase.cpp \
     1956        Source/WebCore/Modules/mediasource/MediaSourceBase.h \
    19451957        Source/WebCore/Modules/mediasource/MediaSourceRegistry.cpp \
    19461958        Source/WebCore/Modules/mediasource/MediaSourceRegistry.h \
     
    19491961        Source/WebCore/Modules/mediasource/SourceBufferList.cpp \
    19501962        Source/WebCore/Modules/mediasource/SourceBufferList.h \
     1963        Source/WebCore/Modules/mediasource/URLMediaSource.cpp \
     1964        Source/WebCore/Modules/mediasource/URLMediaSource.h \
     1965        Source/WebCore/Modules/mediasource/WebKitMediaSource.cpp \
     1966        Source/WebCore/Modules/mediasource/WebKitMediaSource.h \
     1967        Source/WebCore/Modules/mediasource/WebKitSourceBuffer.cpp \
     1968        Source/WebCore/Modules/mediasource/WebKitSourceBuffer.h \
     1969        Source/WebCore/Modules/mediasource/WebKitSourceBufferList.cpp \
     1970        Source/WebCore/Modules/mediasource/WebKitSourceBufferList.h \
    19511971        Source/WebCore/Modules/mediastream/MediaConstraintsImpl.cpp \
    19521972        Source/WebCore/Modules/mediastream/MediaConstraintsImpl.h \
     
    37083728        Source/WebCore/html/PluginDocument.cpp \
    37093729        Source/WebCore/html/PluginDocument.h \
     3730        Source/WebCore/html/PublicURLManager.cpp \
    37103731        Source/WebCore/html/PublicURLManager.h \
    37113732        Source/WebCore/html/RadioInputType.cpp \
  • trunk/Source/WebCore/Modules/mediasource/MediaSource.cpp

    r155356 r156049  
    11/*
    2  * Copyright (C) 2012 Google Inc. All rights reserved.
     2 * Copyright (C) 2013 Google Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    3535
    3636#include "ContentType.h"
    37 #include "Event.h"
     37#include "ExceptionCodePlaceholder.h"
     38#include "GenericEventQueue.h"
     39#include "Logging.h"
    3840#include "MIMETypeRegistry.h"
     41#include "MediaSourceRegistry.h"
    3942#include "SourceBufferPrivate.h"
    4043#include "TimeRanges.h"
    4144#include <runtime/Uint8Array.h>
     45#include <wtf/text/CString.h>
    4246
    4347namespace WebCore {
     
    5155
    5256MediaSource::MediaSource(ScriptExecutionContext* context)
    53     : ActiveDOMObject(context)
    54     , m_readyState(closedKeyword())
    55     , m_asyncEventQueue(*this)
    56     , m_sourceBuffers(SourceBufferList::create(scriptExecutionContext(), m_asyncEventQueue))
    57     , m_activeSourceBuffers(SourceBufferList::create(scriptExecutionContext(), m_asyncEventQueue))
    58 {
    59 }
    60 
    61 const String& MediaSource::openKeyword()
    62 {
    63     DEFINE_STATIC_LOCAL(const String, open, (ASCIILiteral("open")));
    64     return open;
    65 }
    66 
    67 const String& MediaSource::closedKeyword()
    68 {
    69     DEFINE_STATIC_LOCAL(const String, closed, (ASCIILiteral("closed")));
    70     return closed;
    71 }
    72 
    73 const String& MediaSource::endedKeyword()
    74 {
    75     DEFINE_STATIC_LOCAL(const String, ended, (ASCIILiteral("ended")));
    76     return ended;
    77 }
    78 
    79 SourceBufferList* MediaSource::sourceBuffers()
    80 {
    81     return m_sourceBuffers.get();
    82 }
    83 
    84 SourceBufferList* MediaSource::activeSourceBuffers()
    85 {
    86     // FIXME(91649): support track selection
    87     return m_activeSourceBuffers.get();
    88 }
    89 
    90 double MediaSource::duration() const
    91 {
    92     return m_readyState == closedKeyword() ? std::numeric_limits<float>::quiet_NaN() : m_private->duration();
    93 }
    94 
    95 void MediaSource::setDuration(double duration, ExceptionCode& ec)
    96 {
    97     if (duration < 0.0 || std::isnan(duration)) {
    98         ec = INVALID_ACCESS_ERR;
    99         return;
    100     }
    101     if (m_readyState != openKeyword()) {
    102         ec = INVALID_STATE_ERR;
    103         return;
    104     }
    105     m_private->setDuration(duration);
     57    : MediaSourceBase(context)
     58{
     59    LOG(Media, "MediaSource::MediaSource %p", this);
     60    m_sourceBuffers = SourceBufferList::create(scriptExecutionContext());
     61    m_activeSourceBuffers = SourceBufferList::create(scriptExecutionContext());
     62}
     63
     64MediaSource::~MediaSource()
     65{
     66    LOG(Media, "MediaSource::~MediaSource %p", this);
     67    ASSERT(isClosed());
    10668}
    10769
    10870SourceBuffer* MediaSource::addSourceBuffer(const String& type, ExceptionCode& ec)
    10971{
    110     // 3.1 http://dvcs.w3.org/hg/html-media/raw-file/tip/media-source/media-source.html#dom-addsourcebuffer
     72    LOG(Media, "MediaSource::addSourceBuffer(%s) %p", type.ascii().data(), this);
     73
     74    // 2.2 https://dvcs.w3.org/hg/html-media/raw-file/default/media-source/media-source.html#widl-MediaSource-addSourceBuffer-SourceBuffer-DOMString-type
    11175    // 1. If type is null or an empty then throw an INVALID_ACCESS_ERR exception and
    11276    // abort these steps.
     
    12589    // 4. If the readyState attribute is not in the "open" state then throw an
    12690    // INVALID_STATE_ERR exception and abort these steps.
    127     if (!m_private || m_readyState != openKeyword()) {
     91    if (!isOpen()) {
    12892        ec = INVALID_STATE_ERR;
    12993        return 0;
     
    13397    ContentType contentType(type);
    13498    Vector<String> codecs = contentType.codecs();
    135     OwnPtr<SourceBufferPrivate> sourceBufferPrivate;
    136     switch (m_private->addSourceBuffer(contentType.type(), codecs, &sourceBufferPrivate)) {
    137     case MediaSourcePrivate::Ok: {
    138         ASSERT(sourceBufferPrivate);
    139         RefPtr<SourceBuffer> buffer = SourceBuffer::create(sourceBufferPrivate.release(), this);
    140 
    141         // 6. Add the new object to sourceBuffers and fire a addsourcebuffer on that object.
    142         m_sourceBuffers->add(buffer);
    143         m_activeSourceBuffers->add(buffer);
    144         // 7. Return the new object to the caller.
    145         return buffer.get();
    146     }
    147     case MediaSourcePrivate::NotSupported:
    148         // 2 (cont). If type contains a MIME type ... that is not supported with the types
    149         // specified for the other SourceBuffer objects in sourceBuffers, then throw
    150         // a NOT_SUPPORTED_ERR exception and abort these steps.
    151         ec = NOT_SUPPORTED_ERR;
    152         return 0;
    153     case MediaSourcePrivate::ReachedIdLimit:
    154         // 3 (cont). If the user agent can't handle any more SourceBuffer objects then throw
    155         // a QUOTA_EXCEEDED_ERR exception and abort these steps.
    156         ec = QUOTA_EXCEEDED_ERR;
    157         return 0;
    158     }
    159 
    160     ASSERT_NOT_REACHED();
    161     return 0;
     99    OwnPtr<SourceBufferPrivate> sourceBufferPrivate = createSourceBufferPrivate(contentType.type(), codecs, ec);
     100
     101    if (!sourceBufferPrivate) {
     102        ASSERT(ec == NOT_SUPPORTED_ERR || ec == QUOTA_EXCEEDED_ERR);
     103        // 2. If type contains a MIME type that is not supported ..., then throw a NOT_SUPPORTED_ERR exception and abort these steps.
     104        // 3. If the user agent can't handle any more SourceBuffer objects then throw a QUOTA_EXCEEDED_ERR exception and abort these steps
     105        return 0;
     106    }
     107
     108    RefPtr<SourceBuffer> buffer = SourceBuffer::create(sourceBufferPrivate.release(), this);
     109    // 6. Add the new object to sourceBuffers and fire a addsourcebuffer on that object.
     110    m_sourceBuffers->add(buffer);
     111    m_activeSourceBuffers->add(buffer);
     112    // 7. Return the new object to the caller.
     113    return buffer.get();
    162114}
    163115
    164116void MediaSource::removeSourceBuffer(SourceBuffer* buffer, ExceptionCode& ec)
    165117{
    166     // 3.1 http://dvcs.w3.org/hg/html-media/raw-file/tip/media-source/media-source.html#dom-removesourcebuffer
     118    LOG(Media, "MediaSource::removeSourceBuffer() %p", this);
     119    RefPtr<SourceBuffer> protect(buffer);
     120
     121    // 2.2 https://dvcs.w3.org/hg/html-media/raw-file/default/media-source/media-source.html#widl-MediaSource-removeSourceBuffer-void-SourceBuffer-sourceBuffer
    167122    // 1. If sourceBuffer is null then throw an INVALID_ACCESS_ERR exception and
    168123    // abort these steps.
     
    172127    }
    173128
    174     // 2. If sourceBuffers is empty then throw an INVALID_STATE_ERR exception and
    175     // abort these steps.
    176     if (!m_private || !m_sourceBuffers->length()) {
    177         ec = INVALID_STATE_ERR;
    178         return;
    179     }
    180 
    181     // 3. If sourceBuffer specifies an object that is not in sourceBuffers then
     129    // 2. If sourceBuffer specifies an object that is not in sourceBuffers then
    182130    // throw a NOT_FOUND_ERR exception and abort these steps.
    183     // 6. Remove sourceBuffer from sourceBuffers and fire a removesourcebuffer event
     131    if (!m_sourceBuffers->length() || !m_sourceBuffers->contains(buffer)) {
     132        ec = NOT_FOUND_ERR;
     133        return;
     134    }
     135
     136    // 3. If the sourceBuffer.updating attribute equals true, then run the following steps: ...
     137    buffer->abortIfUpdating();
     138
     139    // Steps 4-9 are related to updating audioTracks, videoTracks, and textTracks which aren't implmented yet.
     140    // FIXME(91649): support track selection
     141
     142    // 10. If sourceBuffer is in activeSourceBuffers, then remove sourceBuffer from activeSourceBuffers ...
     143    m_activeSourceBuffers->remove(buffer);
     144
     145    // 11. Remove sourceBuffer from sourceBuffers and fire a removesourcebuffer event
    184146    // on that object.
    185     if (!m_sourceBuffers->remove(buffer)) {
    186         ec = NOT_FOUND_ERR;
    187         return;
    188     }
    189 
    190     // 7. Destroy all resources for sourceBuffer.
    191     m_activeSourceBuffers->remove(buffer);
    192 
    193     // 4. Remove track information from audioTracks, videoTracks, and textTracks for all tracks
    194     // associated with sourceBuffer and fire a simple event named change on the modified lists.
    195     // FIXME(91649): support track selection
    196 
    197     // 5. If sourceBuffer is in activeSourceBuffers, then remove it from that list and fire a
    198     // removesourcebuffer event on that object.
    199     // FIXME(91649): support track selection
    200 }
    201 
    202 const String& MediaSource::readyState() const
    203 {
    204     return m_readyState;
    205 }
    206 
    207 void MediaSource::setReadyState(const String& state)
    208 {
    209     ASSERT(state == openKeyword() || state == closedKeyword() || state == endedKeyword());
    210     if (m_readyState == state)
    211         return;
    212 
    213     String oldState = m_readyState;
    214     m_readyState = state;
    215 
    216     if (m_readyState == closedKeyword()) {
    217         m_sourceBuffers->clear();
    218         m_activeSourceBuffers->clear();
    219         m_private.clear();
    220         scheduleEvent(eventNames().webkitsourcecloseEvent);
    221         return;
    222     }
    223 
    224     if (oldState == openKeyword() && m_readyState == endedKeyword()) {
    225         scheduleEvent(eventNames().webkitsourceendedEvent);
    226         return;
    227     }
    228 
    229     if (m_readyState == openKeyword()) {
    230         scheduleEvent(eventNames().webkitsourceopenEvent);
    231         return;
    232     }
    233 }
    234 
    235 void MediaSource::endOfStream(const String& error, ExceptionCode& ec)
    236 {
    237     // 3.1 http://dvcs.w3.org/hg/html-media/raw-file/tip/media-source/media-source.html#dom-endofstream
    238     // 1. If the readyState attribute is not in the "open" state then throw an
    239     // INVALID_STATE_ERR exception and abort these steps.
    240     if (!m_private || m_readyState != openKeyword()) {
    241         ec = INVALID_STATE_ERR;
    242         return;
    243     }
    244 
    245     MediaSourcePrivate::EndOfStreamStatus eosStatus = MediaSourcePrivate::EosNoError;
    246 
    247     if (error.isNull() || error.isEmpty())
    248         eosStatus = MediaSourcePrivate::EosNoError;
    249     else if (error == "network")
    250         eosStatus = MediaSourcePrivate::EosNetworkError;
    251     else if (error == "decode")
    252         eosStatus = MediaSourcePrivate::EosDecodeError;
    253     else {
    254         ec = INVALID_ACCESS_ERR;
    255         return;
    256     }
    257 
    258     // 2. Change the readyState attribute value to "ended".
    259     setReadyState(endedKeyword());
    260     m_private->endOfStream(eosStatus);
     147    m_sourceBuffers->remove(buffer);
     148
     149    // 12. Destroy all resources for sourceBuffer.
     150    buffer->removedFromMediaSource();
     151}
     152
     153void MediaSource::onReadyStateChange(const AtomicString& oldState, const AtomicString& newState)
     154{
     155    if (isOpen()) {
     156        scheduleEvent(eventNames().sourceopenEvent);
     157        return;
     158    }
     159
     160    if (oldState == openKeyword() && newState == endedKeyword()) {
     161        scheduleEvent(eventNames().sourceendedEvent);
     162        return;
     163    }
     164
     165    ASSERT(isClosed());
     166
     167    m_activeSourceBuffers->clear();
     168
     169    // Clear SourceBuffer references to this object.
     170    for (unsigned long i = 0; i < m_sourceBuffers->length(); ++i)
     171        m_sourceBuffers->item(i)->removedFromMediaSource();
     172    m_sourceBuffers->clear();
     173
     174    scheduleEvent(eventNames().sourcecloseEvent);
     175}
     176
     177Vector<RefPtr<TimeRanges> > MediaSource::activeRanges() const
     178{
     179    Vector<RefPtr<TimeRanges> > activeRanges(m_activeSourceBuffers->length());
     180    for (size_t i = 0; i < m_activeSourceBuffers->length(); ++i)
     181        activeRanges[i] = m_activeSourceBuffers->item(i)->buffered(ASSERT_NO_EXCEPTION);
     182
     183    return activeRanges;
    261184}
    262185
    263186bool MediaSource::isTypeSupported(const String& type)
    264187{
    265     // Section 2.1 isTypeSupported() method steps.
     188    LOG(Media, "MediaSource::isTypeSupported(%s)", type.ascii().data());
     189
     190    // Section 2.2 isTypeSupported() method steps.
    266191    // https://dvcs.w3.org/hg/html-media/raw-file/tip/media-source/media-source.html#widl-MediaSource-isTypeSupported-boolean-DOMString-type
    267192    // 1. If type is an empty string, then return false.
     
    283208}
    284209
    285 void MediaSource::setPrivateAndOpen(PassOwnPtr<MediaSourcePrivate> mediaSourcePrivate)
    286 {
    287     ASSERT(mediaSourcePrivate);
    288     ASSERT(!m_private);
    289     m_private = mediaSourcePrivate;
    290     setReadyState(openKeyword());
    291 }
    292 
    293210const AtomicString& MediaSource::interfaceName() const
    294211{
     
    296213}
    297214
    298 ScriptExecutionContext* MediaSource::scriptExecutionContext() const
    299 {
    300     return ActiveDOMObject::scriptExecutionContext();
    301 }
    302 
    303 bool MediaSource::hasPendingActivity() const
    304 {
    305     return m_private || m_asyncEventQueue.hasPendingEvents() || ActiveDOMObject::hasPendingActivity();
    306 }
    307 
    308 void MediaSource::stop()
    309 {
    310     m_private.clear();
    311     m_asyncEventQueue.cancelAllEvents();
    312 }
    313 
    314 EventTargetData* MediaSource::eventTargetData()
    315 {
    316     return &m_eventTargetData;
    317 }
    318 
    319 EventTargetData& MediaSource::ensureEventTargetData()
    320 {
    321     return m_eventTargetData;
    322 }
    323 
    324 void MediaSource::scheduleEvent(const AtomicString& eventName)
    325 {
    326     RefPtr<Event> event = Event::create(eventName, false, false);
    327     event->setTarget(this);
    328     m_asyncEventQueue.enqueueEvent(event.release());
    329 }
    330 
    331215} // namespace WebCore
    332216
  • trunk/Source/WebCore/Modules/mediasource/MediaSource.h

    r155356 r156049  
    11/*
    2  * Copyright (C) 2012 Google Inc. All rights reserved.
     2 * Copyright (C) 2013 Google Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    3434#if ENABLE(MEDIA_SOURCE)
    3535
    36 #include "ActiveDOMObject.h"
    37 #include "GenericEventQueue.h"
    38 #include "MediaSourcePrivate.h"
     36#include "MediaSourceBase.h"
     37#include "ScriptWrappable.h"
    3938#include "SourceBuffer.h"
    4039#include "SourceBufferList.h"
     
    4342namespace WebCore {
    4443
    45 class MediaSource : public RefCounted<MediaSource>, public EventTarget, public ActiveDOMObject {
     44class MediaSource : public MediaSourceBase, public ScriptWrappable {
    4645public:
    47     static const String& openKeyword();
    48     static const String& closedKeyword();
    49     static const String& endedKeyword();
    50 
    5146    static PassRefPtr<MediaSource> create(ScriptExecutionContext*);
    52     virtual ~MediaSource() { }
     47    virtual ~MediaSource();
    5348
    5449    // MediaSource.idl methods
    55     SourceBufferList* sourceBuffers();
    56     SourceBufferList* activeSourceBuffers();
    57     double duration() const;
    58     void setDuration(double, ExceptionCode&);
     50    SourceBufferList* sourceBuffers() { return m_sourceBuffers.get(); }
     51    SourceBufferList* activeSourceBuffers() { return m_activeSourceBuffers.get(); }
    5952    SourceBuffer* addSourceBuffer(const String& type, ExceptionCode&);
    6053    void removeSourceBuffer(SourceBuffer*, ExceptionCode&);
    61     const String& readyState() const;
    62     void setReadyState(const String&);
    63     void endOfStream(const String& error, ExceptionCode&);
    6454    static bool isTypeSupported(const String& type);
    65 
    66     void setPrivateAndOpen(PassOwnPtr<MediaSourcePrivate>);
    6755
    6856    // EventTarget interface
    6957    virtual const AtomicString& interfaceName() const OVERRIDE;
    70     virtual ScriptExecutionContext* scriptExecutionContext() const OVERRIDE;
    7158
    72     // ActiveDOMObject interface
    73     virtual bool hasPendingActivity() const OVERRIDE;
    74 
    75     using RefCounted<MediaSource>::ref;
    76     using RefCounted<MediaSource>::deref;
     59    using RefCounted<MediaSourceBase>::ref;
     60    using RefCounted<MediaSourceBase>::deref;
    7761
    7862private:
    7963    explicit MediaSource(ScriptExecutionContext*);
    8064
    81     // ActiveDOMObject interface
    82     virtual void stop() OVERRIDE;
     65    // MediaSourceBase interface
     66    virtual void onReadyStateChange(const AtomicString&, const AtomicString&) OVERRIDE;
     67    virtual Vector<RefPtr<TimeRanges> > activeRanges() const OVERRIDE;
    8368
    84     virtual EventTargetData* eventTargetData() OVERRIDE;
    85     virtual EventTargetData& ensureEventTargetData() OVERRIDE;
    86 
    87     virtual void refEventTarget() OVERRIDE { ref(); }
    88     virtual void derefEventTarget() OVERRIDE { deref(); }
    89 
    90     void scheduleEvent(const AtomicString& eventName);
    91 
    92     EventTargetData m_eventTargetData;
    93 
    94     String m_readyState;
    95     OwnPtr<MediaSourcePrivate> m_private;
    96 
    97     GenericEventQueue m_asyncEventQueue;
    9869    RefPtr<SourceBufferList> m_sourceBuffers;
    9970    RefPtr<SourceBufferList> m_activeSourceBuffers;
     
    10374
    10475#endif
     76
    10577#endif
  • trunk/Source/WebCore/Modules/mediasource/MediaSource.idl

    r151495 r156049  
    11/*
    2  * Copyright (C) 2012 Google Inc. All rights reserved.
     2 * Copyright (C) 2013 Google Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    3333    ActiveDOMObject,
    3434    EventTarget,
     35    JSGenerateToNativeObject,
    3536    Constructor,
    36     ConstructorCallWith=ScriptExecutionContext,
    37     InterfaceName=WebKitMediaSource
    38 ] interface MediaSource {
     37    ConstructorCallWith=ScriptExecutionContext
     38] interface MediaSource : EventTarget {
    3939    // All the source buffers created by this object.
    4040    readonly attribute SourceBufferList sourceBuffers;
     
    5353
    5454    static boolean isTypeSupported (DOMString type);
    55 
    56     // EventTarget interface
    57     void addEventListener(DOMString type,
    58                           EventListener listener,
    59                           optional boolean useCapture);
    60     void removeEventListener(DOMString type,
    61                              EventListener listener,
    62                              optional boolean useCapture);
    63     [RaisesException] boolean dispatchEvent(Event event);
    6455};
    65 
  • trunk/Source/WebCore/Modules/mediasource/MediaSourceBase.h

    r156048 r156049  
    11/*
    2  * Copyright (C) 2012 Google Inc. All rights reserved.
     2 * Copyright (C) 2013 Google Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    2929 */
    3030
    31 #ifndef MediaSource_h
    32 #define MediaSource_h
     31#ifndef MediaSourceBase_h
     32#define MediaSourceBase_h
    3333
    3434#if ENABLE(MEDIA_SOURCE)
    3535
    3636#include "ActiveDOMObject.h"
     37#include "EventTarget.h"
    3738#include "GenericEventQueue.h"
     39#include "HTMLMediaSource.h"
    3840#include "MediaSourcePrivate.h"
    39 #include "SourceBuffer.h"
    40 #include "SourceBufferList.h"
     41#include "URLRegistry.h"
     42#include <wtf/PassOwnPtr.h>
    4143#include <wtf/RefCounted.h>
     44#include <wtf/Vector.h>
    4245
    4346namespace WebCore {
    4447
    45 class MediaSource : public RefCounted<MediaSource>, public EventTarget, public ActiveDOMObject {
     48class GenericEventQueue;
     49
     50class MediaSourceBase : public RefCounted<MediaSourceBase>, public HTMLMediaSource, public ActiveDOMObject, public EventTarget {
    4651public:
    47     static const String& openKeyword();
    48     static const String& closedKeyword();
    49     static const String& endedKeyword();
     52    static const AtomicString& openKeyword();
     53    static const AtomicString& closedKeyword();
     54    static const AtomicString& endedKeyword();
    5055
    51     static PassRefPtr<MediaSource> create(ScriptExecutionContext*);
    52     virtual ~MediaSource() { }
     56    virtual ~MediaSourceBase();
    5357
    54     // MediaSource.idl methods
    55     SourceBufferList* sourceBuffers();
    56     SourceBufferList* activeSourceBuffers();
    57     double duration() const;
     58    void addedToRegistry();
     59    void removedFromRegistry();
     60    void openIfInEndedState();
     61    bool isOpen() const;
     62
     63    // HTMLMediaSource
     64    virtual bool attachToElement() OVERRIDE;
     65    virtual void setPrivateAndOpen(PassOwnPtr<MediaSourcePrivate>) OVERRIDE;
     66    virtual void close() OVERRIDE;
     67    virtual bool isClosed() const OVERRIDE;
     68    virtual double duration() const OVERRIDE;
     69    virtual PassRefPtr<TimeRanges> buffered() const OVERRIDE;
     70    virtual void refHTMLMediaSource() OVERRIDE { ref(); }
     71    virtual void derefHTMLMediaSource() OVERRIDE { deref(); }
     72
    5873    void setDuration(double, ExceptionCode&);
    59     SourceBuffer* addSourceBuffer(const String& type, ExceptionCode&);
    60     void removeSourceBuffer(SourceBuffer*, ExceptionCode&);
    61     const String& readyState() const;
    62     void setReadyState(const String&);
    63     void endOfStream(const String& error, ExceptionCode&);
    64     static bool isTypeSupported(const String& type);
     74    const AtomicString& readyState() const { return m_readyState; }
     75    void setReadyState(const AtomicString&);
     76    void endOfStream(const AtomicString& error, ExceptionCode&);
    6577
    66     void setPrivateAndOpen(PassOwnPtr<MediaSourcePrivate>);
    67 
    68     // EventTarget interface
    69     virtual const AtomicString& interfaceName() const OVERRIDE;
    70     virtual ScriptExecutionContext* scriptExecutionContext() const OVERRIDE;
    7178
    7279    // ActiveDOMObject interface
    7380    virtual bool hasPendingActivity() const OVERRIDE;
    74 
    75     using RefCounted<MediaSource>::ref;
    76     using RefCounted<MediaSource>::deref;
    77 
    78 private:
    79     explicit MediaSource(ScriptExecutionContext*);
    80 
    81     // ActiveDOMObject interface
    8281    virtual void stop() OVERRIDE;
    8382
     83    // EventTarget interface
     84    virtual ScriptExecutionContext* scriptExecutionContext() const OVERRIDE;
    8485    virtual EventTargetData* eventTargetData() OVERRIDE;
    8586    virtual EventTargetData& ensureEventTargetData() OVERRIDE;
    86 
    8787    virtual void refEventTarget() OVERRIDE { ref(); }
    8888    virtual void derefEventTarget() OVERRIDE { deref(); }
    8989
     90    // URLRegistrable interface
     91    virtual URLRegistry& registry() const OVERRIDE;
     92
     93    using RefCounted<MediaSourceBase>::ref;
     94    using RefCounted<MediaSourceBase>::deref;
     95
     96protected:
     97    explicit MediaSourceBase(ScriptExecutionContext*);
     98
     99    virtual void onReadyStateChange(const AtomicString& oldState, const AtomicString& newState) = 0;
     100    virtual Vector<RefPtr<TimeRanges> > activeRanges() const = 0;
     101
     102    PassOwnPtr<SourceBufferPrivate> createSourceBufferPrivate(const String& type, const MediaSourcePrivate::CodecsArray&, ExceptionCode&);
    90103    void scheduleEvent(const AtomicString& eventName);
     104    GenericEventQueue& asyncEventQueue() { return m_asyncEventQueue; }
    91105
     106private:
     107    OwnPtr<MediaSourcePrivate> m_private;
    92108    EventTargetData m_eventTargetData;
    93 
    94     String m_readyState;
    95     OwnPtr<MediaSourcePrivate> m_private;
    96 
     109    AtomicString m_readyState;
    97110    GenericEventQueue m_asyncEventQueue;
    98     RefPtr<SourceBufferList> m_sourceBuffers;
    99     RefPtr<SourceBufferList> m_activeSourceBuffers;
     111    bool m_attached;
    100112};
    101113
    102 } // namespace WebCore
     114}
    103115
    104116#endif
     117
    105118#endif
  • trunk/Source/WebCore/Modules/mediasource/MediaSourceRegistry.cpp

    r132115 r156049  
    3535
    3636#include "KURL.h"
    37 #include "MediaSource.h"
     37#include "MediaSourceBase.h"
    3838#include <wtf/MainThread.h>
    3939
     
    4747}
    4848
    49 void MediaSourceRegistry::registerMediaSourceURL(const KURL& url, PassRefPtr<MediaSource> source)
     49void MediaSourceRegistry::registerURL(SecurityOrigin*, const KURL& url, URLRegistrable* registrable)
    5050{
     51    ASSERT(&registrable->registry() == this);
    5152    ASSERT(isMainThread());
    5253
    53     source->setPendingActivity(source.get());
    54 
     54    MediaSourceBase* source = static_cast<MediaSourceBase*>(registrable);
     55    source->addedToRegistry();
    5556    m_mediaSources.set(url.string(), source);
    5657}
    5758
    58 void MediaSourceRegistry::unregisterMediaSourceURL(const KURL& url)
     59void MediaSourceRegistry::unregisterURL(const KURL& url)
    5960{
    6061    ASSERT(isMainThread());
    61     HashMap<String, RefPtr<MediaSource> >::iterator iter = m_mediaSources.find(url.string());
     62    HashMap<String, RefPtr<MediaSourceBase> >::iterator iter = m_mediaSources.find(url.string());
    6263    if (iter == m_mediaSources.end())
    6364        return;
    6465
    65     RefPtr<MediaSource> source = iter->value;
     66    RefPtr<MediaSourceBase> source = iter->value;
    6667    m_mediaSources.remove(iter);
    67 
    68     // Remove the pending activity added in registerMediaSourceURL().
    69     source->unsetPendingActivity(source.get());
     68    source->removedFromRegistry();
    7069}
    7170
    72 MediaSource* MediaSourceRegistry::lookupMediaSource(const String& url)
     71URLRegistrable* MediaSourceRegistry::lookup(const String& url)
    7372{
    7473    ASSERT(isMainThread());
    75     return m_mediaSources.get(url).get();
     74    return m_mediaSources.get(url);
     75}
     76
     77MediaSourceRegistry::MediaSourceRegistry()
     78{
     79    HTMLMediaSource::setRegistry(this);
    7680}
    7781
  • trunk/Source/WebCore/Modules/mediasource/MediaSourceRegistry.h

    r124953 r156049  
    3434#if ENABLE(MEDIA_SOURCE)
    3535
     36#include "URLRegistry.h"
    3637#include <wtf/HashMap.h>
    3738#include <wtf/PassRefPtr.h>
     
    4142
    4243class KURL;
    43 class MediaSource;
     44class MediaSourceBase;
    4445
    45 class MediaSourceRegistry {
     46class MediaSourceRegistry : public URLRegistry {
    4647public:
    4748    // Returns a single instance of MediaSourceRegistry.
     
    4950
    5051    // Registers a blob URL referring to the specified media source.
    51     void registerMediaSourceURL(const KURL&, PassRefPtr<MediaSource>);
    52     void unregisterMediaSourceURL(const KURL&);
    53 
    54     MediaSource* lookupMediaSource(const String& url);
     52    virtual void registerURL(SecurityOrigin*, const KURL&, URLRegistrable*) OVERRIDE;
     53    virtual void unregisterURL(const KURL&) OVERRIDE;
     54    virtual URLRegistrable* lookup(const String&) OVERRIDE;
    5555
    5656private:
    57     HashMap<String, RefPtr<MediaSource> > m_mediaSources;
     57    MediaSourceRegistry();
     58    HashMap<String, RefPtr<MediaSourceBase> > m_mediaSources;
    5859};
    5960
  • trunk/Source/WebCore/Modules/mediasource/SourceBuffer.cpp

    r153728 r156049  
    11/*
    2  * Copyright (C) 2012 Google Inc. All rights reserved.
     2 * Copyright (C) 2013 Google Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    3434#if ENABLE(MEDIA_SOURCE)
    3535
     36#include "Event.h"
     37#include "GenericEventQueue.h"
     38#include "Logging.h"
    3639#include "MediaSource.h"
    3740#include "SourceBufferPrivate.h"
    3841#include "TimeRanges.h"
    39 #include <runtime/Uint8Array.h>
    4042
    4143namespace WebCore {
    4244
    43 PassRefPtr<SourceBuffer> SourceBuffer::create(PassOwnPtr<SourceBufferPrivate> sourceBufferPrivate, PassRefPtr<MediaSource> source)
    44 {
    45     return adoptRef(new SourceBuffer(sourceBufferPrivate, source));
    46 }
    47 
    48 SourceBuffer::SourceBuffer(PassOwnPtr<SourceBufferPrivate> sourceBufferPrivate, PassRefPtr<MediaSource> source)
    49     : m_private(sourceBufferPrivate)
     45PassRefPtr<SourceBuffer> SourceBuffer::create(PassOwnPtr<SourceBufferPrivate> sourceBufferPrivate, MediaSource* source)
     46{
     47    RefPtr<SourceBuffer> sourceBuffer(adoptRef(new SourceBuffer(sourceBufferPrivate, source)));
     48    sourceBuffer->suspendIfNeeded();
     49    return sourceBuffer.release();
     50}
     51
     52SourceBuffer::SourceBuffer(PassOwnPtr<SourceBufferPrivate> sourceBufferPrivate, MediaSource* source)
     53    : ActiveDOMObject(source->scriptExecutionContext())
     54    , m_private(sourceBufferPrivate)
    5055    , m_source(source)
     56    , m_asyncEventQueue(*this)
     57    , m_updating(false)
    5158    , m_timestampOffset(0)
     59    , m_appendBufferTimer(this, &SourceBuffer::appendBufferTimerFired)
    5260{
    5361    ASSERT(m_private);
     
    5765SourceBuffer::~SourceBuffer()
    5866{
     67    ASSERT(isRemoved());
    5968}
    6069
     
    8998
    9099    // 4. If the readyState attribute of the parent media source is in the "ended" state then run the following steps:
    91     if (isEnded()) {
    92         // 4.1 Set the readyState attribute of the parent media source to "open"
    93         // 4.2 Queue a task to fire a simple event named sourceopen at the parent media source.
    94         m_source->setReadyState(MediaSource::openKeyword());
    95     }
     100    // 4.1 Set the readyState attribute of the parent media source to "open"
     101    // 4.2 Queue a task to fire a simple event named sourceopen at the parent media source.
     102    m_source->openIfInEndedState();
    96103
    97104    // 5. If this object is waiting for the end of a media segment to be appended, then throw an INVALID_STATE_ERR
     
    106113}
    107114
    108 void SourceBuffer::append(PassRefPtr<Uint8Array> data, ExceptionCode& ec)
    109 {
    110     // SourceBuffer.append() steps from October 1st version of the Media Source Extensions spec.
    111     // https://dvcs.w3.org/hg/html-media/raw-file/7bab66368f2c/media-source/media-source.html#dom-append
    112 
    113     // 2. If data is null then throw an INVALID_ACCESS_ERR exception and abort these steps.
     115void SourceBuffer::appendBuffer(PassRefPtr<ArrayBuffer> data, ExceptionCode& ec)
     116{
     117    // Section 3.2 appendBuffer()
     118    // https://dvcs.w3.org/hg/html-media/raw-file/default/media-source/media-source.html#widl-SourceBuffer-appendBuffer-void-ArrayBufferView-data
     119    // 1. If data is null then throw an INVALID_ACCESS_ERR exception and abort these steps.
    114120    if (!data) {
    115121        ec = INVALID_ACCESS_ERR;
     
    117123    }
    118124
    119     // 3. If this object has been removed from the sourceBuffers attribute of media source then throw
    120     //    an INVALID_STATE_ERR exception and abort these steps.
    121     if (isRemoved()) {
    122         ec = INVALID_STATE_ERR;
    123         return;
    124     }
    125 
    126     // 5. If the readyState attribute of media source is in the "ended" state then run the following steps:
    127     if (isEnded()) {
    128         // 5.1. Set the readyState attribute of media source to "open"
    129         // 5.2. Queue a task to fire a simple event named sourceopen at media source.
    130         m_source->setReadyState(MediaSource::openKeyword());
    131     }
    132 
    133     // Steps 6 & beyond are handled by the private implementation.
    134     m_private->append(data->data(), data->length());
     125    appendBufferInternal(static_cast<unsigned char*>(data->data()), data->byteLength(), ec);
     126}
     127
     128void SourceBuffer::appendBuffer(PassRefPtr<ArrayBufferView> data, ExceptionCode& ec)
     129{
     130    // Section 3.2 appendBuffer()
     131    // https://dvcs.w3.org/hg/html-media/raw-file/default/media-source/media-source.html#widl-SourceBuffer-appendBuffer-void-ArrayBufferView-data
     132    // 1. If data is null then throw an INVALID_ACCESS_ERR exception and abort these steps.
     133    if (!data) {
     134        ec = INVALID_ACCESS_ERR;
     135        return;
     136    }
     137
     138    appendBufferInternal(static_cast<unsigned char*>(data->baseAddress()), data->byteLength(), ec);
    135139}
    136140
     
    138142{
    139143    // Section 3.2 abort() method steps.
     144    // https://dvcs.w3.org/hg/html-media/raw-file/default/media-source/media-source.html#widl-SourceBuffer-abort-void
    140145    // 1. If this object has been removed from the sourceBuffers attribute of the parent media source
    141146    //    then throw an INVALID_STATE_ERR exception and abort these steps.
    142147    // 2. If the readyState attribute of the parent media source is not in the "open" state
    143148    //    then throw an INVALID_STATE_ERR exception and abort these steps.
    144     if (isRemoved() || !isOpen()) {
    145         ec = INVALID_STATE_ERR;
    146         return;
    147     }
     149    if (isRemoved() || !m_source->isOpen()) {
     150        ec = INVALID_STATE_ERR;
     151        return;
     152    }
     153
     154    // 3. If the sourceBuffer.updating attribute equals true, then run the following steps: ...
     155    abortIfUpdating();
    148156
    149157    // 4. Run the reset parser state algorithm.
    150158    m_private->abort();
     159
     160    // FIXME(229408) Add steps 5-6 update appendWindowStart & appendWindowEnd.
     161}
     162
     163
     164void SourceBuffer::abortIfUpdating()
     165{
     166    // Section 3.2 abort() method step 3 substeps.
     167    // https://dvcs.w3.org/hg/html-media/raw-file/default/media-source/media-source.html#widl-SourceBuffer-abort-void
     168
     169    if (!m_updating)
     170        return;
     171
     172    // 3.1. Abort the buffer append and stream append loop algorithms if they are running.
     173    m_appendBufferTimer.stop();
     174    m_pendingAppendData.clear();
     175
     176    // 3.2. Set the updating attribute to false.
     177    m_updating = false;
     178
     179    // 3.3. Queue a task to fire a simple event named abort at this SourceBuffer object.
     180    scheduleEvent(eventNames().abortEvent);
     181
     182    // 3.4. Queue a task to fire a simple event named updateend at this SourceBuffer object.
     183    scheduleEvent(eventNames().updateendEvent);
    151184}
    152185
     
    157190
    158191    m_private->removedFromMediaSource();
    159     m_source.clear();
     192    m_source = 0;
     193    m_asyncEventQueue.close();
     194}
     195
     196bool SourceBuffer::hasPendingActivity() const
     197{
     198    return m_source;
     199}
     200
     201void SourceBuffer::stop()
     202{
     203    m_appendBufferTimer.stop();
     204}
     205
     206ScriptExecutionContext* SourceBuffer::scriptExecutionContext() const
     207{
     208    return ActiveDOMObject::scriptExecutionContext();
     209}
     210
     211const AtomicString& SourceBuffer::interfaceName() const
     212{
     213    return eventNames().interfaceForSourceBuffer;
     214}
     215
     216EventTargetData* SourceBuffer::eventTargetData()
     217{
     218    return &m_eventTargetData;
     219}
     220
     221EventTargetData& SourceBuffer::ensureEventTargetData()
     222{
     223    return m_eventTargetData;
    160224}
    161225
     
    165229}
    166230
    167 bool SourceBuffer::isOpen() const
    168 {
    169     ASSERT(m_source);
    170     return m_source->readyState() == MediaSource::openKeyword();
    171 }
    172 
    173 bool SourceBuffer::isEnded() const
    174 {
    175     ASSERT(m_source);
    176     return m_source->readyState() == MediaSource::endedKeyword();
     231void SourceBuffer::scheduleEvent(const AtomicString& eventName)
     232{
     233    RefPtr<Event> event = Event::create(eventName, false, false);
     234    event->setTarget(this);
     235
     236    m_asyncEventQueue.enqueueEvent(event.release());
     237}
     238
     239void SourceBuffer::appendBufferInternal(unsigned char* data, unsigned size, ExceptionCode& ec)
     240{
     241    // Section 3.2 appendBuffer()
     242    // https://dvcs.w3.org/hg/html-media/raw-file/default/media-source/media-source.html#widl-SourceBuffer-appendBuffer-void-ArrayBufferView-data
     243
     244    // Step 1 is enforced by the caller.
     245    // 2. If this object has been removed from the sourceBuffers attribute of the parent media source then throw an INVALID_STATE_ERR exception and abort these steps.
     246    // 3. If the updating attribute equals true, then throw an INVALID_STATE_ERR exception and abort these steps.
     247    if (isRemoved() || m_updating) {
     248        ec = INVALID_STATE_ERR;
     249        return;
     250    }
     251
     252    // 4. If the readyState attribute of the parent media source is in the "ended" state then run the following steps: ...
     253    m_source->openIfInEndedState();
     254
     255    // Steps 5-6
     256
     257    // 7. Add data to the end of the input buffer.
     258    m_pendingAppendData.append(data, size);
     259
     260    // 8. Set the updating attribute to true.
     261    m_updating = true;
     262
     263    // 9. Queue a task to fire a simple event named updatestart at this SourceBuffer object.
     264    scheduleEvent(eventNames().updatestartEvent);
     265
     266    // 10. Asynchronously run the buffer append algorithm.
     267    m_appendBufferTimer.startOneShot(0);
     268}
     269
     270void SourceBuffer::appendBufferTimerFired(Timer<SourceBuffer>*)
     271{
     272    ASSERT(m_updating);
     273
     274    // Section 3.5.4 Buffer Append Algorithm
     275    // https://dvcs.w3.org/hg/html-media/raw-file/default/media-source/media-source.html#sourcebuffer-buffer-append
     276
     277    // 1. Run the segment parser loop algorithm.
     278    // Step 2 doesn't apply since we run Step 1 synchronously here.
     279    size_t appendSize = m_pendingAppendData.size();
     280    if (!appendSize) {
     281        // Resize buffer for 0 byte appends so we always have a valid pointer.
     282        // We need to convey all appends, even 0 byte ones to |m_private| so
     283        // that it can clear its end of stream state if necessary.
     284        m_pendingAppendData.resize(1);
     285    }
     286    m_private->append(m_pendingAppendData.data(), appendSize);
     287
     288    // 3. Set the updating attribute to false.
     289    m_updating = false;
     290    m_pendingAppendData.clear();
     291
     292    // 4. Queue a task to fire a simple event named update at this SourceBuffer object.
     293    scheduleEvent(eventNames().updateEvent);
     294
     295    // 5. Queue a task to fire a simple event named updateend at this SourceBuffer object.
     296    scheduleEvent(eventNames().updateendEvent);
    177297}
    178298
  • trunk/Source/WebCore/Modules/mediasource/SourceBuffer.h

    r144328 r156049  
    11/*
    2  * Copyright (C) 2012 Google Inc. All rights reserved.
     2 * Copyright (C) 2013 Google Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    3434#if ENABLE(MEDIA_SOURCE)
    3535
     36#include "ActiveDOMObject.h"
     37#include "EventTarget.h"
    3638#include "ExceptionCode.h"
     39#include "GenericEventQueue.h"
     40#include "ScriptWrappable.h"
     41#include "Timer.h"
     42#include <runtime/ArrayBufferView.h>
    3743#include <wtf/PassRefPtr.h>
    3844#include <wtf/RefCounted.h>
     
    4450class TimeRanges;
    4551
    46 class SourceBuffer : public RefCounted<SourceBuffer> {
     52class SourceBuffer : public RefCounted<SourceBuffer>, public ActiveDOMObject, public EventTarget, public ScriptWrappable {
    4753public:
    48     static PassRefPtr<SourceBuffer> create(PassOwnPtr<SourceBufferPrivate>, PassRefPtr<MediaSource>);
     54    static PassRefPtr<SourceBuffer> create(PassOwnPtr<SourceBufferPrivate>, MediaSource*);
    4955
    5056    virtual ~SourceBuffer();
    5157
    5258    // SourceBuffer.idl methods
     59    bool updating() const { return m_updating; }
    5360    PassRefPtr<TimeRanges> buffered(ExceptionCode&) const;
    5461    double timestampOffset() const;
    5562    void setTimestampOffset(double, ExceptionCode&);
    56     void append(PassRefPtr<Uint8Array> data, ExceptionCode&);
     63    void appendBuffer(PassRefPtr<ArrayBuffer> data, ExceptionCode&);
     64    void appendBuffer(PassRefPtr<ArrayBufferView> data, ExceptionCode&);
    5765    void abort(ExceptionCode&);
    5866
     67    void abortIfUpdating();
    5968    void removedFromMediaSource();
    6069
     70    // ActiveDOMObject interface
     71    virtual bool hasPendingActivity() const OVERRIDE;
     72    virtual void stop() OVERRIDE;
     73
     74    // EventTarget interface
     75    virtual ScriptExecutionContext* scriptExecutionContext() const OVERRIDE;
     76    virtual const AtomicString& interfaceName() const OVERRIDE;
     77
     78    using RefCounted<SourceBuffer>::ref;
     79    using RefCounted<SourceBuffer>::deref;
     80
     81protected:
     82    // EventTarget interface
     83    virtual EventTargetData* eventTargetData() OVERRIDE;
     84    virtual EventTargetData& ensureEventTargetData() OVERRIDE;
     85    virtual void refEventTarget() OVERRIDE { ref(); }
     86    virtual void derefEventTarget() OVERRIDE { deref(); }
     87
    6188private:
    62     SourceBuffer(PassOwnPtr<SourceBufferPrivate>, PassRefPtr<MediaSource>);
     89    SourceBuffer(PassOwnPtr<SourceBufferPrivate>, MediaSource*);
    6390
    6491    bool isRemoved() const;
    65     bool isOpen() const;
    66     bool isEnded() const;
     92    void scheduleEvent(const AtomicString& eventName);
     93
     94    void appendBufferInternal(unsigned char*, unsigned, ExceptionCode&);
     95    void appendBufferTimerFired(Timer<SourceBuffer>*);
    6796
    6897    OwnPtr<SourceBufferPrivate> m_private;
    69     RefPtr<MediaSource> m_source;
     98    MediaSource* m_source;
     99    GenericEventQueue m_asyncEventQueue;
     100    EventTargetData m_eventTargetData;
    70101
     102    bool m_updating;
    71103    double m_timestampOffset;
     104
     105    Vector<unsigned char> m_pendingAppendData;
     106    Timer<SourceBuffer> m_appendBufferTimer;
    72107};
    73108
     
    75110
    76111#endif
     112
    77113#endif
  • trunk/Source/WebCore/Modules/mediasource/SourceBuffer.idl

    r151336 r156049  
    11/*
    2  * Copyright (C) 2012 Google Inc. All rights reserved.
     2 * Copyright (C) 2013 Google Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    3131[
    3232    Conditional=MEDIA_SOURCE,
    33     InterfaceName=WebKitSourceBuffer
    34 ] interface SourceBuffer {
     33    NoInterfaceObject,
     34    ActiveDOMObject,
     35    EventTarget,
     36    JSGenerateToNativeObject
     37] interface SourceBuffer : EventTarget {
    3538
     39    readonly attribute boolean updating;
     40 
    3641    // Returns the time ranges buffered.
    3742    [GetterRaisesException] readonly attribute TimeRanges buffered;
     
    4146
    4247    // Append segment data.
    43     [RaisesException] void append(Uint8Array data);
     48    [RaisesException] void appendBuffer(ArrayBuffer data);
     49    [RaisesException] void appendBuffer(ArrayBufferView data);
    4450
    4551    // Abort the current segment append sequence.
  • trunk/Source/WebCore/Modules/mediasource/SourceBufferList.cpp

    r155356 r156049  
    11/*
    2  * Copyright (C) 2012 Google Inc. All rights reserved.
     2 * Copyright (C) 2013 Google Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    3535
    3636#include "Event.h"
    37 #include "GenericEventQueue.h"
    3837#include "SourceBuffer.h"
    3938
    4039namespace WebCore {
    4140
    42 SourceBufferList::SourceBufferList(ScriptExecutionContext& context, GenericEventQueue& asyncEventQueue)
     41SourceBufferList::SourceBufferList(ScriptExecutionContext* context)
    4342    : m_scriptExecutionContext(context)
    44     , m_asyncEventQueue(asyncEventQueue)
     43    , m_asyncEventQueue(*this)
    4544{
    4645}
    4746
    48 unsigned SourceBufferList::length() const
     47SourceBufferList::~SourceBufferList()
    4948{
    50     return m_list.size();
    51 }
    52 
    53 SourceBuffer* SourceBufferList::item(unsigned index) const
    54 {
    55     if (index >= m_list.size())
    56         return 0;
    57     return m_list[index].get();
     49    ASSERT(m_list.isEmpty());
    5850}
    5951
     
    6153{
    6254    m_list.append(buffer);
    63     createAndFireEvent(eventNames().webkitaddsourcebufferEvent);
     55    scheduleEvent(eventNames().addsourcebufferEvent);
    6456}
    6557
    66 bool SourceBufferList::remove(SourceBuffer* buffer)
     58void SourceBufferList::remove(SourceBuffer* buffer)
    6759{
    6860    size_t index = m_list.find(buffer);
    6961    if (index == notFound)
    70         return false;
    71 
    72     buffer->removedFromMediaSource();
     62        return;
    7363    m_list.remove(index);
    74     createAndFireEvent(eventNames().webkitremovesourcebufferEvent);
    75     return true;
     64    scheduleEvent(eventNames().removesourcebufferEvent);
    7665}
    7766
    7867void SourceBufferList::clear()
    7968{
    80     for (size_t i = 0; i < m_list.size(); ++i)
    81         m_list[i]->removedFromMediaSource();
    8269    m_list.clear();
    83     createAndFireEvent(eventNames().webkitremovesourcebufferEvent);
     70    scheduleEvent(eventNames().removesourcebufferEvent);
    8471}
    8572
    86 void SourceBufferList::createAndFireEvent(const AtomicString& eventName)
     73void SourceBufferList::scheduleEvent(const AtomicString& eventName)
    8774{
    8875    RefPtr<Event> event = Event::create(eventName, false, false);
    8976    event->setTarget(this);
     77
    9078    m_asyncEventQueue.enqueueEvent(event.release());
    9179}
     
    9886ScriptExecutionContext* SourceBufferList::scriptExecutionContext() const
    9987{
    100     return &m_scriptExecutionContext;
     88    return m_scriptExecutionContext;
    10189}
    10290
  • trunk/Source/WebCore/Modules/mediasource/SourceBufferList.h

    r155356 r156049  
    11/*
    2  * Copyright (C) 2012 Google Inc. All rights reserved.
     2 * Copyright (C) 2013 Google Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    3535
    3636#include "EventTarget.h"
     37#include "GenericEventQueue.h"
     38#include "ScriptWrappable.h"
    3739#include <wtf/RefCounted.h>
    3840#include <wtf/Vector.h>
     
    4143
    4244class SourceBuffer;
    43 class GenericEventQueue;
    4445
    45 class SourceBufferList : public RefCounted<SourceBufferList>, public EventTarget {
     46class SourceBufferList : public RefCounted<SourceBufferList>, public ScriptWrappable, public EventTarget {
    4647public:
    47     static PassRefPtr<SourceBufferList> create(ScriptExecutionContext& context, GenericEventQueue& asyncEventQueue)
     48    static PassRefPtr<SourceBufferList> create(ScriptExecutionContext* context)
    4849    {
    49         return adoptRef(new SourceBufferList(context, asyncEventQueue));
     50        return adoptRef(new SourceBufferList(context));
    5051    }
    51     virtual ~SourceBufferList() { }
     52    virtual ~SourceBufferList();
    5253
    53     unsigned length() const;
    54     SourceBuffer* item(unsigned index) const;
     54    unsigned long length() const { return m_list.size(); }
     55    SourceBuffer* item(unsigned long index) const { return (index < m_list.size()) ? m_list[index].get() : 0; }
    5556
    5657    void add(PassRefPtr<SourceBuffer>);
    57     bool remove(SourceBuffer*);
     58    void remove(SourceBuffer*);
     59    bool contains(SourceBuffer* buffer) { return m_list.find(buffer) != notFound; }
    5860    void clear();
    5961
     
    7072
    7173private:
    72     SourceBufferList(ScriptExecutionContext*, GenericEventQueue*);
     74    SourceBufferList(ScriptExecutionContext*);
    7375
    74     void createAndFireEvent(const AtomicString&);
     76    void scheduleEvent(const AtomicString&);
    7577
    7678    virtual void refEventTarget() OVERRIDE { ref(); }
     
    7880
    7981    EventTargetData m_eventTargetData;
    80     ScriptExecutionContext& m_scriptExecutionContext;
    81     GenericEventQueue& m_asyncEventQueue;
     82    ScriptExecutionContext* m_scriptExecutionContext;
     83    GenericEventQueue m_asyncEventQueue;
    8284
    8385    Vector<RefPtr<SourceBuffer> > m_list;
     
    8789
    8890#endif
     91
    8992#endif
  • trunk/Source/WebCore/Modules/mediasource/SourceBufferList.idl

    r151499 r156049  
    11/*
    2  * Copyright (C) 2012 Google Inc. All rights reserved.
     2 * Copyright (C) 2013 Google Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    3131[
    3232    Conditional=MEDIA_SOURCE,
     33    NoInterfaceObject,
    3334    EventTarget,
    34     InterfaceName=WebKitSourceBufferList
    35 ] interface SourceBufferList {
     35    JSGenerateToNativeObject,
     36    CallWith=ScriptExecutionContext
     37] interface SourceBufferList : EventTarget {
    3638    readonly attribute unsigned long length;
    3739    getter SourceBuffer item(unsigned long index);
    38 
    39     // EventTarget interface
    40     void addEventListener(DOMString type,
    41                           EventListener listener,
    42                           optional boolean useCapture);
    43     void removeEventListener(DOMString type,
    44                              EventListener listener,
    45                              optional boolean useCapture);
    46     [RaisesException] boolean dispatchEvent(Event event);
    4740};
    4841
  • trunk/Source/WebCore/Modules/mediasource/URLMediaSource.cpp

    r156048 r156049  
    2828 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    2929 */
    30 #ifndef MediaSourcePrivate_h
    31 #define MediaSourcePrivate_h
     30
     31#include "config.h"
     32#include "URLMediaSource.h"
    3233
    3334#if ENABLE(MEDIA_SOURCE)
    3435
    35 #include <wtf/Forward.h>
     36#include "DOMURL.h"
     37#include "MediaSourceBase.h"
     38#include <wtf/MainThread.h>
    3639
    3740namespace WebCore {
    3841
    39 class SourceBufferPrivate;
     42String URLMediaSource::createObjectURL(ScriptExecutionContext* scriptExecutionContext, MediaSourceBase* source)
     43{
     44    // Since WebWorkers cannot obtain MediaSource objects, we should be on the main thread.
     45    ASSERT(isMainThread());
    4046
    41 class MediaSourcePrivate {
    42 public:
    43     typedef Vector<String, 0> CodecsArray;
    44 
    45     MediaSourcePrivate() { }
    46     virtual ~MediaSourcePrivate() { }
    47 
    48     enum AddStatus { Ok, NotSupported, ReachedIdLimit };
    49     virtual AddStatus addSourceBuffer(const String& type, const CodecsArray&, OwnPtr<SourceBufferPrivate>*) = 0;
    50     virtual double duration() = 0;
    51     virtual void setDuration(double) = 0;
    52     enum EndOfStreamStatus { EosNoError, EosNetworkError, EosDecodeError };
    53     virtual void endOfStream(EndOfStreamStatus) = 0;
    54 };
    55 
     47    if (!scriptExecutionContext || !source)
     48        return String();
     49    return DOMURL::createPublicURL(scriptExecutionContext, source);
    5650}
    5751
     52} // namespace WebCore
     53
    5854#endif
    59 #endif
  • trunk/Source/WebCore/Modules/mediasource/URLMediaSource.h

    r156048 r156049  
    11/*
    2  * Copyright (C) 2012 Google Inc. All rights reserved.
     2 * Copyright (C) 2013 Google Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    2828 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    2929 */
    30  
    31 [
    32     Conditional=MEDIA_SOURCE,
    33     InterfaceName=WebKitSourceBuffer
    34 ] interface SourceBuffer {
    3530
    36     // Returns the time ranges buffered.
    37     [GetterRaisesException] readonly attribute TimeRanges buffered;
     31#ifndef URLMediaSource_h
     32#define URLMediaSource_h
    3833
    39     // Applies an offset to media segment timestamps.
    40     [SetterRaisesException] attribute double timestampOffset;
     34#if ENABLE(MEDIA_SOURCE)
    4135
    42     // Append segment data.
    43     [RaisesException] void append(Uint8Array data);
     36#include <wtf/Forward.h>
    4437
    45     // Abort the current segment append sequence.
    46     [RaisesException] void abort();
     38namespace WebCore {
     39
     40class MediaSourceBase;
     41class ScriptExecutionContext;
     42
     43class URLMediaSource {
     44public:
     45    static String createObjectURL(ScriptExecutionContext*, MediaSourceBase*);
    4746};
    4847
     48} // namespace WebCore
     49
     50#endif
     51
     52#endif
  • trunk/Source/WebCore/Modules/mediasource/URLMediaSource.idl

    r156048 r156049  
    11/*
    2  * Copyright (C) 2012 Google Inc. All rights reserved.
     2 * Copyright (C) 2013 Google Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    2828 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    2929 */
    30  
    3130[
    32     Conditional=MEDIA_SOURCE,
    33     InterfaceName=WebKitSourceBuffer
    34 ] interface SourceBuffer {
    35 
    36     // Returns the time ranges buffered.
    37     [GetterRaisesException] readonly attribute TimeRanges buffered;
    38 
    39     // Applies an offset to media segment timestamps.
    40     [SetterRaisesException] attribute double timestampOffset;
    41 
    42     // Append segment data.
    43     [RaisesException] void append(Uint8Array data);
    44 
    45     // Abort the current segment append sequence.
    46     [RaisesException] void abort();
     31    Conditional=MEDIA_SOURCE
     32]
     33partial interface URL {
     34    [CallWith=ScriptExecutionContext,TreatReturnedNullStringAs=Null] static DOMString createObjectURL(MediaSource? source);
     35    [CallWith=ScriptExecutionContext,TreatReturnedNullStringAs=Null] static DOMString createObjectURL(WebKitMediaSource? source);
    4736};
    48 
  • trunk/Source/WebCore/Modules/mediasource/WebKitMediaSource.cpp

    r156048 r156049  
    3030
    3131#include "config.h"
    32 #include "MediaSource.h"
     32#include "WebKitMediaSource.h"
    3333
    3434#if ENABLE(MEDIA_SOURCE)
    3535
    3636#include "ContentType.h"
    37 #include "Event.h"
     37#include "ExceptionCodePlaceholder.h"
    3838#include "MIMETypeRegistry.h"
     39#include "MediaSourceRegistry.h"
    3940#include "SourceBufferPrivate.h"
    4041#include "TimeRanges.h"
     
    4344namespace WebCore {
    4445
    45 PassRefPtr<MediaSource> MediaSource::create(ScriptExecutionContext* context)
    46 {
    47     RefPtr<MediaSource> mediaSource(adoptRef(new MediaSource(context)));
     46PassRefPtr<WebKitMediaSource> WebKitMediaSource::create(ScriptExecutionContext* context)
     47{
     48    RefPtr<WebKitMediaSource> mediaSource(adoptRef(new WebKitMediaSource(context)));
    4849    mediaSource->suspendIfNeeded();
    4950    return mediaSource.release();
    5051}
    5152
    52 MediaSource::MediaSource(ScriptExecutionContext* context)
    53     : ActiveDOMObject(context)
    54     , m_readyState(closedKeyword())
     53WebKitMediaSource::WebKitMediaSource(ScriptExecutionContext* context)
     54    : MediaSourceBase(context)
    5555    , m_asyncEventQueue(*this)
    56     , m_sourceBuffers(SourceBufferList::create(scriptExecutionContext(), m_asyncEventQueue))
    57     , m_activeSourceBuffers(SourceBufferList::create(scriptExecutionContext(), m_asyncEventQueue))
    58 {
    59 }
    60 
    61 const String& MediaSource::openKeyword()
    62 {
    63     DEFINE_STATIC_LOCAL(const String, open, (ASCIILiteral("open")));
    64     return open;
    65 }
    66 
    67 const String& MediaSource::closedKeyword()
    68 {
    69     DEFINE_STATIC_LOCAL(const String, closed, (ASCIILiteral("closed")));
    70     return closed;
    71 }
    72 
    73 const String& MediaSource::endedKeyword()
    74 {
    75     DEFINE_STATIC_LOCAL(const String, ended, (ASCIILiteral("ended")));
    76     return ended;
    77 }
    78 
    79 SourceBufferList* MediaSource::sourceBuffers()
     56    , m_sourceBuffers(WebKitSourceBufferList::create(scriptExecutionContext()))
     57    , m_activeSourceBuffers(WebKitSourceBufferList::create(scriptExecutionContext()))
     58{
     59}
     60
     61WebKitSourceBufferList* WebKitMediaSource::sourceBuffers()
    8062{
    8163    return m_sourceBuffers.get();
    8264}
    8365
    84 SourceBufferList* MediaSource::activeSourceBuffers()
     66WebKitSourceBufferList* WebKitMediaSource::activeSourceBuffers()
    8567{
    8668    // FIXME(91649): support track selection
     
    8870}
    8971
    90 double MediaSource::duration() const
    91 {
    92     return m_readyState == closedKeyword() ? std::numeric_limits<float>::quiet_NaN() : m_private->duration();
    93 }
    94 
    95 void MediaSource::setDuration(double duration, ExceptionCode& ec)
    96 {
    97     if (duration < 0.0 || std::isnan(duration)) {
    98         ec = INVALID_ACCESS_ERR;
    99         return;
    100     }
    101     if (m_readyState != openKeyword()) {
    102         ec = INVALID_STATE_ERR;
    103         return;
    104     }
    105     m_private->setDuration(duration);
    106 }
    107 
    108 SourceBuffer* MediaSource::addSourceBuffer(const String& type, ExceptionCode& ec)
     72WebKitSourceBuffer* WebKitMediaSource::addSourceBuffer(const String& type, ExceptionCode& ec)
    10973{
    11074    // 3.1 http://dvcs.w3.org/hg/html-media/raw-file/tip/media-source/media-source.html#dom-addsourcebuffer
     
    12589    // 4. If the readyState attribute is not in the "open" state then throw an
    12690    // INVALID_STATE_ERR exception and abort these steps.
    127     if (!m_private || m_readyState != openKeyword()) {
     91    if (!isOpen()) {
    12892        ec = INVALID_STATE_ERR;
    12993        return 0;
     
    13397    ContentType contentType(type);
    13498    Vector<String> codecs = contentType.codecs();
    135     OwnPtr<SourceBufferPrivate> sourceBufferPrivate;
    136     switch (m_private->addSourceBuffer(contentType.type(), codecs, &sourceBufferPrivate)) {
    137     case MediaSourcePrivate::Ok: {
    138         ASSERT(sourceBufferPrivate);
    139         RefPtr<SourceBuffer> buffer = SourceBuffer::create(sourceBufferPrivate.release(), this);
    140 
    141         // 6. Add the new object to sourceBuffers and fire a addsourcebuffer on that object.
    142         m_sourceBuffers->add(buffer);
    143         m_activeSourceBuffers->add(buffer);
    144         // 7. Return the new object to the caller.
    145         return buffer.get();
    146     }
    147     case MediaSourcePrivate::NotSupported:
    148         // 2 (cont). If type contains a MIME type ... that is not supported with the types
    149         // specified for the other SourceBuffer objects in sourceBuffers, then throw
    150         // a NOT_SUPPORTED_ERR exception and abort these steps.
    151         ec = NOT_SUPPORTED_ERR;
    152         return 0;
    153     case MediaSourcePrivate::ReachedIdLimit:
    154         // 3 (cont). If the user agent can't handle any more SourceBuffer objects then throw
    155         // a QUOTA_EXCEEDED_ERR exception and abort these steps.
    156         ec = QUOTA_EXCEEDED_ERR;
    157         return 0;
    158     }
    159 
    160     ASSERT_NOT_REACHED();
    161     return 0;
    162 }
    163 
    164 void MediaSource::removeSourceBuffer(SourceBuffer* buffer, ExceptionCode& ec)
     99    OwnPtr<SourceBufferPrivate> sourceBufferPrivate = createSourceBufferPrivate(contentType.type(), codecs, ec);
     100    if (!sourceBufferPrivate)
     101        return 0;
     102
     103    RefPtr<WebKitSourceBuffer> buffer = WebKitSourceBuffer::create(sourceBufferPrivate.release(), this);
     104    // 6. Add the new object to sourceBuffers and fire a addsourcebuffer on that object.
     105    m_sourceBuffers->add(buffer);
     106    m_activeSourceBuffers->add(buffer);
     107    // 7. Return the new object to the caller.
     108    return buffer.get();
     109}
     110
     111void WebKitMediaSource::removeSourceBuffer(WebKitSourceBuffer* buffer, ExceptionCode& ec)
    165112{
    166113    // 3.1 http://dvcs.w3.org/hg/html-media/raw-file/tip/media-source/media-source.html#dom-removesourcebuffer
     
    174121    // 2. If sourceBuffers is empty then throw an INVALID_STATE_ERR exception and
    175122    // abort these steps.
    176     if (!m_private || !m_sourceBuffers->length()) {
     123    if (isClosed() || !m_sourceBuffers->length()) {
    177124        ec = INVALID_STATE_ERR;
    178125        return;
     
    191138    m_activeSourceBuffers->remove(buffer);
    192139
    193     // 4. Remove track information from audioTracks, videoTracks, and textTracks for all tracks 
     140    // 4. Remove track information from audioTracks, videoTracks, and textTracks for all tracks
    194141    // associated with sourceBuffer and fire a simple event named change on the modified lists.
    195142    // FIXME(91649): support track selection
     
    200147}
    201148
    202 const String& MediaSource::readyState() const
    203 {
    204     return m_readyState;
    205 }
    206 
    207 void MediaSource::setReadyState(const String& state)
    208 {
    209     ASSERT(state == openKeyword() || state == closedKeyword() || state == endedKeyword());
    210     if (m_readyState == state)
    211         return;
    212 
    213     String oldState = m_readyState;
    214     m_readyState = state;
    215 
    216     if (m_readyState == closedKeyword()) {
     149void WebKitMediaSource::onReadyStateChange(const AtomicString& oldState, const AtomicString& newState)
     150{
     151    if (isClosed()) {
    217152        m_sourceBuffers->clear();
    218153        m_activeSourceBuffers->clear();
    219         m_private.clear();
    220154        scheduleEvent(eventNames().webkitsourcecloseEvent);
    221155        return;
    222156    }
    223157
    224     if (oldState == openKeyword() && m_readyState == endedKeyword()) {
     158    if (oldState == openKeyword() && newState == endedKeyword()) {
    225159        scheduleEvent(eventNames().webkitsourceendedEvent);
    226160        return;
    227161    }
    228162
    229     if (m_readyState == openKeyword()) {
     163    if (isOpen()) {
    230164        scheduleEvent(eventNames().webkitsourceopenEvent);
    231165        return;
     
    233167}
    234168
    235 void MediaSource::endOfStream(const String& error, ExceptionCode& ec)
    236 {
    237     // 3.1 http://dvcs.w3.org/hg/html-media/raw-file/tip/media-source/media-source.html#dom-endofstream
    238     // 1. If the readyState attribute is not in the "open" state then throw an
    239     // INVALID_STATE_ERR exception and abort these steps.
    240     if (!m_private || m_readyState != openKeyword()) {
    241         ec = INVALID_STATE_ERR;
    242         return;
    243     }
    244 
    245     MediaSourcePrivate::EndOfStreamStatus eosStatus = MediaSourcePrivate::EosNoError;
    246 
    247     if (error.isNull() || error.isEmpty())
    248         eosStatus = MediaSourcePrivate::EosNoError;
    249     else if (error == "network")
    250         eosStatus = MediaSourcePrivate::EosNetworkError;
    251     else if (error == "decode")
    252         eosStatus = MediaSourcePrivate::EosDecodeError;
    253     else {
    254         ec = INVALID_ACCESS_ERR;
    255         return;
    256     }
    257 
    258     // 2. Change the readyState attribute value to "ended".
    259     setReadyState(endedKeyword());
    260     m_private->endOfStream(eosStatus);
    261 }
    262 
    263 bool MediaSource::isTypeSupported(const String& type)
     169Vector<RefPtr<TimeRanges> > WebKitMediaSource::activeRanges() const
     170{
     171    Vector<RefPtr<TimeRanges> > activeRanges(m_activeSourceBuffers->length());
     172    for (size_t i = 0; i < m_activeSourceBuffers->length(); ++i)
     173        activeRanges[i] = m_activeSourceBuffers->item(i)->buffered(ASSERT_NO_EXCEPTION);
     174
     175    return activeRanges;
     176}
     177
     178bool WebKitMediaSource::isTypeSupported(const String& type)
    264179{
    265180    // Section 2.1 isTypeSupported() method steps.
     
    283198}
    284199
    285 void MediaSource::setPrivateAndOpen(PassOwnPtr<MediaSourcePrivate> mediaSourcePrivate)
    286 {
    287     ASSERT(mediaSourcePrivate);
    288     ASSERT(!m_private);
    289     m_private = mediaSourcePrivate;
    290     setReadyState(openKeyword());
    291 }
    292 
    293 const AtomicString& MediaSource::interfaceName() const
    294 {
    295     return eventNames().interfaceForMediaSource;
    296 }
    297 
    298 ScriptExecutionContext* MediaSource::scriptExecutionContext() const
    299 {
    300     return ActiveDOMObject::scriptExecutionContext();
    301 }
    302 
    303 bool MediaSource::hasPendingActivity() const
    304 {
    305     return m_private || m_asyncEventQueue.hasPendingEvents() || ActiveDOMObject::hasPendingActivity();
    306 }
    307 
    308 void MediaSource::stop()
    309 {
    310     m_private.clear();
    311     m_asyncEventQueue.cancelAllEvents();
    312 }
    313 
    314 EventTargetData* MediaSource::eventTargetData()
    315 {
    316     return &m_eventTargetData;
    317 }
    318 
    319 EventTargetData& MediaSource::ensureEventTargetData()
    320 {
    321     return m_eventTargetData;
    322 }
    323 
    324 void MediaSource::scheduleEvent(const AtomicString& eventName)
    325 {
    326     RefPtr<Event> event = Event::create(eventName, false, false);
    327     event->setTarget(this);
    328     m_asyncEventQueue.enqueueEvent(event.release());
     200const AtomicString& WebKitMediaSource::interfaceName() const
     201{
     202    return eventNames().interfaceForWebKitMediaSource;
    329203}
    330204
  • trunk/Source/WebCore/Modules/mediasource/WebKitMediaSource.h

    r156048 r156049  
    2929 */
    3030
    31 #ifndef SourceBufferList_h
    32 #define SourceBufferList_h
     31#ifndef WebKitMediaSource_h
     32#define WebKitMediaSource_h
    3333
    3434#if ENABLE(MEDIA_SOURCE)
    3535
    36 #include "EventTarget.h"
     36#include "MediaSourceBase.h"
     37#include "ScriptWrappable.h"
     38#include "WebKitSourceBuffer.h"
     39#include "WebKitSourceBufferList.h"
    3740#include <wtf/RefCounted.h>
    38 #include <wtf/Vector.h>
    3941
    4042namespace WebCore {
    4143
    42 class SourceBuffer;
    43 class GenericEventQueue;
     44class WebKitMediaSource : public MediaSourceBase, public ScriptWrappable {
     45public:
     46    static PassRefPtr<WebKitMediaSource> create(ScriptExecutionContext*);
     47    virtual ~WebKitMediaSource() { }
    4448
    45 class SourceBufferList : public RefCounted<SourceBufferList>, public EventTarget {
    46 public:
    47     static PassRefPtr<SourceBufferList> create(ScriptExecutionContext& context, GenericEventQueue& asyncEventQueue)
    48     {
    49         return adoptRef(new SourceBufferList(context, asyncEventQueue));
    50     }
    51     virtual ~SourceBufferList() { }
    52 
    53     unsigned length() const;
    54     SourceBuffer* item(unsigned index) const;
    55 
    56     void add(PassRefPtr<SourceBuffer>);
    57     bool remove(SourceBuffer*);
    58     void clear();
     49    // WebKitMediaSource.idl methods
     50    WebKitSourceBufferList* sourceBuffers();
     51    WebKitSourceBufferList* activeSourceBuffers();
     52    WebKitSourceBuffer* addSourceBuffer(const String& type, ExceptionCode&);
     53    void removeSourceBuffer(WebKitSourceBuffer*, ExceptionCode&);
     54    static bool isTypeSupported(const String& type);
    5955
    6056    // EventTarget interface
    6157    virtual const AtomicString& interfaceName() const OVERRIDE;
    62     virtual ScriptExecutionContext* scriptExecutionContext() const OVERRIDE;
    6358
    64     using RefCounted<SourceBufferList>::ref;
    65     using RefCounted<SourceBufferList>::deref;
    66 
    67 protected:
    68     virtual EventTargetData* eventTargetData() OVERRIDE;
    69     virtual EventTargetData& ensureEventTargetData() OVERRIDE;
     59    using RefCounted<MediaSourceBase>::ref;
     60    using RefCounted<MediaSourceBase>::deref;
    7061
    7162private:
    72     SourceBufferList(ScriptExecutionContext*, GenericEventQueue*);
     63    explicit WebKitMediaSource(ScriptExecutionContext*);
    7364
    74     void createAndFireEvent(const AtomicString&);
     65    // MediaSourceBase interface
     66    virtual void onReadyStateChange(const AtomicString&, const AtomicString&) OVERRIDE;
     67    virtual Vector<RefPtr<TimeRanges> > activeRanges() const OVERRIDE;
    7568
    76     virtual void refEventTarget() OVERRIDE { ref(); }
    77     virtual void derefEventTarget() OVERRIDE { deref(); }
    78 
    79     EventTargetData m_eventTargetData;
    80     ScriptExecutionContext& m_scriptExecutionContext;
    81     GenericEventQueue& m_asyncEventQueue;
    82 
    83     Vector<RefPtr<SourceBuffer> > m_list;
     69    GenericEventQueue m_asyncEventQueue;
     70    RefPtr<WebKitSourceBufferList> m_sourceBuffers;
     71    RefPtr<WebKitSourceBufferList> m_activeSourceBuffers;
    8472};
    8573
  • trunk/Source/WebCore/Modules/mediasource/WebKitMediaSource.idl

    r156048 r156049  
    3333    ActiveDOMObject,
    3434    EventTarget,
     35    JSGenerateToNativeObject,
    3536    Constructor,
    36     ConstructorCallWith=ScriptExecutionContext,
    37     InterfaceName=WebKitMediaSource
    38 ] interface MediaSource {
     37    ConstructorCallWith=ScriptExecutionContext
     38] interface WebKitMediaSource : EventTarget {
    3939    // All the source buffers created by this object.
    40     readonly attribute SourceBufferList sourceBuffers;
     40    readonly attribute WebKitSourceBufferList sourceBuffers;
    4141
    4242    // Subset of sourceBuffers that provide data for the selected/enabled tracks.
    43     readonly attribute SourceBufferList activeSourceBuffers;
     43    readonly attribute WebKitSourceBufferList activeSourceBuffers;
    4444
    4545    [SetterRaisesException] attribute double duration;
    4646
    47     [RaisesException] SourceBuffer addSourceBuffer(DOMString type);
    48     [RaisesException] void removeSourceBuffer(SourceBuffer buffer);
     47    [RaisesException] WebKitSourceBuffer addSourceBuffer(DOMString type);
     48    [RaisesException] void removeSourceBuffer(WebKitSourceBuffer buffer);
    4949
    5050    readonly attribute DOMString readyState;
     
    5353
    5454    static boolean isTypeSupported (DOMString type);
    55 
    56     // EventTarget interface
    57     void addEventListener(DOMString type,
    58                           EventListener listener,
    59                           optional boolean useCapture);
    60     void removeEventListener(DOMString type,
    61                              EventListener listener,
    62                              optional boolean useCapture);
    63     [RaisesException] boolean dispatchEvent(Event event);
    6455};
    6556
  • trunk/Source/WebCore/Modules/mediasource/WebKitSourceBuffer.cpp

    r156048 r156049  
    3030
    3131#include "config.h"
    32 #include "SourceBuffer.h"
     32#include "WebKitSourceBuffer.h"
    3333
    3434#if ENABLE(MEDIA_SOURCE)
    3535
    36 #include "MediaSource.h"
    3736#include "SourceBufferPrivate.h"
    3837#include "TimeRanges.h"
     38#include "WebKitMediaSource.h"
    3939#include <runtime/Uint8Array.h>
    4040
    4141namespace WebCore {
    4242
    43 PassRefPtr<SourceBuffer> SourceBuffer::create(PassOwnPtr<SourceBufferPrivate> sourceBufferPrivate, PassRefPtr<MediaSource> source)
     43PassRefPtr<WebKitSourceBuffer> WebKitSourceBuffer::create(PassOwnPtr<SourceBufferPrivate> sourceBufferPrivate, PassRefPtr<WebKitMediaSource> source)
    4444{
    45     return adoptRef(new SourceBuffer(sourceBufferPrivate, source));
     45    return adoptRef(new WebKitSourceBuffer(sourceBufferPrivate, source));
    4646}
    4747
    48 SourceBuffer::SourceBuffer(PassOwnPtr<SourceBufferPrivate> sourceBufferPrivate, PassRefPtr<MediaSource> source)
     48WebKitSourceBuffer::WebKitSourceBuffer(PassOwnPtr<SourceBufferPrivate> sourceBufferPrivate, PassRefPtr<WebKitMediaSource> source)
    4949    : m_private(sourceBufferPrivate)
    5050    , m_source(source)
     
    5555}
    5656
    57 SourceBuffer::~SourceBuffer()
     57WebKitSourceBuffer::~WebKitSourceBuffer()
    5858{
    5959}
    6060
    61 PassRefPtr<TimeRanges> SourceBuffer::buffered(ExceptionCode& ec) const
     61PassRefPtr<TimeRanges> WebKitSourceBuffer::buffered(ExceptionCode& ec) const
    6262{
    6363    // Section 3.1 buffered attribute steps.
     
    7373}
    7474
    75 double SourceBuffer::timestampOffset() const
     75double WebKitSourceBuffer::timestampOffset() const
    7676{
    7777    return m_timestampOffset;
    7878}
    7979
    80 void SourceBuffer::setTimestampOffset(double offset, ExceptionCode& ec)
     80void WebKitSourceBuffer::setTimestampOffset(double offset, ExceptionCode& ec)
    8181{
    8282    // Section 3.1 timestampOffset attribute setter steps.
     
    8989
    9090    // 4. If the readyState attribute of the parent media source is in the "ended" state then run the following steps:
    91     if (isEnded()) {
    92         // 4.1 Set the readyState attribute of the parent media source to "open"
    93         // 4.2 Queue a task to fire a simple event named sourceopen at the parent media source.
    94         m_source->setReadyState(MediaSource::openKeyword());
    95     }
     91    // 4.1 Set the readyState attribute of the parent media source to "open"
     92    // 4.2 Queue a task to fire a simple event named sourceopen at the parent media source.
     93    m_source->openIfInEndedState();
    9694
    9795    // 5. If this object is waiting for the end of a media segment to be appended, then throw an INVALID_STATE_ERR
     
    106104}
    107105
    108 void SourceBuffer::append(PassRefPtr<Uint8Array> data, ExceptionCode& ec)
     106void WebKitSourceBuffer::append(PassRefPtr<Uint8Array> data, ExceptionCode& ec)
    109107{
    110108    // SourceBuffer.append() steps from October 1st version of the Media Source Extensions spec.
     
    125123
    126124    // 5. If the readyState attribute of media source is in the "ended" state then run the following steps:
    127     if (isEnded()) {
    128         // 5.1. Set the readyState attribute of media source to "open"
    129         // 5.2. Queue a task to fire a simple event named sourceopen at media source.
    130         m_source->setReadyState(MediaSource::openKeyword());
    131     }
     125    // 5.1. Set the readyState attribute of media source to "open"
     126    // 5.2. Queue a task to fire a simple event named sourceopen at media source.
     127    m_source->openIfInEndedState();
    132128
    133129    // Steps 6 & beyond are handled by the private implementation.
     
    135131}
    136132
    137 void SourceBuffer::abort(ExceptionCode& ec)
     133void WebKitSourceBuffer::abort(ExceptionCode& ec)
    138134{
    139135    // Section 3.2 abort() method steps.
     
    142138    // 2. If the readyState attribute of the parent media source is not in the "open" state
    143139    //    then throw an INVALID_STATE_ERR exception and abort these steps.
    144     if (isRemoved() || !isOpen()) {
     140    if (isRemoved() || !m_source->isOpen()) {
    145141        ec = INVALID_STATE_ERR;
    146142        return;
     
    151147}
    152148
    153 void SourceBuffer::removedFromMediaSource()
     149void WebKitSourceBuffer::removedFromMediaSource()
    154150{
    155151    if (isRemoved())
     
    160156}
    161157
    162 bool SourceBuffer::isRemoved() const
     158bool WebKitSourceBuffer::isRemoved() const
    163159{
    164160    return !m_source;
    165 }
    166 
    167 bool SourceBuffer::isOpen() const
    168 {
    169     ASSERT(m_source);
    170     return m_source->readyState() == MediaSource::openKeyword();
    171 }
    172 
    173 bool SourceBuffer::isEnded() const
    174 {
    175     ASSERT(m_source);
    176     return m_source->readyState() == MediaSource::endedKeyword();
    177161}
    178162
  • trunk/Source/WebCore/Modules/mediasource/WebKitSourceBuffer.h

    r156048 r156049  
    2929 */
    3030
    31 #ifndef SourceBuffer_h
    32 #define SourceBuffer_h
     31#ifndef WebKitSourceBuffer_h
     32#define WebKitSourceBuffer_h
    3333
    3434#if ENABLE(MEDIA_SOURCE)
    3535
    3636#include "ExceptionCode.h"
     37#include "ScriptWrappable.h"
     38#include <runtime/Uint8Array.h>
    3739#include <wtf/PassRefPtr.h>
    3840#include <wtf/RefCounted.h>
     
    4042
    4143namespace WebCore {
    42 class MediaSource;
    4344class SourceBufferPrivate;
    4445class TimeRanges;
     46class WebKitMediaSource;
    4547
    46 class SourceBuffer : public RefCounted<SourceBuffer> {
     48class WebKitSourceBuffer : public RefCounted<WebKitSourceBuffer>, public ScriptWrappable {
    4749public:
    48     static PassRefPtr<SourceBuffer> create(PassOwnPtr<SourceBufferPrivate>, PassRefPtr<MediaSource>);
     50    static PassRefPtr<WebKitSourceBuffer> create(PassOwnPtr<SourceBufferPrivate>, PassRefPtr<WebKitMediaSource>);
    4951
    50     virtual ~SourceBuffer();
     52    virtual ~WebKitSourceBuffer();
    5153
    52     // SourceBuffer.idl methods
     54    // WebKitSourceBuffer.idl methods
    5355    PassRefPtr<TimeRanges> buffered(ExceptionCode&) const;
    5456    double timestampOffset() const;
    5557    void setTimestampOffset(double, ExceptionCode&);
    56     void append(PassRefPtr<Uint8Array> data, ExceptionCode&);
     58    void append(PassRefPtr<JSC::Uint8Array> data, ExceptionCode&);
    5759    void abort(ExceptionCode&);
    5860
     
    6062
    6163private:
    62     SourceBuffer(PassOwnPtr<SourceBufferPrivate>, PassRefPtr<MediaSource>);
     64    WebKitSourceBuffer(PassOwnPtr<SourceBufferPrivate>, PassRefPtr<WebKitMediaSource>);
    6365
    6466    bool isRemoved() const;
    65     bool isOpen() const;
    66     bool isEnded() const;
    6767
    6868    OwnPtr<SourceBufferPrivate> m_private;
    69     RefPtr<MediaSource> m_source;
     69    RefPtr<WebKitMediaSource> m_source;
    7070
    7171    double m_timestampOffset;
  • trunk/Source/WebCore/Modules/mediasource/WebKitSourceBuffer.idl

    r156048 r156049  
    3030 
    3131[
    32     Conditional=MEDIA_SOURCE,
    33     InterfaceName=WebKitSourceBuffer
    34 ] interface SourceBuffer {
     32    Conditional=MEDIA_SOURCE
     33] interface WebKitSourceBuffer {
    3534
    3635    // Returns the time ranges buffered.
  • trunk/Source/WebCore/Modules/mediasource/WebKitSourceBufferList.cpp

    r156048 r156049  
    3030
    3131#include "config.h"
    32 #include "SourceBufferList.h"
     32#include "WebKitSourceBufferList.h"
    3333
    3434#if ENABLE(MEDIA_SOURCE)
    3535
    3636#include "Event.h"
    37 #include "GenericEventQueue.h"
    38 #include "SourceBuffer.h"
     37#include "WebKitSourceBuffer.h"
    3938
    4039namespace WebCore {
    4140
    42 SourceBufferList::SourceBufferList(ScriptExecutionContext& context, GenericEventQueue& asyncEventQueue)
     41WebKitSourceBufferList::WebKitSourceBufferList(ScriptExecutionContext* context)
    4342    : m_scriptExecutionContext(context)
    44     , m_asyncEventQueue(asyncEventQueue)
     43    , m_asyncEventQueue(*this)
    4544{
    4645}
    4746
    48 unsigned SourceBufferList::length() const
     47WebKitSourceBufferList::~WebKitSourceBufferList()
     48{
     49}
     50
     51unsigned WebKitSourceBufferList::length() const
    4952{
    5053    return m_list.size();
    5154}
    5255
    53 SourceBuffer* SourceBufferList::item(unsigned index) const
     56WebKitSourceBuffer* WebKitSourceBufferList::item(unsigned index) const
    5457{
    5558    if (index >= m_list.size())
     
    5861}
    5962
    60 void SourceBufferList::add(PassRefPtr<SourceBuffer> buffer)
     63void WebKitSourceBufferList::add(PassRefPtr<WebKitSourceBuffer> buffer)
    6164{
    6265    m_list.append(buffer);
     
    6467}
    6568
    66 bool SourceBufferList::remove(SourceBuffer* buffer)
     69bool WebKitSourceBufferList::remove(WebKitSourceBuffer* buffer)
    6770{
    6871    size_t index = m_list.find(buffer);
     
    7679}
    7780
    78 void SourceBufferList::clear()
     81void WebKitSourceBufferList::clear()
    7982{
    8083    for (size_t i = 0; i < m_list.size(); ++i)
     
    8487}
    8588
    86 void SourceBufferList::createAndFireEvent(const AtomicString& eventName)
     89void WebKitSourceBufferList::createAndFireEvent(const AtomicString& eventName)
    8790{
    8891    RefPtr<Event> event = Event::create(eventName, false, false);
     
    9194}
    9295
    93 const AtomicString& SourceBufferList::interfaceName() const
     96const AtomicString& WebKitSourceBufferList::interfaceName() const
    9497{
    95     return eventNames().interfaceForSourceBufferList;
     98    return eventNames().interfaceForWebKitSourceBufferList;
    9699}
    97100
    98 ScriptExecutionContext* SourceBufferList::scriptExecutionContext() const
     101ScriptExecutionContext* WebKitSourceBufferList::scriptExecutionContext() const
    99102{
    100     return &m_scriptExecutionContext;
     103    return m_scriptExecutionContext;
    101104}
    102105
    103 EventTargetData* SourceBufferList::eventTargetData()
     106EventTargetData* WebKitSourceBufferList::eventTargetData()
    104107{
    105108    return &m_eventTargetData;
    106109}
    107110
    108 EventTargetData& SourceBufferList::ensureEventTargetData()
     111EventTargetData& WebKitSourceBufferList::ensureEventTargetData()
    109112{
    110113    return m_eventTargetData;
  • trunk/Source/WebCore/Modules/mediasource/WebKitSourceBufferList.h

    r156048 r156049  
    2929 */
    3030
    31 #ifndef SourceBufferList_h
    32 #define SourceBufferList_h
     31#ifndef WebKitSourceBufferList_h
     32#define WebKitSourceBufferList_h
    3333
    3434#if ENABLE(MEDIA_SOURCE)
    3535
    3636#include "EventTarget.h"
     37#include "GenericEventQueue.h"
     38#include "ScriptWrappable.h"
    3739#include <wtf/RefCounted.h>
    3840#include <wtf/Vector.h>
     
    4042namespace WebCore {
    4143
    42 class SourceBuffer;
     44class WebKitSourceBuffer;
    4345class GenericEventQueue;
    4446
    45 class SourceBufferList : public RefCounted<SourceBufferList>, public EventTarget {
     47class WebKitSourceBufferList : public RefCounted<WebKitSourceBufferList>, public ScriptWrappable, public EventTarget {
    4648public:
    47     static PassRefPtr<SourceBufferList> create(ScriptExecutionContext& context, GenericEventQueue& asyncEventQueue)
     49    static PassRefPtr<WebKitSourceBufferList> create(ScriptExecutionContext* context)
    4850    {
    49         return adoptRef(new SourceBufferList(context, asyncEventQueue));
     51        return adoptRef(new WebKitSourceBufferList(context));
    5052    }
    51     virtual ~SourceBufferList() { }
     53    virtual ~WebKitSourceBufferList();
    5254
    5355    unsigned length() const;
    54     SourceBuffer* item(unsigned index) const;
     56    WebKitSourceBuffer* item(unsigned index) const;
    5557
    56     void add(PassRefPtr<SourceBuffer>);
    57     bool remove(SourceBuffer*);
     58    void add(PassRefPtr<WebKitSourceBuffer>);
     59    bool remove(WebKitSourceBuffer*);
    5860    void clear();
    5961
     
    6264    virtual ScriptExecutionContext* scriptExecutionContext() const OVERRIDE;
    6365
    64     using RefCounted<SourceBufferList>::ref;
    65     using RefCounted<SourceBufferList>::deref;
     66    using RefCounted<WebKitSourceBufferList>::ref;
     67    using RefCounted<WebKitSourceBufferList>::deref;
    6668
    6769protected:
     
    7072
    7173private:
    72     SourceBufferList(ScriptExecutionContext*, GenericEventQueue*);
     74    WebKitSourceBufferList(ScriptExecutionContext*);
    7375
    7476    void createAndFireEvent(const AtomicString&);
     
    7880
    7981    EventTargetData m_eventTargetData;
    80     ScriptExecutionContext& m_scriptExecutionContext;
    81     GenericEventQueue& m_asyncEventQueue;
     82    ScriptExecutionContext* m_scriptExecutionContext;
     83    GenericEventQueue m_asyncEventQueue;
    8284
    83     Vector<RefPtr<SourceBuffer> > m_list;
     85    Vector<RefPtr<WebKitSourceBuffer> > m_list;
    8486};
    8587
  • trunk/Source/WebCore/Modules/mediasource/WebKitSourceBufferList.idl

    r156048 r156049  
    3131[
    3232    Conditional=MEDIA_SOURCE,
    33     InterfaceName=WebKitSourceBuffer
    34 ] interface SourceBuffer {
    35 
    36     // Returns the time ranges buffered.
    37     [GetterRaisesException] readonly attribute TimeRanges buffered;
    38 
    39     // Applies an offset to media segment timestamps.
    40     [SetterRaisesException] attribute double timestampOffset;
    41 
    42     // Append segment data.
    43     [RaisesException] void append(Uint8Array data);
    44 
    45     // Abort the current segment append sequence.
    46     [RaisesException] void abort();
     33    EventTarget,
     34    JSGenerateToNativeObject
     35] interface WebKitSourceBufferList : EventTarget {
     36    readonly attribute unsigned long length;
     37    getter WebKitSourceBuffer item(unsigned long index);
    4738};
    4839
  • trunk/Source/WebCore/Modules/mediastream/MediaStream.cpp

    r155573 r156049  
    3232#include "ExceptionCode.h"
    3333#include "MediaStreamCenter.h"
     34#include "MediaStreamRegistry.h"
    3435#include "MediaStreamSource.h"
    3536#include "MediaStreamTrackEvent.h"
     
    354355}
    355356
     357URLRegistry& MediaStream::registry() const
     358{
     359    return MediaStreamRegistry::registry();
     360}
     361
    356362} // namespace WebCore
    357363
  • trunk/Source/WebCore/Modules/mediastream/MediaStream.h

    r155789 r156049  
    3636#include "ScriptWrappable.h"
    3737#include "Timer.h"
     38#include "URLRegistry.h"
    3839#include <wtf/RefCounted.h>
    3940#include <wtf/RefPtr.h>
     
    4142namespace WebCore {
    4243
    43 class MediaStream : public RefCounted<MediaStream>, public ScriptWrappable, public MediaStreamDescriptorClient, public EventTarget, public ContextDestructionObserver {
     44class MediaStream : public RefCounted<MediaStream>, public URLRegistrable, public ScriptWrappable, public MediaStreamDescriptorClient, public EventTarget, public ContextDestructionObserver {
    4445public:
    4546    static PassRefPtr<MediaStream> create(ScriptExecutionContext*);
     
    7778    using RefCounted<MediaStream>::ref;
    7879    using RefCounted<MediaStream>::deref;
     80
     81    // URLRegistrable
     82    virtual URLRegistry& registry() const OVERRIDE;
    7983
    8084protected:
  • trunk/Source/WebCore/Modules/mediastream/MediaStreamRegistry.cpp

    r155248 r156049  
    4242}
    4343
    44 void MediaStreamRegistry::registerMediaStreamURL(const KURL& url, PassRefPtr<MediaStream> stream)
     44void MediaStreamRegistry::registerURL(SecurityOrigin*, const KURL& url, URLRegistrable* stream)
    4545{
     46    ASSERT(&stream->registry() == this);
    4647    ASSERT(isMainThread());
    47     m_streamDescriptors.set(url.string(), stream->descriptor());
     48    m_streamDescriptors.set(url.string(), static_cast<MediaStream*>(stream)->descriptor());
    4849}
    4950
    50 void MediaStreamRegistry::unregisterMediaStreamURL(const KURL& url)
     51void MediaStreamRegistry::unregisterURL(const KURL& url)
    5152{
    5253    ASSERT(isMainThread());
  • trunk/Source/WebCore/Modules/mediastream/MediaStreamRegistry.h

    r99087 r156049  
    2828#if ENABLE(MEDIA_STREAM)
    2929
     30#include "URLRegistry.h"
    3031#include <wtf/HashMap.h>
    3132#include <wtf/PassRefPtr.h>
     
    3839class MediaStreamDescriptor;
    3940
    40 class MediaStreamRegistry {
     41class MediaStreamRegistry : public URLRegistry {
    4142public:
    4243    // Returns a single instance of MediaStreamRegistry.
     
    4445
    4546    // Registers a blob URL referring to the specified stream data.
    46     void registerMediaStreamURL(const KURL&, PassRefPtr<MediaStream>);
    47     void unregisterMediaStreamURL(const KURL&);
     47    virtual void registerURL(SecurityOrigin*, const KURL&, URLRegistrable*) OVERRIDE;
     48    virtual void unregisterURL(const KURL&) OVERRIDE;
    4849
    4950    MediaStreamDescriptor* lookupMediaStreamDescriptor(const String& url);
  • trunk/Source/WebCore/Modules/mediastream/URLMediaStream.cpp

    r156048 r156049  
    11/*
    2  * Copyright (C) 2012 Google Inc. All rights reserved.
     2 * Copyright (C) 2013 Google Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    2828 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    2929 */
    30  
    31 [
    32     Conditional=MEDIA_SOURCE,
    33     InterfaceName=WebKitSourceBuffer
    34 ] interface SourceBuffer {
    3530
    36     // Returns the time ranges buffered.
    37     [GetterRaisesException] readonly attribute TimeRanges buffered;
     31#include "config.h"
     32#include "URLMediaStream.h"
    3833
    39     // Applies an offset to media segment timestamps.
    40     [SetterRaisesException] attribute double timestampOffset;
     34#include "DOMURL.h"
     35#include "MediaStream.h"
     36#include <wtf/MainThread.h>
    4137
    42     // Append segment data.
    43     [RaisesException] void append(Uint8Array data);
     38namespace WebCore {
    4439
    45     // Abort the current segment append sequence.
    46     [RaisesException] void abort();
    47 };
     40String URLMediaStream::createObjectURL(ScriptExecutionContext* scriptExecutionContext, MediaStream* stream)
     41{
     42    // Since WebWorkers cannot obtain Stream objects, we should be on the main thread.
     43    ASSERT(isMainThread());
    4844
     45    if (!scriptExecutionContext || !stream)
     46        return String();
     47    return DOMURL::createPublicURL(scriptExecutionContext, stream);
     48}
     49
     50
     51} // namespace WebCore
  • trunk/Source/WebCore/Modules/mediastream/URLMediaStream.h

    r156048 r156049  
    11/*
    2  * Copyright (C) 2012 Google Inc. All rights reserved.
     2 * Copyright (C) 2013 Google Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    2828 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    2929 */
    30  
    31 [
    32     Conditional=MEDIA_SOURCE,
    33     InterfaceName=WebKitSourceBuffer
    34 ] interface SourceBuffer {
    3530
    36     // Returns the time ranges buffered.
    37     [GetterRaisesException] readonly attribute TimeRanges buffered;
     31#ifndef URLMediaStream_h
     32#define URLMediaStream_h
    3833
    39     // Applies an offset to media segment timestamps.
    40     [SetterRaisesException] attribute double timestampOffset;
     34#include <wtf/Forward.h>
    4135
    42     // Append segment data.
    43     [RaisesException] void append(Uint8Array data);
     36namespace WebCore {
    4437
    45     // Abort the current segment append sequence.
    46     [RaisesException] void abort();
     38class MediaStream;
     39class ScriptExecutionContext;
     40
     41class URLMediaStream {
     42public:
     43    static String createObjectURL(ScriptExecutionContext*, MediaStream*);
    4744};
    4845
     46} // namespace WebCore
     47
     48#endif
  • trunk/Source/WebCore/Modules/mediastream/URLMediaStream.idl

    r156048 r156049  
    11/*
    2  * Copyright (C) 2012 Google Inc. All rights reserved.
     2 * Copyright (C) 2013 Google Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    2828 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    2929 */
    30  
    31 [
    32     Conditional=MEDIA_SOURCE,
    33     InterfaceName=WebKitSourceBuffer
    34 ] interface SourceBuffer {
    35 
    36     // Returns the time ranges buffered.
    37     [GetterRaisesException] readonly attribute TimeRanges buffered;
    38 
    39     // Applies an offset to media segment timestamps.
    40     [SetterRaisesException] attribute double timestampOffset;
    41 
    42     // Append segment data.
    43     [RaisesException] void append(Uint8Array data);
    44 
    45     // Abort the current segment append sequence.
    46     [RaisesException] void abort();
     30partial interface URL {
     31    [CallWith=ScriptExecutionContext,TreatReturnedNullStringAs=Null] static DOMString createObjectURL(MediaStream? stream);
    4732};
    48 
  • trunk/Source/WebCore/Target.pri

    r156038 r156049  
    694694    html/PasswordInputType.cpp \
    695695    html/PluginDocument.cpp \
     696    html/PublicURLManager.cpp \
    696697    html/RadioInputType.cpp \
    697698    html/RadioNodeList.cpp \
  • trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj

    r156038 r156049  
    103103                0720B0A114D3323500642955 /* GenericEventQueue.h in Headers */ = {isa = PBXBuildFile; fileRef = 0720B09F14D3323500642955 /* GenericEventQueue.h */; settings = {ATTRIBUTES = (Private, ); }; };
    104104                0720B0A114D3323500642957 /* GestureEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 0720B09F14D3323500642957 /* GestureEvent.h */; settings = {ATTRIBUTES = (Private, ); }; };
    105                 07277E4A17D018CC0015534D /* JSMediaSource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 07277E3E17D018CC0015534D /* JSMediaSource.cpp */; };
    106                 07277E4B17D018CC0015534D /* JSMediaSource.h in Headers */ = {isa = PBXBuildFile; fileRef = 07277E3F17D018CC0015534D /* JSMediaSource.h */; };
    107105                07277E4C17D018CC0015534D /* JSMediaStream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 07277E4017D018CC0015534D /* JSMediaStream.cpp */; };
    108106                07277E4D17D018CC0015534D /* JSMediaStream.h in Headers */ = {isa = PBXBuildFile; fileRef = 07277E4117D018CC0015534D /* JSMediaStream.h */; settings = {ATTRIBUTES = (Private, ); }; };
     
    52975295                CD27F6E7145770D30078207D /* MediaController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CD27F6E6145770D30078207D /* MediaController.cpp */; };
    52985296                CD37B39815C1B971006DC898 /* DiagnosticLoggingKeys.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CD37B37415C1A7E1006DC898 /* DiagnosticLoggingKeys.cpp */; };
     5297                CD3A495217A9C8C600274E42 /* MediaSourceBase.h in Headers */ = {isa = PBXBuildFile; fileRef = CD3A495117A9C8B600274E42 /* MediaSourceBase.h */; };
     5298                CD3A495417A9CC9000274E42 /* MediaSourceBase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CD3A495017A9C8B600274E42 /* MediaSourceBase.cpp */; };
     5299                CD3A495E17A9D01B00274E42 /* MediaSource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CD3A495517A9D01B00274E42 /* MediaSource.cpp */; };
     5300                CD3A495F17A9D01B00274E42 /* MediaSource.h in Headers */ = {isa = PBXBuildFile; fileRef = CD3A495617A9D01B00274E42 /* MediaSource.h */; };
     5301                CD3A496117A9D01B00274E42 /* SourceBuffer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CD3A495817A9D01B00274E42 /* SourceBuffer.cpp */; };
     5302                CD3A496217A9D01B00274E42 /* SourceBuffer.h in Headers */ = {isa = PBXBuildFile; fileRef = CD3A495917A9D01B00274E42 /* SourceBuffer.h */; };
     5303                CD3A496417A9D01B00274E42 /* SourceBufferList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CD3A495B17A9D01B00274E42 /* SourceBufferList.cpp */; };
     5304                CD3A496517A9D01B00274E42 /* SourceBufferList.h in Headers */ = {isa = PBXBuildFile; fileRef = CD3A495C17A9D01B00274E42 /* SourceBufferList.h */; };
    52995305                CD47B3FC16CC34F800A21EC8 /* CDMPrivateAVFoundation.mm in Sources */ = {isa = PBXBuildFile; fileRef = CD47B3FA16CC34F800A21EC8 /* CDMPrivateAVFoundation.mm */; };
    53005306                CD4AC52A1496AE9A0087C4EF /* Composite.wav in Copy Audio Resources */ = {isa = PBXBuildFile; fileRef = CD4AC5281496AE2F0087C4EF /* Composite.wav */; };
     
    53035309                CD54DE4717468B6F005E5B36 /* AudioSessionManagerMac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CD54DE4517468B6F005E5B36 /* AudioSessionManagerMac.cpp */; };
    53045310                CD54DE4B17469C6D005E5B36 /* AudioSessionMac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CD54DE4917469C6D005E5B36 /* AudioSessionMac.cpp */; };
     5311                CD61FE631794AADB004101EB /* WebKitMediaSource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B1A942DE15B5CE2200D525D1 /* WebKitMediaSource.cpp */; };
     5312                CD61FE641794AADB004101EB /* WebKitMediaSource.h in Headers */ = {isa = PBXBuildFile; fileRef = B1A942DF15B5CE2200D525D1 /* WebKitMediaSource.h */; };
     5313                CD61FE671794AADB004101EB /* MediaSourceRegistry.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B1A942E115B5CE2200D525D1 /* MediaSourceRegistry.cpp */; };
     5314                CD61FE681794AADB004101EB /* MediaSourceRegistry.h in Headers */ = {isa = PBXBuildFile; fileRef = B1A942E215B5CE2200D525D1 /* MediaSourceRegistry.h */; };
     5315                CD61FE691794AADB004101EB /* WebKitSourceBuffer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B1A942E315B5CE2200D525D1 /* WebKitSourceBuffer.cpp */; };
     5316                CD61FE6A1794AADB004101EB /* WebKitSourceBuffer.h in Headers */ = {isa = PBXBuildFile; fileRef = B1A942E415B5CE2200D525D1 /* WebKitSourceBuffer.h */; };
     5317                CD61FE6B1794AADB004101EB /* WebKitSourceBufferList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B1A942E615B5CE2200D525D1 /* WebKitSourceBufferList.cpp */; };
     5318                CD61FE6C1794AADB004101EB /* WebKitSourceBufferList.h in Headers */ = {isa = PBXBuildFile; fileRef = B1A942E715B5CE2200D525D1 /* WebKitSourceBufferList.h */; };
     5319                CD61FE7E1794CB26004101EB /* JSWebKitMediaSource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CD61FE7C1794CB26004101EB /* JSWebKitMediaSource.cpp */; };
     5320                CD61FE7F1794CB26004101EB /* JSWebKitMediaSource.h in Headers */ = {isa = PBXBuildFile; fileRef = CD61FE7D1794CB26004101EB /* JSWebKitMediaSource.h */; };
     5321                CD61FE841794CC59004101EB /* JSWebKitSourceBuffer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CD61FE801794CC59004101EB /* JSWebKitSourceBuffer.cpp */; };
     5322                CD61FE851794CC59004101EB /* JSWebKitSourceBuffer.h in Headers */ = {isa = PBXBuildFile; fileRef = CD61FE811794CC59004101EB /* JSWebKitSourceBuffer.h */; };
     5323                CD61FE861794CC59004101EB /* JSWebKitSourceBufferList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CD61FE821794CC59004101EB /* JSWebKitSourceBufferList.cpp */; };
     5324                CD61FE871794CC59004101EB /* JSWebKitSourceBufferList.h in Headers */ = {isa = PBXBuildFile; fileRef = CD61FE831794CC59004101EB /* JSWebKitSourceBufferList.h */; };
    53055325                CD7E05221651C28200C1201F /* WebCoreAVFResourceLoader.mm in Sources */ = {isa = PBXBuildFile; fileRef = CD7E05211651A84100C1201F /* WebCoreAVFResourceLoader.mm */; };
    53065326                CD82030A1395AB6A00F956C6 /* WebVideoFullscreenController.h in Headers */ = {isa = PBXBuildFile; fileRef = CD8203061395AB6A00F956C6 /* WebVideoFullscreenController.h */; settings = {ATTRIBUTES = (Private, ); }; };
     
    53105330                CD8203101395ACE700F956C6 /* WebWindowAnimation.h in Headers */ = {isa = PBXBuildFile; fileRef = CD82030E1395ACE700F956C6 /* WebWindowAnimation.h */; settings = {ATTRIBUTES = (Private, ); }; };
    53115331                CD8203111395ACE700F956C6 /* WebWindowAnimation.mm in Sources */ = {isa = PBXBuildFile; fileRef = CD82030F1395ACE700F956C6 /* WebWindowAnimation.mm */; };
     5332                CD9DE17417AAC74C00EA386D /* JSMediaSource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CD9DE17217AAC74C00EA386D /* JSMediaSource.cpp */; };
     5333                CD9DE17517AAC74C00EA386D /* JSMediaSource.h in Headers */ = {isa = PBXBuildFile; fileRef = CD9DE17317AAC74C00EA386D /* JSMediaSource.h */; };
     5334                CD9DE17A17AAC75B00EA386D /* JSSourceBuffer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CD9DE17617AAC75B00EA386D /* JSSourceBuffer.cpp */; };
     5335                CD9DE17B17AAC75B00EA386D /* JSSourceBuffer.h in Headers */ = {isa = PBXBuildFile; fileRef = CD9DE17717AAC75B00EA386D /* JSSourceBuffer.h */; };
     5336                CD9DE17C17AAC75B00EA386D /* JSSourceBufferList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CD9DE17817AAC75B00EA386D /* JSSourceBufferList.cpp */; };
     5337                CD9DE17D17AAC75B00EA386D /* JSSourceBufferList.h in Headers */ = {isa = PBXBuildFile; fileRef = CD9DE17917AAC75B00EA386D /* JSSourceBufferList.h */; };
     5338                CD9DE18117AAD6A400EA386D /* URLMediaSource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CD9DE17E17AAD64E00EA386D /* URLMediaSource.cpp */; };
     5339                CD9DE18217AAD6A400EA386D /* URLMediaSource.h in Headers */ = {isa = PBXBuildFile; fileRef = CD9DE17F17AAD64E00EA386D /* URLMediaSource.h */; };
     5340                CD9DE18517AB0CF300EA386D /* HTMLMediaSource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CD9DE18317AB0CF300EA386D /* HTMLMediaSource.cpp */; };
     5341                CD9DE18617AB0CF300EA386D /* HTMLMediaSource.h in Headers */ = {isa = PBXBuildFile; fileRef = CD9DE18417AB0CF300EA386D /* HTMLMediaSource.h */; };
    53125342                CDA79824170A258300D45C55 /* AudioSession.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CDA79823170A258300D45C55 /* AudioSession.cpp */; };
    53135343                CDA79827170A279100D45C55 /* AudioSessionIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = CDA79825170A279000D45C55 /* AudioSessionIOS.mm */; };
     
    53395369                CDEA7C841276230400B846DD /* RenderFullScreen.h in Headers */ = {isa = PBXBuildFile; fileRef = CDEA7C821276230400B846DD /* RenderFullScreen.h */; };
    53405370                CDEA7C851276230400B846DD /* RenderFullScreen.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CDEA7C831276230400B846DD /* RenderFullScreen.cpp */; };
     5371                CDEE393717974259001D7580 /* PublicURLManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CDEE393617974259001D7580 /* PublicURLManager.cpp */; };
    53415372                CDF65CC8145B1E7500C4C7AA /* MediaController.h in Headers */ = {isa = PBXBuildFile; fileRef = CD27F6E4145767870078207D /* MediaController.h */; settings = {ATTRIBUTES = (Private, ); }; };
    53425373                CDF65CCA145B448800C4C7AA /* MediaControllerInterface.h in Headers */ = {isa = PBXBuildFile; fileRef = CDF65CC9145B43A700C4C7AA /* MediaControllerInterface.h */; settings = {ATTRIBUTES = (Private, ); }; };
     
    65336564                07221BAF17CF0AD400848E51 /* RTCStatsResponseBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RTCStatsResponseBase.h; sourceTree = "<group>"; };
    65346565                07221BB017CF0AD400848E51 /* RTCVoidRequest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RTCVoidRequest.h; sourceTree = "<group>"; };
    6535                 07277E3E17D018CC0015534D /* JSMediaSource.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSMediaSource.cpp; sourceTree = "<group>"; };
    6536                 07277E3F17D018CC0015534D /* JSMediaSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSMediaSource.h; sourceTree = "<group>"; };
    65376566                07277E4017D018CC0015534D /* JSMediaStream.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSMediaStream.cpp; sourceTree = "<group>"; };
    65386567                07277E4117D018CC0015534D /* JSMediaStream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSMediaStream.h; sourceTree = "<group>"; };
     
    1067610705                B10B697F140C174000BC1C26 /* WebVTTTokenizer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebVTTTokenizer.h; sourceTree = "<group>"; };
    1067710706                B1827492134CA4C100B98C2D /* CallbackFunction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CallbackFunction.cpp; sourceTree = "<group>"; };
    10678                 B1A942DE15B5CE2200D525D1 /* MediaSource.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MediaSource.cpp; sourceTree = "<group>"; };
    10679                 B1A942DF15B5CE2200D525D1 /* MediaSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaSource.h; sourceTree = "<group>"; };
    10680                 B1A942E015B5CE2200D525D1 /* MediaSource.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = MediaSource.idl; sourceTree = "<group>"; };
     10707                B1A942DE15B5CE2200D525D1 /* WebKitMediaSource.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebKitMediaSource.cpp; sourceTree = "<group>"; };
     10708                B1A942DF15B5CE2200D525D1 /* WebKitMediaSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebKitMediaSource.h; sourceTree = "<group>"; };
     10709                B1A942E015B5CE2200D525D1 /* WebKitMediaSource.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = WebKitMediaSource.idl; sourceTree = "<group>"; };
    1068110710                B1A942E115B5CE2200D525D1 /* MediaSourceRegistry.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MediaSourceRegistry.cpp; sourceTree = "<group>"; };
    1068210711                B1A942E215B5CE2200D525D1 /* MediaSourceRegistry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaSourceRegistry.h; sourceTree = "<group>"; };
    10683                 B1A942E315B5CE2200D525D1 /* SourceBuffer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SourceBuffer.cpp; sourceTree = "<group>"; };
    10684                 B1A942E415B5CE2200D525D1 /* SourceBuffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SourceBuffer.h; sourceTree = "<group>"; };
    10685                 B1A942E515B5CE2200D525D1 /* SourceBuffer.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = SourceBuffer.idl; sourceTree = "<group>"; };
    10686                 B1A942E615B5CE2200D525D1 /* SourceBufferList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SourceBufferList.cpp; sourceTree = "<group>"; };
    10687                 B1A942E715B5CE2200D525D1 /* SourceBufferList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SourceBufferList.h; sourceTree = "<group>"; };
    10688                 B1A942E815B5CE2200D525D1 /* SourceBufferList.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = SourceBufferList.idl; sourceTree = "<group>"; };
     10712                B1A942E315B5CE2200D525D1 /* WebKitSourceBuffer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebKitSourceBuffer.cpp; sourceTree = "<group>"; };
     10713                B1A942E415B5CE2200D525D1 /* WebKitSourceBuffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebKitSourceBuffer.h; sourceTree = "<group>"; };
     10714                B1A942E515B5CE2200D525D1 /* WebKitSourceBuffer.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = WebKitSourceBuffer.idl; sourceTree = "<group>"; };
     10715                B1A942E615B5CE2200D525D1 /* WebKitSourceBufferList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebKitSourceBufferList.cpp; sourceTree = "<group>"; };
     10716                B1A942E715B5CE2200D525D1 /* WebKitSourceBufferList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebKitSourceBufferList.h; sourceTree = "<group>"; };
     10717                B1A942E815B5CE2200D525D1 /* WebKitSourceBufferList.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = WebKitSourceBufferList.idl; sourceTree = "<group>"; };
    1068910718                B1AD4E7113A12A4600846B27 /* TextTrackLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = TextTrackLoader.cpp; path = loader/TextTrackLoader.cpp; sourceTree = SOURCE_ROOT; };
    1069010719                B1AD4E7213A12A4600846B27 /* TextTrackLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TextTrackLoader.h; path = loader/TextTrackLoader.h; sourceTree = SOURCE_ROOT; };
     
    1216612195                CD37B37415C1A7E1006DC898 /* DiagnosticLoggingKeys.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DiagnosticLoggingKeys.cpp; sourceTree = "<group>"; };
    1216712196                CD37B37515C1A7E1006DC898 /* DiagnosticLoggingKeys.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DiagnosticLoggingKeys.h; sourceTree = "<group>"; };
     12197                CD3A495017A9C8B600274E42 /* MediaSourceBase.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = MediaSourceBase.cpp; sourceTree = "<group>"; };
     12198                CD3A495117A9C8B600274E42 /* MediaSourceBase.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MediaSourceBase.h; sourceTree = "<group>"; };
     12199                CD3A495517A9D01B00274E42 /* MediaSource.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MediaSource.cpp; sourceTree = "<group>"; };
     12200                CD3A495617A9D01B00274E42 /* MediaSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaSource.h; sourceTree = "<group>"; };
     12201                CD3A495717A9D01B00274E42 /* MediaSource.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = MediaSource.idl; sourceTree = "<group>"; };
     12202                CD3A495817A9D01B00274E42 /* SourceBuffer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SourceBuffer.cpp; sourceTree = "<group>"; };
     12203                CD3A495917A9D01B00274E42 /* SourceBuffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SourceBuffer.h; sourceTree = "<group>"; };
     12204                CD3A495A17A9D01B00274E42 /* SourceBuffer.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = SourceBuffer.idl; sourceTree = "<group>"; };
     12205                CD3A495B17A9D01B00274E42 /* SourceBufferList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SourceBufferList.cpp; sourceTree = "<group>"; };
     12206                CD3A495C17A9D01B00274E42 /* SourceBufferList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SourceBufferList.h; sourceTree = "<group>"; };
     12207                CD3A495D17A9D01B00274E42 /* SourceBufferList.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = SourceBufferList.idl; sourceTree = "<group>"; };
    1216812208                CD47B3F916CC34F800A21EC8 /* CDMPrivateAVFoundation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CDMPrivateAVFoundation.h; path = Modules/encryptedmedia/CDMPrivateAVFoundation.h; sourceTree = "<group>"; };
    1216912209                CD47B3FA16CC34F800A21EC8 /* CDMPrivateAVFoundation.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = CDMPrivateAVFoundation.mm; path = Modules/encryptedmedia/CDMPrivateAVFoundation.mm; sourceTree = "<group>"; };
     
    1217612216                CD54DE4517468B6F005E5B36 /* AudioSessionManagerMac.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AudioSessionManagerMac.cpp; sourceTree = "<group>"; };
    1217712217                CD54DE4917469C6D005E5B36 /* AudioSessionMac.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AudioSessionMac.cpp; sourceTree = "<group>"; };
     12218                CD61FE7C1794CB26004101EB /* JSWebKitMediaSource.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSWebKitMediaSource.cpp; sourceTree = "<group>"; };
     12219                CD61FE7D1794CB26004101EB /* JSWebKitMediaSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSWebKitMediaSource.h; sourceTree = "<group>"; };
     12220                CD61FE801794CC59004101EB /* JSWebKitSourceBuffer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSWebKitSourceBuffer.cpp; sourceTree = "<group>"; };
     12221                CD61FE811794CC59004101EB /* JSWebKitSourceBuffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSWebKitSourceBuffer.h; sourceTree = "<group>"; };
     12222                CD61FE821794CC59004101EB /* JSWebKitSourceBufferList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSWebKitSourceBufferList.cpp; sourceTree = "<group>"; };
     12223                CD61FE831794CC59004101EB /* JSWebKitSourceBufferList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSWebKitSourceBufferList.h; sourceTree = "<group>"; };
    1217812224                CD7E05201651A84100C1201F /* WebCoreAVFResourceLoader.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = WebCoreAVFResourceLoader.h; path = objc/WebCoreAVFResourceLoader.h; sourceTree = "<group>"; };
    1217912225                CD7E05211651A84100C1201F /* WebCoreAVFResourceLoader.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; name = WebCoreAVFResourceLoader.mm; path = objc/WebCoreAVFResourceLoader.mm; sourceTree = "<group>"; };
     
    1218412230                CD82030E1395ACE700F956C6 /* WebWindowAnimation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebWindowAnimation.h; sourceTree = "<group>"; };
    1218512231                CD82030F1395ACE700F956C6 /* WebWindowAnimation.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebWindowAnimation.mm; sourceTree = "<group>"; };
     12232                CD9DE17217AAC74C00EA386D /* JSMediaSource.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSMediaSource.cpp; sourceTree = "<group>"; };
     12233                CD9DE17317AAC74C00EA386D /* JSMediaSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSMediaSource.h; sourceTree = "<group>"; };
     12234                CD9DE17617AAC75B00EA386D /* JSSourceBuffer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSSourceBuffer.cpp; sourceTree = "<group>"; };
     12235                CD9DE17717AAC75B00EA386D /* JSSourceBuffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSSourceBuffer.h; sourceTree = "<group>"; };
     12236                CD9DE17817AAC75B00EA386D /* JSSourceBufferList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSSourceBufferList.cpp; sourceTree = "<group>"; };
     12237                CD9DE17917AAC75B00EA386D /* JSSourceBufferList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSSourceBufferList.h; sourceTree = "<group>"; };
     12238                CD9DE17E17AAD64E00EA386D /* URLMediaSource.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = URLMediaSource.cpp; sourceTree = "<group>"; };
     12239                CD9DE17F17AAD64E00EA386D /* URLMediaSource.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = URLMediaSource.h; sourceTree = "<group>"; };
     12240                CD9DE18017AAD64E00EA386D /* URLMediaSource.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = URLMediaSource.idl; sourceTree = "<group>"; };
     12241                CD9DE18317AB0CF300EA386D /* HTMLMediaSource.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HTMLMediaSource.cpp; sourceTree = "<group>"; };
     12242                CD9DE18417AB0CF300EA386D /* HTMLMediaSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTMLMediaSource.h; sourceTree = "<group>"; };
    1218612243                CDA79821170A22DC00D45C55 /* AudioSession.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AudioSession.h; sourceTree = "<group>"; };
    1218712244                CDA79822170A24F400D45C55 /* AudioSessionListener.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AudioSessionListener.h; sourceTree = "<group>"; };
     
    1224212299                CDEA7C821276230400B846DD /* RenderFullScreen.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderFullScreen.h; sourceTree = "<group>"; };
    1224312300                CDEA7C831276230400B846DD /* RenderFullScreen.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderFullScreen.cpp; sourceTree = "<group>"; };
     12301                CDEE393617974259001D7580 /* PublicURLManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PublicURLManager.cpp; sourceTree = "<group>"; };
     12302                CDEE393817974274001D7580 /* URLRegistry.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = URLRegistry.h; sourceTree = "<group>"; };
    1224412303                CDF65CC9145B43A700C4C7AA /* MediaControllerInterface.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaControllerInterface.h; sourceTree = "<group>"; };
    1224512304                CDF65CCC145B6AFE00C4C7AA /* JSHTMLMediaElementCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSHTMLMediaElementCustom.cpp; sourceTree = "<group>"; };
     
    1338413443                        isa = PBXGroup;
    1338513444                        children = (
    13386                                 07277E3E17D018CC0015534D /* JSMediaSource.cpp */,
    13387                                 07277E3F17D018CC0015534D /* JSMediaSource.h */,
    1338813445                                07277E4017D018CC0015534D /* JSMediaStream.cpp */,
    1338913446                                07277E4117D018CC0015534D /* JSMediaStream.h */,
     
    1370513762                                AA93C850175D5B2000FD3CE3 /* IndieUI */,
    1370613763                                1C5FAECA0DCFD8C900D58F78 /* Inspector */,
     13764                                CD61FE7B1794CA02004101EB /* MediaSource */,
    1370713765                                07CFD99317D01405001C4FFC /* MediaStream */,
    1370813766                                33503C9C10179A9A003B47E1 /* Notifications */,
     
    1633116389                                E44613930CD6331000FADA75 /* HTMLMediaElement.h */,
    1633216390                                E44613940CD6331000FADA75 /* HTMLMediaElement.idl */,
     16391                                CD9DE18317AB0CF300EA386D /* HTMLMediaSource.cpp */,
     16392                                CD9DE18417AB0CF300EA386D /* HTMLMediaSource.h */,
    1633316393                                A8EA79EC0A1916DF00A8EF5F /* HTMLMenuElement.cpp */,
    1633416394                                A8EA79E80A1916DF00A8EF5F /* HTMLMenuElement.h */,
     
    1648716547                                97205AB91239292700B17380 /* PluginDocument.cpp */,
    1648816548                                97205ABA1239292700B17380 /* PluginDocument.h */,
     16549                                CDEE393617974259001D7580 /* PublicURLManager.cpp */,
    1648916550                                10FB084A14E15C7E00A3DB98 /* PublicURLManager.h */,
    1649016551                                F55B3D971251F12D003EF269 /* RadioInputType.cpp */,
     
    1652116582                                F55B3DA91251F12D003EF269 /* URLInputType.cpp */,
    1652216583                                F55B3DAA1251F12D003EF269 /* URLInputType.h */,
     16584                                CDEE393817974274001D7580 /* URLRegistry.h */,
    1652316585                                F5A154251279534D00D0B0C0 /* ValidationMessage.cpp */,
    1652416586                                F5A154261279534D00D0B0C0 /* ValidationMessage.h */,
     
    1807118133                        isa = PBXGroup;
    1807218134                        children = (
    18073                                 B1A942DE15B5CE2200D525D1 /* MediaSource.cpp */,
    18074                                 B1A942DF15B5CE2200D525D1 /* MediaSource.h */,
    18075                                 B1A942E015B5CE2200D525D1 /* MediaSource.idl */,
     18135                                CD3A495517A9D01B00274E42 /* MediaSource.cpp */,
     18136                                CD3A495617A9D01B00274E42 /* MediaSource.h */,
     18137                                CD3A495717A9D01B00274E42 /* MediaSource.idl */,
     18138                                CD3A495017A9C8B600274E42 /* MediaSourceBase.cpp */,
     18139                                CD3A495117A9C8B600274E42 /* MediaSourceBase.h */,
    1807618140                                B1A942E115B5CE2200D525D1 /* MediaSourceRegistry.cpp */,
    1807718141                                B1A942E215B5CE2200D525D1 /* MediaSourceRegistry.h */,
    18078                                 B1A942E315B5CE2200D525D1 /* SourceBuffer.cpp */,
    18079                                 B1A942E415B5CE2200D525D1 /* SourceBuffer.h */,
    18080                                 B1A942E515B5CE2200D525D1 /* SourceBuffer.idl */,
    18081                                 B1A942E615B5CE2200D525D1 /* SourceBufferList.cpp */,
    18082                                 B1A942E715B5CE2200D525D1 /* SourceBufferList.h */,
    18083                                 B1A942E815B5CE2200D525D1 /* SourceBufferList.idl */,
     18142                                CD3A495817A9D01B00274E42 /* SourceBuffer.cpp */,
     18143                                CD3A495917A9D01B00274E42 /* SourceBuffer.h */,
     18144                                CD3A495A17A9D01B00274E42 /* SourceBuffer.idl */,
     18145                                CD3A495B17A9D01B00274E42 /* SourceBufferList.cpp */,
     18146                                CD3A495C17A9D01B00274E42 /* SourceBufferList.h */,
     18147                                CD3A495D17A9D01B00274E42 /* SourceBufferList.idl */,
     18148                                CD9DE17E17AAD64E00EA386D /* URLMediaSource.cpp */,
     18149                                CD9DE17F17AAD64E00EA386D /* URLMediaSource.h */,
     18150                                CD9DE18017AAD64E00EA386D /* URLMediaSource.idl */,
     18151                                B1A942DE15B5CE2200D525D1 /* WebKitMediaSource.cpp */,
     18152                                B1A942DF15B5CE2200D525D1 /* WebKitMediaSource.h */,
     18153                                B1A942E015B5CE2200D525D1 /* WebKitMediaSource.idl */,
     18154                                B1A942E315B5CE2200D525D1 /* WebKitSourceBuffer.cpp */,
     18155                                B1A942E415B5CE2200D525D1 /* WebKitSourceBuffer.h */,
     18156                                B1A942E515B5CE2200D525D1 /* WebKitSourceBuffer.idl */,
     18157                                B1A942E615B5CE2200D525D1 /* WebKitSourceBufferList.cpp */,
     18158                                B1A942E715B5CE2200D525D1 /* WebKitSourceBufferList.h */,
     18159                                B1A942E815B5CE2200D525D1 /* WebKitSourceBufferList.idl */,
    1808418160                        );
    1808518161                        name = mediasource;
     
    1985519931                        );
    1985619932                        name = ios;
     19933                        sourceTree = "<group>";
     19934                };
     19935                CD61FE7B1794CA02004101EB /* MediaSource */ = {
     19936                        isa = PBXGroup;
     19937                        children = (
     19938                                CD9DE17217AAC74C00EA386D /* JSMediaSource.cpp */,
     19939                                CD9DE17317AAC74C00EA386D /* JSMediaSource.h */,
     19940                                CD9DE17617AAC75B00EA386D /* JSSourceBuffer.cpp */,
     19941                                CD9DE17717AAC75B00EA386D /* JSSourceBuffer.h */,
     19942                                CD9DE17817AAC75B00EA386D /* JSSourceBufferList.cpp */,
     19943                                CD9DE17917AAC75B00EA386D /* JSSourceBufferList.h */,
     19944                                CD61FE801794CC59004101EB /* JSWebKitSourceBuffer.cpp */,
     19945                                CD61FE811794CC59004101EB /* JSWebKitSourceBuffer.h */,
     19946                                CD61FE821794CC59004101EB /* JSWebKitSourceBufferList.cpp */,
     19947                                CD61FE831794CC59004101EB /* JSWebKitSourceBufferList.h */,
     19948                                CD61FE7C1794CB26004101EB /* JSWebKitMediaSource.cpp */,
     19949                                CD61FE7D1794CB26004101EB /* JSWebKitMediaSource.h */,
     19950                        );
     19951                        name = MediaSource;
    1985719952                        sourceTree = "<group>";
    1985819953                };
     
    2178021875                                E100EE761546EAC100BA11D1 /* DeprecatedStyleBuilder.h in Headers */,
    2178121876                                A7C9ABF91357A3BF00F5503F /* DetailsMarkerControl.h in Headers */,
     21877                                CD61FE681794AADB004101EB /* MediaSourceRegistry.h in Headers */,
    2178221878                                CCC2B51415F613060048CDD6 /* DeviceClient.h in Headers */,
    2178321879                                CCC2B51615F613060048CDD6 /* DeviceController.h in Headers */,
     
    2183121927                                85E7118D0AC5D5350053270F /* DOMAttrInternal.h in Headers */,
    2183221928                                BC946EEF107FDBAC00857193 /* DOMBeforeLoadEvent.h in Headers */,
     21929                                CD61FE851794CC59004101EB /* JSWebKitSourceBuffer.h in Headers */,
    2183321930                                2E2D99E710E2BC1C00496337 /* DOMBlob.h in Headers */,
    2183421931                                2E2D99EA10E2BC3800496337 /* DOMBlobInternal.h in Headers */,
     
    2199522092                                85E711B80AC5D5350053270F /* DOMHTMLLinkElementInternal.h in Headers */,
    2199622093                                85ECBEF30AA7626900544F0B /* DOMHTMLMapElement.h in Headers */,
     22094                                CD9DE17D17AAC75B00EA386D /* JSSourceBufferList.h in Headers */,
    2199722095                                85E711B90AC5D5350053270F /* DOMHTMLMapElementInternal.h in Headers */,
    2199822096                                BC51579F0C03BBD3008BB0EE /* DOMHTMLMarqueeElement.h in Headers */,
     
    2200922107                                85E711BE0AC5D5350053270F /* DOMHTMLOListElementInternal.h in Headers */,
    2201022108                                85F32AEE0AA63B8700FF3184 /* DOMHTMLOptGroupElement.h in Headers */,
     22109                                CD9DE18217AAD6A400EA386D /* URLMediaSource.h in Headers */,
    2201122110                                85E711BF0AC5D5350053270F /* DOMHTMLOptGroupElementInternal.h in Headers */,
    2201222111                                8540756B0AD6CBF900620C57 /* DOMHTMLOptionElement.h in Headers */,
     
    2201922118                                85ECBEF70AA7626900544F0B /* DOMHTMLParamElement.h in Headers */,
    2202022119                                85E711C20AC5D5350053270F /* DOMHTMLParamElementInternal.h in Headers */,
     22120                                CD61FE6A1794AADB004101EB /* WebKitSourceBuffer.h in Headers */,
    2202122121                                85183B480AA6926100F19FA3 /* DOMHTMLPreElement.h in Headers */,
    2202222122                                85E711C30AC5D5350053270F /* DOMHTMLPreElementInternal.h in Headers */,
     
    2267122771                                F344C75311294D9D00F26EEE /* InspectorFrontendClientLocal.h in Headers */,
    2267222772                                7A0E770F10C00A8800A0276E /* InspectorFrontendHost.h in Headers */,
    22673                                 07277E4B17D018CC0015534D /* JSMediaSource.h in Headers */,
    2267422773                                511293603D60B4B52FAF973F /* InspectorHeapProfilerAgent.h in Headers */,
    2267522774                                7A54858014E02D51006AE05A /* InspectorHistory.h in Headers */,
     
    2308623185                                B2FA3D790AB75A6F000E5AC4 /* JSSVGFEFloodElement.h in Headers */,
    2308723186                                B2FA3D7B0AB75A6F000E5AC4 /* JSSVGFEFuncAElement.h in Headers */,
     23187                                CD61FE7F1794CB26004101EB /* JSWebKitMediaSource.h in Headers */,
    2308823188                                B2FA3D7D0AB75A6F000E5AC4 /* JSSVGFEFuncBElement.h in Headers */,
    2308923189                                B2FA3D7F0AB75A6F000E5AC4 /* JSSVGFEFuncGElement.h in Headers */,
     
    2321523315                                6E3FAD3914733F4011E42307 /* JSWebGLDebugRendererInfo.h in Headers */,
    2321623316                                6E3FAD3914733F4022E42307 /* JSWebGLDebugShaders.h in Headers */,
     23317                                CD3A495217A9C8C600274E42 /* MediaSourceBase.h in Headers */,
    2321723318                                6E3FAD3914733F4000E42307 /* JSWebGLDepthTexture.h in Headers */,
    2321823319                                49C7B9981042D2D30009D447 /* JSWebGLFramebuffer.h in Headers */,
     
    2344623547                                0014628B103CD1DE000B20DB /* OriginAccessEntry.h in Headers */,
    2344723548                                FE9E89FC16E2DC0500A908F8 /* OriginLock.h in Headers */,
     23549                                CD9DE18617AB0CF300EA386D /* HTMLMediaSource.h in Headers */,
    2344823550                                FD581FAF1520F91F003A7A75 /* OscillatorNode.h in Headers */,
    2344923551                                078E091B17D14D1C00420AA1 /* NavigatorUserMediaError.h in Headers */,
     
    2367723779                                0854B0151255E4E600B9CDD0 /* RenderSVGInline.h in Headers */,
    2367823780                                0854B0171255E4E600B9CDD0 /* RenderSVGInlineText.h in Headers */,
     23781                                CD3A496217A9D01B00274E42 /* SourceBuffer.h in Headers */,
    2367923782                                436708CB12D9CA4B00044234 /* RenderSVGModelObject.h in Headers */,
    2368023783                                ADDF1AD71257CD9A0003A759 /* RenderSVGPath.h in Headers */,
     
    2372923832                                514C767A0CE923A1007EF3CD /* ResourceHandleClient.h in Headers */,
    2373023833                                514C767B0CE923A1007EF3CD /* ResourceHandleInternal.h in Headers */,
     23834                                CD61FE641794AADB004101EB /* WebKitMediaSource.h in Headers */,
    2373123835                                51E4143416A6596300C633C7 /* ResourceHandleTypes.h in Headers */,
    2373223836                                656D373F0ADBA5DE00A4554D /* ResourceLoader.h in Headers */,
     
    2385823962                                41D168E810226E89009BC827 /* SharedWorkerGlobalScope.h in Headers */,
    2385923963                                41D168EA10226E89009BC827 /* SharedWorkerRepository.h in Headers */,
     23964                                CD61FE6C1794AADB004101EB /* WebKitSourceBufferList.h in Headers */,
    2386023965                                E1B7839C163740A70007B692 /* SharedWorkerStrategy.h in Headers */,
    2386123966                                41D168EE10226E89009BC827 /* SharedWorkerThread.h in Headers */,
     
    2400924114                                71FB967B1383D64600AC8A4C /* SVGAnimatedEnumerationPropertyTearOff.h in Headers */,
    2401024115                                0823D159127AD6AC000EBC95 /* SVGAnimatedInteger.h in Headers */,
     24116                                CD61FE871794CC59004101EB /* JSWebKitSourceBufferList.h in Headers */,
    2401124117                                71E623D1151F72A60036E2F4 /* SVGAnimatedIntegerOptionalInteger.h in Headers */,
     24118                                CD9DE17B17AAC75B00EA386D /* JSSourceBuffer.h in Headers */,
    2401224119                                089021A9126EF5DE0092D5EA /* SVGAnimatedLength.h in Headers */,
    2401324120                                089021AD126EF5E90092D5EA /* SVGAnimatedLengthList.h in Headers */,
     
    2427524382                                930FC68A1072B9280045293E /* TextRenderingMode.h in Headers */,
    2427624383                                93F198F608245E59001E9ABC /* TextResourceDecoder.h in Headers */,
     24384                                CD3A496517A9D01B00274E42 /* SourceBufferList.h in Headers */,
    2427724385                                A824B4650E2EF2EA0081A7B7 /* TextRun.h in Headers */,
    2427824386                                448B1B7A0F3A2F9B0047A9E2 /* TextSizeAdjustment.h in Headers */,
     
    2430824416                                070334D71459FFD5008D8D45 /* TrackBase.h in Headers */,
    2430924417                                BE88E0C21715CE2600658D98 /* TrackListBase.h in Headers */,
     24418                                CD3A495F17A9D01B00274E42 /* MediaSource.h in Headers */,
    2431024419                                49E911C40EF86D47009D0CAF /* TransformationMatrix.h in Headers */,
    2431124420                                FB484F4D171F821E00040755 /* TransformFunctions.h in Headers */,
     
    2446224571                                85031B510A44EFC700F992E0 /* WheelEvent.h in Headers */,
    2446324572                                9380F47409A11AB4001FDB34 /* Widget.h in Headers */,
     24573                                CD9DE17517AAC74C00EA386D /* JSMediaSource.h in Headers */,
    2446424574                                1411DCB1164C39A800D49BC1 /* WidthCache.h in Headers */,
    2446524575                                939B02EF0EA2DBC400C54570 /* WidthIterator.h in Headers */,
     
    2508925199                                14D8238B0AF92DF60004F057 /* Chrome.cpp in Sources */,
    2509025200                                ABAF22080C03B1C700B0BCF0 /* ChromeMac.mm in Sources */,
     25201                                CD9DE17417AAC74C00EA386D /* JSMediaSource.cpp in Sources */,
    2509125202                                4ACBC0BE12713CBD0094F9B2 /* ClassList.cpp in Sources */,
    2509225203                                BC904B760D10998F00680D32 /* ClassNodeList.cpp in Sources */,
     
    2530525416                                85032DDE0AA8C9BE007D3B7D /* DOMCSSMediaRule.mm in Sources */,
    2530625417                                85032DE00AA8C9BE007D3B7D /* DOMCSSPageRule.mm in Sources */,
     25418                                CD9DE17A17AAC75B00EA386D /* JSSourceBuffer.cpp in Sources */,
    2530725419                                858C382D0AA8E40500B187A4 /* DOMCSSPrimitiveValue.mm in Sources */,
    2530825420                                85032DE20AA8C9BE007D3B7D /* DOMCSSRule.mm in Sources */,
     
    2536225474                                7C5343FC17B74B63004232F0 /* JSMediaQueryListListener.cpp in Sources */,
    2536325475                                85992EBB0AA5069500AC0785 /* DOMHTMLHeadElement.mm in Sources */,
     25476                                CD3A496417A9D01B00274E42 /* SourceBufferList.cpp in Sources */,
    2536425477                                85183B450AA6926100F19FA3 /* DOMHTMLHeadingElement.mm in Sources */,
    2536525478                                85ECBEF20AA7626900544F0B /* DOMHTMLHRElement.mm in Sources */,
     
    2556325676                                5160306C0CC4362300C8AC25 /* FileSystemCF.cpp in Sources */,
    2556425677                                26C17A3F1491D2D400D12BA2 /* FileSystemIOS.mm in Sources */,
     25678                                CD3A495417A9CC9000274E42 /* MediaSourceBase.cpp in Sources */,
    2556525679                                514B3F760C722055000530DF /* FileSystemMac.mm in Sources */,
    2556625680                                5160300B0CC4251200C8AC25 /* FileSystemPOSIX.cpp in Sources */,
     
    2581225926                                B275356F0B053814002CE64F /* Image.cpp in Sources */,
    2581325927                                43D2597713C816F400608559 /* ImageBuffer.cpp in Sources */,
     25928                                CD9DE17C17AAC75B00EA386D /* JSSourceBufferList.cpp in Sources */,
    2581425929                                B2A10B940B3818D700099AA4 /* ImageBufferCG.cpp in Sources */,
    2581525930                                2292B27C1356669400CF11EF /* ImageBufferDataCG.cpp in Sources */,
     
    2601026125                                1ACE53DF0A8D18810022947D /* JSDOMParser.cpp in Sources */,
    2601126126                                FB91392B16AE4FC0001FE682 /* JSDOMPath.cpp in Sources */,
     26127                                CD61FE6B1794AADB004101EB /* WebKitSourceBufferList.cpp in Sources */,
    2601226128                                A9D247FE0D757E6900FDF959 /* JSDOMPlugin.cpp in Sources */,
    2601326129                                A9D248000D757E6900FDF959 /* JSDOMPluginArray.cpp in Sources */,
     
    2606026176                                FE80D7AB0E9C1ED2000D6F75 /* JSGeolocationCustom.cpp in Sources */,
    2606126177                                FE80DA650E9C4703000D6F75 /* JSGeoposition.cpp in Sources */,
     26178                                CD3A495E17A9D01B00274E42 /* MediaSource.cpp in Sources */,
    2606226179                                8482B7511198CB6B00BFB005 /* JSHashChangeEvent.cpp in Sources */,
    2606326180                                BC94D14E0C275C68006BC617 /* JSHistory.cpp in Sources */,
     
    2607926196                                BCCBAD400C18C14200CE890F /* JSHTMLCollection.cpp in Sources */,
    2608026197                                BCCBAD3B0C18BFF800CE890F /* JSHTMLCollectionCustom.cpp in Sources */,
     26198                                CD61FE841794CC59004101EB /* JSWebKitSourceBuffer.cpp in Sources */,
    2608126199                                4A1E719014E101E400626F9D /* JSHTMLContentElement.cpp in Sources */,
    2608226200                                F5C041E60FFCA96D00839D4A /* JSHTMLDataListElement.cpp in Sources */,
     
    2639326511                                B2FA3DCC0AB75A6F000E5AC4 /* JSSVGPathSegCurvetoQuadraticSmoothRel.cpp in Sources */,
    2639426512                                B2C96D8D0B3AF2B7005E80EC /* JSSVGPathSegCustom.cpp in Sources */,
     26513                                CD3A496117A9D01B00274E42 /* SourceBuffer.cpp in Sources */,
    2639526514                                B2FA3DCE0AB75A6F000E5AC4 /* JSSVGPathSegLinetoAbs.cpp in Sources */,
    2639626515                                B2FA3DD00AB75A6F000E5AC4 /* JSSVGPathSegLinetoHorizontalAbs.cpp in Sources */,
     
    2646626585                                FD82D7F713D4C8BD004E4372 /* JSWaveShaperNode.cpp in Sources */,
    2646726586                                A7D20F62107F406900A80392 /* JSWebGLActiveInfo.cpp in Sources */,
    26468                                 07277E4A17D018CC0015534D /* JSMediaSource.cpp in Sources */,
    2646926587                                49C7B9931042D2D30009D447 /* JSWebGLBuffer.cpp in Sources */,
    2647026588                                7EA30F6916DFFE7500257D0B /* JSWebGLCompressedTextureATC.cpp in Sources */,
     
    2660926727                                D3A94A38122DABAC00A37BBC /* MediaQueryList.cpp in Sources */,
    2661026728                                D3AA10F3123A98AA0092152B /* MediaQueryMatcher.cpp in Sources */,
     26729                                CD61FE671794AADB004101EB /* MediaSourceRegistry.cpp in Sources */,
    2661126730                                FD671A77159BB07000197559 /* MediaStreamAudioSourceNode.cpp in Sources */,
    2661226731                                0711589017DF6F6200EDFE2B /* MediaStreamComponent.cpp in Sources */,
     
    2683026949                                439046DD12DA25E800AF80A2 /* RenderMathMLMath.cpp in Sources */,
    2683126950                                439046DF12DA25E800AF80A2 /* RenderMathMLOperator.cpp in Sources */,
     26951                                CD61FE631794AADB004101EB /* WebKitMediaSource.cpp in Sources */,
    2683226952                                439046E112DA25E800AF80A2 /* RenderMathMLRoot.cpp in Sources */,
    2683326953                                439046E312DA25E800AF80A2 /* RenderMathMLRow.cpp in Sources */,
     
    2707927199                                BC7FA62E0D1F0EFF00DB22A9 /* StaticNodeList.cpp in Sources */,
    2708027200                                A5AFB34F115151A700B045CB /* StepRange.cpp in Sources */,
     27201                                CD9DE18517AB0CF300EA386D /* HTMLMediaSource.cpp in Sources */,
    2708127202                                51E3F9C70DA059DC00250911 /* Storage.cpp in Sources */,
    2708227203                                C5160EEA1004543A00A7CEE2 /* StorageAreaImpl.cpp in Sources */,
     
    2720427325                                B22279DF0D00BF220071B782 /* SVGFEFuncAElement.cpp in Sources */,
    2720527326                                B22279E20D00BF220071B782 /* SVGFEFuncBElement.cpp in Sources */,
     27327                                CD61FE7E1794CB26004101EB /* JSWebKitMediaSource.cpp in Sources */,
    2720627328                                B22279E50D00BF220071B782 /* SVGFEFuncGElement.cpp in Sources */,
    2720727329                                B22279E80D00BF220071B782 /* SVGFEFuncRElement.cpp in Sources */,
     
    2726627388                                8419D2A8120D92D000141F8F /* SVGPathByteStreamBuilder.cpp in Sources */,
    2726727389                                8419D2AC120D92FC00141F8F /* SVGPathByteStreamSource.cpp in Sources */,
     27390                                CD61FE861794CC59004101EB /* JSWebKitSourceBufferList.cpp in Sources */,
    2726827391                                B2227A580D00BF220071B782 /* SVGPathElement.cpp in Sources */,
    2726927392                                8476C9EF11DF6A5800555B02 /* SVGPathParser.cpp in Sources */,
     
    2735227475                                376DCCE113B4F966002EBEFC /* TextRun.cpp in Sources */,
    2735327476                                B2C3DA4A0D006C1D00EF6F26 /* TextStream.cpp in Sources */,
     27477                                CD9DE18117AAD6A400EA386D /* URLMediaSource.cpp in Sources */,
    2735427478                                9759E93F14EF1CF80026A2DD /* TextTrack.cpp in Sources */,
    2735527479                                9759E94214EF1CF80026A2DD /* TextTrackCue.cpp in Sources */,
     
    2750027624                                1AA7161E149BF2FA0016EC19 /* WebTileLayer.mm in Sources */,
    2750127625                                CD82030B1395AB6A00F956C6 /* WebVideoFullscreenController.mm in Sources */,
     27626                                CD61FE691794AADB004101EB /* WebKitSourceBuffer.cpp in Sources */,
    2750227627                                CD82030D1395AB6A00F956C6 /* WebVideoFullscreenHUDWindowController.mm in Sources */,
    2750327628                                F12171F516A8CED2000053CA /* WebVTTElement.cpp in Sources */,
     
    2751927644                                F34742E01343631F00531BC2 /* WorkerDebuggerAgent.cpp in Sources */,
    2752027645                                A3E2643014748991005A8588 /* WorkerEventQueue.cpp in Sources */,
     27646                                CDEE393717974259001D7580 /* PublicURLManager.cpp in Sources */,
    2752127647                                2E4346480F546A8200B0F1BA /* WorkerGlobalScope.cpp in Sources */,
    2752227648                                9712A611150090CE0048AF10 /* WorkerGlobalScopeIndexedDatabase.cpp in Sources */,
  • trunk/Source/WebCore/dom/EventNames.h

    r154673 r156049  
    168168    macro(webkitendfullscreen) \
    169169    \
     170    macro(addsourcebuffer) \
     171    macro(removesourcebuffer) \
     172    macro(sourceopen) \
     173    macro(sourceended) \
     174    macro(sourceclose) \
     175    macro(update) \
     176    macro(updateend) \
     177    macro(updatestart) \
    170178    macro(webkitaddsourcebuffer) \
    171179    macro(webkitremovesourcebuffer) \
  • trunk/Source/WebCore/dom/EventTarget.h

    r155959 r156049  
    5757    class ScriptProcessorNode;
    5858    class MediaController;
    59     class MediaSource;
    6059    class MediaStream;
    6160    class MessagePort;
     
    6665    class SharedWorker;
    6766    class SharedWorkerGlobalScope;
    68     class SourceBufferList;
    6967    class TextTrack;
    7068    class TextTrackCue;
  • trunk/Source/WebCore/dom/EventTargetFactory.in

    r155573 r156049  
    3131SharedWorker conditional=SHARED_WORKERS
    3232SharedWorkerGlobalScope conditional=SHARED_WORKERS
     33SourceBuffer conditional=MEDIA_SOURCE
    3334SourceBufferList conditional=MEDIA_SOURCE
    3435SpeechRecognition conditional=SCRIPTED_SPEECH
     
    3940TextTrackList conditional=VIDEO_TRACK
    4041VideoTrackList conditional=VIDEO_TRACK
     42WebKitMediaSource conditional=MEDIA_SOURCE
    4143WebKitNamedFlow
     44WebKitSourceBufferList conditional=MEDIA_SOURCE
    4245WebSocket conditional=WEB_SOCKETS
    4346Worker conditional=WORKERS
  • trunk/Source/WebCore/fileapi/Blob.cpp

    r148536 r156049  
    5353} // namespace
    5454
     55class BlobURLRegistry : public URLRegistry {
     56public:
     57    virtual void registerURL(SecurityOrigin*, const KURL&, URLRegistrable*) OVERRIDE;
     58    virtual void unregisterURL(const KURL&) OVERRIDE;
     59
     60    static URLRegistry& registry();
     61};
     62
     63
     64void BlobURLRegistry::registerURL(SecurityOrigin* origin, const KURL& publicURL, URLRegistrable* blob)
     65{
     66    ASSERT(&blob->registry() == this);
     67    ThreadableBlobRegistry::registerBlobURL(origin, publicURL, static_cast<Blob*>(blob)->url());
     68}
     69
     70void BlobURLRegistry::unregisterURL(const KURL& url)
     71{
     72    ThreadableBlobRegistry::unregisterBlobURL(url);
     73}
     74
     75URLRegistry& BlobURLRegistry::registry()
     76{
     77    DEFINE_STATIC_LOCAL(BlobURLRegistry, instance, ());
     78    return instance;
     79}
     80
     81
    5582Blob::Blob()
    5683    : m_size(0)
     
    207234#endif
    208235
     236URLRegistry& Blob::registry() const
     237{
     238    return BlobURLRegistry::registry();
     239}
     240
     241
    209242} // namespace WebCore
  • trunk/Source/WebCore/fileapi/Blob.h

    r151947 r156049  
    3535#include "KURL.h"
    3636#include "ScriptWrappable.h"
     37#include "URLRegistry.h"
    3738#include <wtf/PassOwnPtr.h>
    3839#include <wtf/PassRefPtr.h>
     
    4445class ScriptExecutionContext;
    4546
    46 class Blob : public ScriptWrappable, public RefCounted<Blob> {
     47class Blob : public ScriptWrappable, public URLRegistrable, public RefCounted<Blob> {
    4748public:
    4849    static PassRefPtr<Blob> create()
     
    7980    static bool isNormalizedContentType(const CString&);
    8081
     82    // URLRegistrable
     83    virtual URLRegistry& registry() const OVERRIDE;
     84
    8185#if ENABLE(BLOB)
    8286    PassRefPtr<Blob> slice(long long start = 0, long long end = std::numeric_limits<long long>::max(), const String& contentType = String()) const;
  • trunk/Source/WebCore/html/DOMURL.cpp

    r151947 r156049  
    4040#include "ScriptExecutionContext.h"
    4141#include "SecurityOrigin.h"
    42 #include "ThreadableBlobRegistry.h"
    4342#include <wtf/MainThread.h>
    4443
    45 #if ENABLE(MEDIA_SOURCE)
    46 #include "MediaSource.h"
    47 #include "MediaSourceRegistry.h"
    48 #endif
    49 
    50 #if ENABLE(MEDIA_STREAM)
    51 #include "MediaStream.h"
    52 #include "MediaStreamRegistry.h"
    53 #endif
    54 
    5544namespace WebCore {
    56 
    57 #if ENABLE(MEDIA_SOURCE)
    58 String DOMURL::createObjectURL(ScriptExecutionContext* scriptExecutionContext, MediaSource* source)
    59 {
    60     // Since WebWorkers cannot obtain MediaSource objects, we should be on the main thread.
    61     ASSERT(isMainThread());
    62 
    63     if (!scriptExecutionContext || !source)
    64         return String();
    65 
    66     KURL publicURL = BlobURL::createPublicURL(scriptExecutionContext->securityOrigin());
    67     if (publicURL.isEmpty())
    68         return String();
    69 
    70     MediaSourceRegistry::registry().registerMediaSourceURL(publicURL, source);
    71     scriptExecutionContext->publicURLManager().sourceURLs().add(publicURL.string());
    72 
    73     return publicURL.string();
    74 }
    75 #endif
    76 
    77 #if ENABLE(MEDIA_STREAM)
    78 String DOMURL::createObjectURL(ScriptExecutionContext* scriptExecutionContext, MediaStream* stream)
    79 {
    80     if (!scriptExecutionContext || !stream)
    81         return String();
    82 
    83     KURL publicURL = BlobURL::createPublicURL(scriptExecutionContext->securityOrigin());
    84     if (publicURL.isEmpty())
    85         return String();
    86 
    87     // Since WebWorkers cannot obtain Stream objects, we should be on the main thread.
    88     ASSERT(isMainThread());
    89 
    90     MediaStreamRegistry::registry().registerMediaStreamURL(publicURL, stream);
    91     scriptExecutionContext->publicURLManager().streamURLs().add(publicURL.string());
    92 
    93     return publicURL.string();
    94 }
    95 #endif
    9645
    9746String DOMURL::createObjectURL(ScriptExecutionContext* scriptExecutionContext, Blob* blob)
     
    9948    if (!scriptExecutionContext || !blob)
    10049        return String();
     50    return createPublicURL(scriptExecutionContext, blob);
     51}
    10152
     53String DOMURL::createPublicURL(ScriptExecutionContext* scriptExecutionContext, URLRegistrable* registrable)
     54{
    10255    KURL publicURL = BlobURL::createPublicURL(scriptExecutionContext->securityOrigin());
    10356    if (publicURL.isEmpty())
    10457        return String();
    10558
    106     ThreadableBlobRegistry::registerBlobURL(scriptExecutionContext->securityOrigin(), publicURL, blob->url());
    107     scriptExecutionContext->publicURLManager().blobURLs().add(publicURL.string());
     59    scriptExecutionContext->publicURLManager().registerURL(scriptExecutionContext->securityOrigin(), publicURL, registrable);
    10860
    10961    return publicURL.string();
     
    12274    MemoryCache::removeRequestFromCache(scriptExecutionContext, request);
    12375
    124     HashSet<String>& blobURLs = scriptExecutionContext->publicURLManager().blobURLs();
    125     if (blobURLs.contains(url.string())) {
    126         ThreadableBlobRegistry::unregisterBlobURL(url);
    127         blobURLs.remove(url.string());
    128     }
    129 
    130 #if ENABLE(MEDIA_SOURCE)
    131     HashSet<String>& sourceURLs = scriptExecutionContext->publicURLManager().sourceURLs();
    132     if (sourceURLs.contains(url.string())) {
    133         MediaSourceRegistry::registry().unregisterMediaSourceURL(url);
    134         sourceURLs.remove(url.string());
    135     }
    136 #endif
    137 #if ENABLE(MEDIA_STREAM)
    138     HashSet<String>& streamURLs = scriptExecutionContext->publicURLManager().streamURLs();
    139     if (streamURLs.contains(url.string())) {
    140         // FIXME: make sure of this assertion below. Raise a spec question if required.
    141         // Since WebWorkers cannot obtain Stream objects, we should be on the main thread.
    142         ASSERT(isMainThread());
    143         MediaStreamRegistry::registry().unregisterMediaStreamURL(url);
    144         streamURLs.remove(url.string());
    145     }
    146 #endif
     76    scriptExecutionContext->publicURLManager().revoke(url);
    14777}
    14878
  • trunk/Source/WebCore/html/DOMURL.h

    r127757 r156049  
    3737
    3838class Blob;
    39 class MediaSource;
    40 class MediaStream;
    4139class ScriptExecutionContext;
     40class URLRegistrable;
    4241
    4342class DOMURL : public RefCounted<DOMURL> {
     
    5150    static String createObjectURL(ScriptExecutionContext*, Blob*);
    5251    static void revokeObjectURL(ScriptExecutionContext*, const String&);
    53 #if ENABLE(MEDIA_SOURCE)
    54     static String createObjectURL(ScriptExecutionContext*, MediaSource*);
    55 #endif
    56 #if ENABLE(MEDIA_STREAM)
    57     static String createObjectURL(ScriptExecutionContext*, MediaStream*);
    58 #endif
     52
     53    static String createPublicURL(ScriptExecutionContext*, URLRegistrable*);
    5954#endif
    6055};
  • trunk/Source/WebCore/html/DOMURL.idl

    r152100 r156049  
    3535    ImplementationLacksVTable
    3636] interface DOMURL {
    37 #if defined(ENABLE_MEDIA_SOURCE) && ENABLE_MEDIA_SOURCE
    38     [CallWith=ScriptExecutionContext,TreatReturnedNullStringAs=Null] static DOMString createObjectURL(MediaSource? source);
    39 #endif
    40 #if defined(ENABLE_MEDIA_STREAM) && ENABLE_MEDIA_STREAM
    41     [CallWith=ScriptExecutionContext,TreatReturnedNullStringAs=Null] static DOMString createObjectURL(MediaStream? stream);
    42 #endif
    4337    [CallWith=ScriptExecutionContext,TreatReturnedNullStringAs=Null] static DOMString createObjectURL(Blob? blob);
    4438    [CallWith=ScriptExecutionContext] static void revokeObjectURL(DOMString url);
  • trunk/Source/WebCore/html/HTMLMediaElement.cpp

    r155908 r156049  
    121121
    122122#if ENABLE(MEDIA_SOURCE)
    123 #include "MediaSource.h"
    124 #include "MediaSourceRegistry.h"
     123#include "HTMLMediaSource.h"
    125124#endif
    126125
     
    384383
    385384#if ENABLE(MEDIA_SOURCE)
    386     setSourceState(MediaSource::closedKeyword());
     385    closeMediaSource();
    387386#endif
    388387
     
    812811
    813812#if ENABLE(MEDIA_SOURCE)
    814     setSourceState(MediaSource::closedKeyword());
     813    closeMediaSource();
    815814#endif
    816815
     
    10941093
    10951094    if (url.protocolIs(mediaSourceBlobProtocol))
    1096         m_mediaSource = MediaSourceRegistry::registry().lookupMediaSource(url.string());
     1095        m_mediaSource = HTMLMediaSource::lookup(url.string());
    10971096
    10981097    if (m_mediaSource) {
    1099         if (!m_player->load(url, m_mediaSource))
     1098        if (m_mediaSource->attachToElement())
     1099            m_player->load(url, m_mediaSource);
     1100        else {
     1101            // Forget our reference to the MediaSource, so we leave it alone
     1102            // while processing remainder of load failure.
     1103            m_mediaSource = 0;
    11001104            mediaLoadingFailed(MediaPlayer::FormatError);
     1105        }
    11011106    } else
    11021107#endif
     
    16011606
    16021607#if ENABLE(MEDIA_SOURCE)
    1603     setSourceState(MediaSource::closedKeyword());
     1608    closeMediaSource();
    16041609#endif
    16051610
     
    16321637
    16331638#if ENABLE(MEDIA_SOURCE)
    1634     setSourceState(MediaSource::closedKeyword());
     1639    closeMediaSource();
    16351640#endif
    16361641
     
    21772182    // Always notify the media engine of a seek if the source is not closed. This ensures that the source is
    21782183    // always in a flushed state when the 'seeking' event fires.
    2179     if (m_mediaSource && m_mediaSource->readyState() != MediaSource::closedKeyword())
     2184    if (m_mediaSource && m_mediaSource->isClosed())
    21802185        noSeekRequired = false;
    21812186#endif
     
    25412546
    25422547#if ENABLE(MEDIA_SOURCE)
    2543 void HTMLMediaElement::setSourceState(const String& state)
     2548void HTMLMediaElement::closeMediaSource()
    25442549{
    25452550    if (!m_mediaSource)
    2546          return;
    2547 
    2548     m_mediaSource->setReadyState(state);
    2549     if (state == MediaSource::closedKeyword())
    2550         m_mediaSource = 0;
     2551        return;
     2552
     2553    m_mediaSource->close();
     2554    m_mediaSource = 0;
    25512555}
    25522556#endif
     
    38683872    if (!m_player)
    38693873        return TimeRanges::create();
     3874
     3875#if ENABLE(MEDIA_SOURCE)
     3876    if (m_mediaSource)
     3877        return m_mediaSource->buffered();
     3878#endif
     3879
    38703880    return m_player->buffered();
    38713881}
     
    40864096
    40874097#if ENABLE(MEDIA_SOURCE)
    4088     setSourceState(MediaSource::closedKeyword());
     4098    closeMediaSource();
    40894099#endif
    40904100
     
    41314141
    41324142#if ENABLE(MEDIA_SOURCE)
    4133     setSourceState(MediaSource::closedKeyword());
     4143    closeMediaSource();
    41344144#endif
    41354145
     
    47934803#if ENABLE(MEDIA_SOURCE)
    47944804    if (m_mediaSource)
    4795         m_mediaSource->setReadyState(MediaSource::closedKeyword());
     4805        m_mediaSource->close();
    47964806#endif
    47974807
  • trunk/Source/WebCore/html/HTMLMediaElement.h

    r155908 r156049  
    192192#if ENABLE(MEDIA_SOURCE)
    193193//  Media Source.
    194     void setSourceState(const String&);
     194    void closeMediaSource();
    195195#endif
    196196
     
    674674
    675675#if ENABLE(MEDIA_SOURCE)
    676     RefPtr<MediaSource> m_mediaSource;
     676    RefPtr<HTMLMediaSource> m_mediaSource;
    677677#endif
    678678
  • trunk/Source/WebCore/html/HTMLMediaSource.cpp

    r156048 r156049  
    11/*
    2  * Copyright (C) 2012 Google Inc. All rights reserved.
     2 * Copyright (C) 2013 Google Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    2828 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    2929 */
    30  
    31 [
    32     Conditional=MEDIA_SOURCE,
    33     InterfaceName=WebKitSourceBuffer
    34 ] interface SourceBuffer {
    3530
    36     // Returns the time ranges buffered.
    37     [GetterRaisesException] readonly attribute TimeRanges buffered;
     31#include "config.h"
     32#include "HTMLMediaSource.h"
    3833
    39     // Applies an offset to media segment timestamps.
    40     [SetterRaisesException] attribute double timestampOffset;
     34namespace WebCore {
    4135
    42     // Append segment data.
    43     [RaisesException] void append(Uint8Array data);
     36URLRegistry* HTMLMediaSource::s_registry = 0;
    4437
    45     // Abort the current segment append sequence.
    46     [RaisesException] void abort();
    47 };
     38void HTMLMediaSource::setRegistry(URLRegistry* registry)
     39{
     40    ASSERT(!s_registry);
     41    s_registry = registry;
     42}
    4843
     44}
  • trunk/Source/WebCore/html/HTMLMediaSource.h

    r156048 r156049  
    2828 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    2929 */
    30 #ifndef MediaSourcePrivate_h
    31 #define MediaSourcePrivate_h
    3230
    33 #if ENABLE(MEDIA_SOURCE)
     31#ifndef HTMLMediaSource_h
     32#define HTMLMediaSource_h
    3433
     34#include "URLRegistry.h"
    3535#include <wtf/Forward.h>
    3636
    3737namespace WebCore {
    3838
    39 class SourceBufferPrivate;
     39class MediaSourcePrivate;
     40class TimeRanges;
    4041
    41 class MediaSourcePrivate {
     42class HTMLMediaSource : public URLRegistrable {
    4243public:
    43     typedef Vector<String, 0> CodecsArray;
     44    static void setRegistry(URLRegistry*);
     45    static HTMLMediaSource* lookup(const String& url) { return s_registry ? static_cast<HTMLMediaSource*>(s_registry->lookup(url)) : 0; }
    4446
    45     MediaSourcePrivate() { }
    46     virtual ~MediaSourcePrivate() { }
     47    void ref() { refHTMLMediaSource(); }
     48    void deref() { derefHTMLMediaSource(); }
    4749
    48     enum AddStatus { Ok, NotSupported, ReachedIdLimit };
    49     virtual AddStatus addSourceBuffer(const String& type, const CodecsArray&, OwnPtr<SourceBufferPrivate>*) = 0;
    50     virtual double duration() = 0;
    51     virtual void setDuration(double) = 0;
    52     enum EndOfStreamStatus { EosNoError, EosNetworkError, EosDecodeError };
    53     virtual void endOfStream(EndOfStreamStatus) = 0;
     50    // Called when an HTMLMediaElement is attempting to attach to this object,
     51    // and helps enforce attachment to at most one element at a time.
     52    // If already attached, returns false. Otherwise, must be in
     53    // 'closed' state, and returns true to indicate attachment success.
     54    // Reattachment allowed by first calling close() (even if already in 'closed').
     55    virtual bool attachToElement() = 0;
     56    virtual void setPrivateAndOpen(PassOwnPtr<MediaSourcePrivate>) = 0;
     57    virtual void close() = 0;
     58    virtual bool isClosed() const = 0;
     59    virtual double duration() const = 0;
     60    virtual PassRefPtr<TimeRanges> buffered() const = 0;
     61    virtual void refHTMLMediaSource() = 0;
     62    virtual void derefHTMLMediaSource() = 0;
     63
     64    // URLRegistrable
     65    virtual URLRegistry& registry() const OVERRIDE { return *s_registry; }
     66
     67private:
     68    static URLRegistry* s_registry;
    5469};
    5570
     
    5772
    5873#endif
    59 #endif
  • trunk/Source/WebCore/html/PublicURLManager.cpp

    r156048 r156049  
    11/*
    2  * Copyright (C) 2011 Google Inc. All rights reserved.
    32 * Copyright (C) 2012 Motorola Mobility Inc.
     3 * Copyright (C) 2013 Google Inc. All Rights Reserved.
    44 *
    55 * Redistribution and use in source and binary forms, with or without
     
    2525 */
    2626
    27 #ifndef DOMURL_h
    28 #define DOMURL_h
     27#include "config.h"
     28#include "PublicURLManager.h"
    2929
    3030#include "KURL.h"
    31 #include <wtf/HashSet.h>
    32 #include <wtf/PassRefPtr.h>
    33 #include <wtf/RefCounted.h>
    34 #include <wtf/text/WTFString.h>
     31#include "URLRegistry.h"
     32#include <wtf/text/StringHash.h>
    3533
    3634namespace WebCore {
    3735
    38 class Blob;
    39 class MediaSource;
    40 class MediaStream;
    41 class ScriptExecutionContext;
     36void PublicURLManager::registerURL(SecurityOrigin* origin, const KURL& url, URLRegistrable* registrable)
     37{
     38    RegistryURLMap::iterator found = m_registryToURL.add(&registrable->registry(), URLSet()).iterator;
     39    found->key->registerURL(origin, url, registrable);
     40    found->value.add(url.string());
     41}
    4242
    43 class DOMURL : public RefCounted<DOMURL> {
     43void PublicURLManager::revoke(const KURL& url)
     44{
     45    for (RegistryURLMap::iterator i = m_registryToURL.begin(); i != m_registryToURL.end(); ++i) {
     46        if (i->value.contains(url.string())) {
     47            i->key->unregisterURL(url);
     48            i->value.remove(url.string());
     49            break;
     50        }
     51    }
     52}
    4453
    45 public:
    46     static PassRefPtr<DOMURL> create() { return adoptRef(new DOMURL); }
     54void PublicURLManager::contextDestroyed()
     55{
     56    for (RegistryURLMap::iterator i = m_registryToURL.begin(); i != m_registryToURL.end(); ++i) {
     57        for (URLSet::iterator j = i->value.begin(); j != i->value.end(); ++j)
     58            i->key->unregisterURL(KURL(ParsedURLString, *j));
     59    }
    4760
    48 #if ENABLE(BLOB)
    49     static void contextDestroyed(ScriptExecutionContext*);
     61    m_registryToURL.clear();
     62}
    5063
    51     static String createObjectURL(ScriptExecutionContext*, Blob*);
    52     static void revokeObjectURL(ScriptExecutionContext*, const String&);
    53 #if ENABLE(MEDIA_SOURCE)
    54     static String createObjectURL(ScriptExecutionContext*, MediaSource*);
    55 #endif
    56 #if ENABLE(MEDIA_STREAM)
    57     static String createObjectURL(ScriptExecutionContext*, MediaStream*);
    58 #endif
    59 #endif
    60 };
    61 
    62 } // namespace WebCore
    63 
    64 #endif // DOMURL_h
     64}
  • trunk/Source/WebCore/html/PublicURLManager.h

    r156004 r156049  
    2828
    2929#if ENABLE(BLOB)
    30 #include "ScriptExecutionContext.h"
    31 #include "ThreadableBlobRegistry.h"
     30#include <wtf/HashMap.h>
    3231#include <wtf/HashSet.h>
     32#include <wtf/PassOwnPtr.h>
     33#include <wtf/RefCounted.h>
    3334#include <wtf/text/WTFString.h>
    34 
    35 #if ENABLE(MEDIA_STREAM)
    36 #include "MediaStream.h"
    37 #include "MediaStreamRegistry.h"
    38 #endif
    39 
    40 #if ENABLE(MEDIA_SOURCE)
    41 #include "MediaSource.h"
    42 #include "MediaSourceRegistry.h"
    43 #endif
    4435
    4536namespace WebCore {
    4637
     38class KURL;
    4739class ScriptExecutionContext;
     40class SecurityOrigin;
     41class URLRegistry;
     42class URLRegistrable;
    4843
    4944class PublicURLManager {
     
    5146public:
    5247    static OwnPtr<PublicURLManager> create() { return adoptPtr(new PublicURLManager); }
    53     void contextDestroyed()
    54     {
    55         HashSet<String>::iterator blobURLsEnd = m_blobURLs.end();
    56         for (HashSet<String>::iterator iter = m_blobURLs.begin(); iter != blobURLsEnd; ++iter)
    57             ThreadableBlobRegistry::unregisterBlobURL(KURL(ParsedURLString, *iter));
    5848
    59 #if ENABLE(MEDIA_STREAM)
    60         HashSet<String>::iterator streamURLsEnd = m_streamURLs.end();
    61         for (HashSet<String>::iterator iter = m_streamURLs.begin(); iter != streamURLsEnd; ++iter)
    62             MediaStreamRegistry::registry().unregisterMediaStreamURL(KURL(ParsedURLString, *iter));
    63 #endif
    64 #if ENABLE(MEDIA_SOURCE)
    65         HashSet<String>::iterator sourceURLsEnd = m_sourceURLs.end();
    66         for (HashSet<String>::iterator iter = m_sourceURLs.begin(); iter != sourceURLsEnd; ++iter)
    67             MediaSourceRegistry::registry().unregisterMediaSourceURL(KURL(ParsedURLString, *iter));
    68 #endif
    69     }
    70 
    71     HashSet<String>& blobURLs() { return m_blobURLs; }
    72 #if ENABLE(MEDIA_STREAM)
    73     HashSet<String>& streamURLs() { return m_streamURLs; }
    74 #endif
    75 #if ENABLE(MEDIA_SOURCE)
    76     HashSet<String>& sourceURLs() { return m_sourceURLs; }
    77 #endif
     49    void registerURL(SecurityOrigin*, const KURL&, URLRegistrable*);
     50    void revoke(const KURL&);
     51    void contextDestroyed();
    7852
    7953private:
    80     HashSet<String> m_blobURLs;
    81 #if ENABLE(MEDIA_STREAM)
    82     HashSet<String> m_streamURLs;
    83 #endif
    84 #if ENABLE(MEDIA_SOURCE)
    85     HashSet<String> m_sourceURLs;
    86 #endif
     54    typedef HashSet<String> URLSet;
     55    typedef HashMap<URLRegistry*, URLSet > RegistryURLMap;
     56    RegistryURLMap m_registryToURL;
    8757};
    8858
  • trunk/Source/WebCore/html/URLRegistry.h

    r156048 r156049  
    2828 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    2929 */
    30 #ifndef MediaSourcePrivate_h
    31 #define MediaSourcePrivate_h
    3230
    33 #if ENABLE(MEDIA_SOURCE)
     31#ifndef URLRegistry_h
     32#define URLRegistry_h
    3433
    35 #include <wtf/Forward.h>
     34#include <wtf/text/WTFString.h>
    3635
    3736namespace WebCore {
    3837
    39 class SourceBufferPrivate;
     38class KURL;
     39class SecurityOrigin;
     40class URLRegistry;
    4041
    41 class MediaSourcePrivate {
     42class URLRegistrable {
    4243public:
    43     typedef Vector<String, 0> CodecsArray;
    44 
    45     MediaSourcePrivate() { }
    46     virtual ~MediaSourcePrivate() { }
    47 
    48     enum AddStatus { Ok, NotSupported, ReachedIdLimit };
    49     virtual AddStatus addSourceBuffer(const String& type, const CodecsArray&, OwnPtr<SourceBufferPrivate>*) = 0;
    50     virtual double duration() = 0;
    51     virtual void setDuration(double) = 0;
    52     enum EndOfStreamStatus { EosNoError, EosNetworkError, EosDecodeError };
    53     virtual void endOfStream(EndOfStreamStatus) = 0;
     44    virtual ~URLRegistrable() { }
     45    virtual URLRegistry& registry() const = 0;
    5446};
    5547
    56 }
     48class URLRegistry {
     49    WTF_MAKE_FAST_ALLOCATED;
     50public:
     51    virtual ~URLRegistry() { }
     52    virtual void registerURL(SecurityOrigin*, const KURL&, URLRegistrable*) = 0;
     53    virtual void unregisterURL(const KURL&) = 0;
    5754
    58 #endif
    59 #endif
     55    // This is an optional API
     56    virtual URLRegistrable* lookup(const String&) { ASSERT_NOT_REACHED(); return 0; }
     57};
     58
     59} // namespace WebCore
     60
     61#endif // URLRegistry_h
  • trunk/Source/WebCore/platform/graphics/MediaPlayer.cpp

    r154921 r156049  
    4646
    4747#if ENABLE(MEDIA_SOURCE)
    48 #include "MediaSource.h"
     48#include "HTMLMediaSource.h"
    4949#endif
    5050
     
    9494    virtual void load(const String&) { }
    9595#if ENABLE(MEDIA_SOURCE)
    96     virtual void load(const String&, PassRefPtr<MediaSource>) { }
     96    virtual void load(const String&, PassRefPtr<HTMLMediaSource>) { }
    9797#endif
    9898    virtual void cancelLoad() { }
     
    395395
    396396#if ENABLE(MEDIA_SOURCE)
    397 bool MediaPlayer::load(const KURL& url, PassRefPtr<MediaSource> mediaSource)
     397bool MediaPlayer::load(const KURL& url, PassRefPtr<HTMLMediaSource> mediaSource)
    398398{
    399399    m_mediaSource = mediaSource;
  • trunk/Source/WebCore/platform/graphics/MediaPlayer.h

    r154970 r156049  
    6868class Document;
    6969class GStreamerGWorld;
     70#if ENABLE(MEDIA_SOURCE)
     71class HTMLMediaSource;
     72#endif
    7073class MediaPlayerPrivateInterface;
    71 #if ENABLE(MEDIA_SOURCE)
    72 class MediaSource;
    73 #endif
    7474class TextTrackRepresentation;
    7575
     
    283283    bool load(const KURL&, const ContentType&, const String& keySystem);
    284284#if ENABLE(MEDIA_SOURCE)
    285     bool load(const KURL&, PassRefPtr<MediaSource>);
     285    bool load(const KURL&, PassRefPtr<HTMLMediaSource>);
    286286#endif
    287287    void cancelLoad();
     
    292292    void prepareToPlay();
    293293    void play();
    294     void pause();   
     294    void pause();
    295295
    296296#if ENABLE(ENCRYPTED_MEDIA)
     
    319319    void setRate(double);
    320320
    321     bool preservesPitch() const;   
     321    bool preservesPitch() const;
    322322    void setPreservesPitch(bool);
    323323
     
    339339    void setClosedCaptionsVisible(bool closedCaptionsVisible);
    340340
    341     bool autoplay() const;   
     341    bool autoplay() const;
    342342    void setAutoplay(bool);
    343343
     
    520520
    521521#if ENABLE(MEDIA_SOURCE)
    522     RefPtr<MediaSource> m_mediaSource;
     522    RefPtr<HTMLMediaSource> m_mediaSource;
    523523#endif
    524524};
  • trunk/Source/WebCore/platform/graphics/MediaPlayerPrivate.h

    r154921 r156049  
    4747    virtual void load(const String& url) = 0;
    4848#if ENABLE(MEDIA_SOURCE)
    49     virtual void load(const String& url, PassRefPtr<MediaSource>) = 0;
     49    virtual void load(const String& url, PassRefPtr<HTMLMediaSource>) = 0;
    5050#endif
    5151    virtual void cancelLoad() = 0;
  • trunk/Source/WebCore/platform/graphics/MediaSourcePrivate.h

    r144328 r156049  
    5151    virtual void setDuration(double) = 0;
    5252    enum EndOfStreamStatus { EosNoError, EosNetworkError, EosDecodeError };
    53     virtual void endOfStream(EndOfStreamStatus) = 0;
     53    virtual void markEndOfStream(EndOfStreamStatus) = 0;
     54    virtual void unmarkEndOfStream() = 0;
    5455};
    5556
  • trunk/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h

    r154921 r156049  
    130130    // MediaPlayerPrivatePrivateInterface overrides.
    131131    virtual void load(const String& url);
     132#if ENABLE(MEDIA_SOURCE)
     133    virtual void load(const String&, PassRefPtr<HTMLMediaSource>) { };
     134#endif
    132135    virtual void cancelLoad() = 0;
    133136
  • trunk/Source/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.h

    r151642 r156049  
    9898   
    9999    void load(const String& url);
     100#if ENABLE(MEDIA_SOURCE)
     101    virtual void load(const String&, PassRefPtr<HTMLMediaSource>) { };
     102#endif
    100103    void cancelLoad();
    101104    void loadInternal(const String& url);
  • trunk/Source/WebCore/platform/mac/MIMETypeRegistryMac.mm

    r150227 r156049  
    7474}
    7575
     76#if ENABLE(MEDIA_SOURCE)
     77bool MIMETypeRegistry::isSupportedMediaSourceMIMEType(const String&, const String&)
     78{
     79    return false;
    7680}
     81#endif
     82
     83}
Note: See TracChangeset for help on using the changeset viewer.