Fix TimeRanges layering violations
authoreric.carlson@apple.com <eric.carlson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 21 Feb 2014 22:04:06 +0000 (22:04 +0000)
committereric.carlson@apple.com <eric.carlson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 21 Feb 2014 22:04:06 +0000 (22:04 +0000)
commit0545e45f1168f23225ee688f13645b73c1e9fedf
tree06ef43312a769e42b6fc23bd98ea3a2fb274ba0d
parent799e98d7943dfa6bf8cb26dcefa34561c0a45a06
Fix TimeRanges layering violations
https://bugs.webkit.org/show_bug.cgi?id=128717

Reviewed by NOBODY (OOPS!).

Source/WebCore:

No new tests, no functionality changed.

* CMakeLists.txt:
* GNUmakefile.list.am: Add PlatformTimeRanges.

* Modules/mediasource/MediaSource.cpp:
(WebCore::MediaSource::buffered): TimeRanges -> PlatformTimeRanges.
* Modules/mediasource/MediaSource.h:

* Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample): TimeRanges* -> TimeRanges&.

* WebCore.exp.in: Update for signature changes.

* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCore.vcxproj.filters:
* WebCore.xcodeproj/project.pbxproj: Add PlatformTimeRanges.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::percentLoaded): Create TimeRanges from PlatformTimeRanges.
(WebCore::HTMLMediaElement::buffered): Ditto.
(WebCore::HTMLMediaElement::seekable): Ditto.

* html/MediaController.cpp:
(MediaController::buffered): TimeRanges* -> TimeRanges&.
(MediaController::seekable): Ditto.
(MediaController::played): Ditto.

Move all of the logic into PlatformTimeRanges. Change API to take TimeRanges& instead of TimeRanges*.
* html/TimeRanges.cpp:
(WebCore::TimeRanges::create): Move to .cpp from .h.
(WebCore::TimeRanges::TimeRanges): Initialize the PlatformTimeRanges member variable.
(WebCore::TimeRanges::start): Passthrough to PlatformTimeRanges.
(WebCore::TimeRanges::end): Ditto.
(WebCore::TimeRanges::invert): Ditto.
(WebCore::TimeRanges::copy): Ditto.
(WebCore::TimeRanges::intersectWith): Ditto.
(WebCore::TimeRanges::unionWith): Ditto.
(WebCore::TimeRanges::length): Ditto.
(WebCore::TimeRanges::add): Ditto.
(WebCore::TimeRanges::contain): Ditto.
(WebCore::TimeRanges::find): Ditto.
(WebCore::TimeRanges::nearest): Ditto.
(WebCore::TimeRanges::totalDuration): Ditto.
* html/TimeRanges.h:

* platform/graphics/MediaPlayer.cpp:
(WebCore::NullMediaPlayerPrivate::buffered): TimeRanges -> PlatformTimeRanges.
(WebCore::MediaPlayer::buffered): Ditto.
(WebCore::MediaPlayer::seekable): Ditto.
* platform/graphics/MediaPlayer.h:
* platform/graphics/MediaPlayerPrivate.h:

* platform/graphics/MediaSourcePrivateClient.h:

* platform/graphics/PlatformTimeRanges.cpp: Added.
* platform/graphics/PlatformTimeRanges.h: Added.

* platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
(WebCore::MediaPlayerPrivateAVFoundation::buffered): TimeRanges -> PlatformTimeRanges.
(WebCore::MediaPlayerPrivateAVFoundation::loadedTimeRangesChanged): Drive-by fix to log
    FunctionType notifications. ASSERT when passed an unknown notification.

* platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
* platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
(WebCore::MediaPlayerPrivateAVFoundationCF::platformBufferedTimeRanges):  TimeRanges -> PlatformTimeRanges.
* platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::currentTime): Ditto.
(WebCore::MediaPlayerPrivateAVFoundationObjC::platformBufferedTimeRanges): Ditto.

* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekable): Ditto.
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::buffered): Ditto.

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::buffered): Ditto.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:

* platform/graphics/ios/MediaPlayerPrivateIOS.h:
* platform/graphics/ios/MediaPlayerPrivateIOS.mm:
(WebCore::MediaPlayerPrivateIOS::buffered): Ditto.

* platform/graphics/mac/MediaPlayerPrivateQTKit.h:
* platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
(WebCore::MediaPlayerPrivateQTKit::buffered): Ditto.

* platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.cpp:
(WebCore::MediaPlayerPrivateQuickTimeVisualContext::buffered): Ditto.
* platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.h:

* platform/graphics/wince/MediaPlayerPrivateWinCE.h:

* platform/mock/mediasource/MockMediaPlayerMediaSource.cpp:
(WebCore::MockMediaPlayerMediaSource::buffered): Ditto.
(WebCore::MockMediaPlayerMediaSource::advanceCurrentTime): Ditto.
* platform/mock/mediasource/MockMediaPlayerMediaSource.h:

Source/WebKit:

* WebKit.vcxproj/WebKitExportGenerator/WebKitExports.def.in: TimeRanges::create(void) for Internals.

Tools:

* TestWebKitAPI/Tests/WebCore/TimeRanges.cpp: TimeRanges* -> TimeRanges&.
(TestWebKitAPI::TEST):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@164498 268f45cc-cd09-0410-ab3c-d52691b4dbfc
43 files changed:
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/GNUmakefile.list.am
Source/WebCore/Modules/mediasource/MediaSource.cpp
Source/WebCore/Modules/mediasource/MediaSource.h
Source/WebCore/Modules/mediasource/SourceBuffer.cpp
Source/WebCore/WebCore.exp.in
Source/WebCore/WebCore.vcxproj/WebCore.vcxproj
Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/html/HTMLMediaElement.cpp
Source/WebCore/html/MediaController.cpp
Source/WebCore/html/TimeRanges.cpp
Source/WebCore/html/TimeRanges.h
Source/WebCore/platform/graphics/MediaPlayer.cpp
Source/WebCore/platform/graphics/MediaPlayer.h
Source/WebCore/platform/graphics/MediaPlayerPrivate.h
Source/WebCore/platform/graphics/MediaSourcePrivateClient.h
Source/WebCore/platform/graphics/PlatformTimeRanges.cpp [new file with mode: 0644]
Source/WebCore/platform/graphics/PlatformTimeRanges.h [new file with mode: 0644]
Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp
Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h
Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp
Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.h
Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h
Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm
Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h
Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm
Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp
Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h
Source/WebCore/platform/graphics/ios/MediaPlayerPrivateIOS.h
Source/WebCore/platform/graphics/ios/MediaPlayerPrivateIOS.mm
Source/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.h
Source/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.mm
Source/WebCore/platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.cpp
Source/WebCore/platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.h
Source/WebCore/platform/graphics/wince/MediaPlayerPrivateWinCE.h
Source/WebCore/platform/mock/mediasource/MockMediaPlayerMediaSource.cpp
Source/WebCore/platform/mock/mediasource/MockMediaPlayerMediaSource.h
Source/WebKit/ChangeLog
Source/WebKit/WebKit.vcxproj/WebKitExportGenerator/WebKitExports.def.in
Tools/ChangeLog
Tools/TestWebKitAPI/Tests/WebCore/TimeRanges.cpp