<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[164498] trunk</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/164498">164498</a></dd>
<dt>Author</dt> <dd>eric.carlson@apple.com</dd>
<dt>Date</dt> <dd>2014-02-21 14:04:06 -0800 (Fri, 21 Feb 2014)</dd>
</dl>
<h3>Log Message</h3>
<pre>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):</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreCMakeListstxt">trunk/Source/WebCore/CMakeLists.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreGNUmakefilelistam">trunk/Source/WebCore/GNUmakefile.list.am</a></li>
<li><a href="#trunkSourceWebCoreModulesmediasourceMediaSourcecpp">trunk/Source/WebCore/Modules/mediasource/MediaSource.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesmediasourceMediaSourceh">trunk/Source/WebCore/Modules/mediasource/MediaSource.h</a></li>
<li><a href="#trunkSourceWebCoreModulesmediasourceSourceBuffercpp">trunk/Source/WebCore/Modules/mediasource/SourceBuffer.cpp</a></li>
<li><a href="#trunkSourceWebCoreWebCoreexpin">trunk/Source/WebCore/WebCore.exp.in</a></li>
<li><a href="#trunkSourceWebCoreWebCorevcxprojWebCorevcxproj">trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj</a></li>
<li><a href="#trunkSourceWebCoreWebCorevcxprojWebCorevcxprojfilters">trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLMediaElementcpp">trunk/Source/WebCore/html/HTMLMediaElement.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlMediaControllercpp">trunk/Source/WebCore/html/MediaController.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlTimeRangescpp">trunk/Source/WebCore/html/TimeRanges.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlTimeRangesh">trunk/Source/WebCore/html/TimeRanges.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsMediaPlayercpp">trunk/Source/WebCore/platform/graphics/MediaPlayer.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsMediaPlayerh">trunk/Source/WebCore/platform/graphics/MediaPlayer.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsMediaPlayerPrivateh">trunk/Source/WebCore/platform/graphics/MediaPlayerPrivate.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsMediaSourcePrivateClienth">trunk/Source/WebCore/platform/graphics/MediaSourcePrivateClient.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationMediaPlayerPrivateAVFoundationcpp">trunk/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationMediaPlayerPrivateAVFoundationh">trunk/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationcfMediaPlayerPrivateAVFoundationCFcpp">trunk/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationcfMediaPlayerPrivateAVFoundationCFh">trunk/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationobjcMediaPlayerPrivateAVFoundationObjCh">trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationobjcMediaPlayerPrivateAVFoundationObjCmm">trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationobjcMediaPlayerPrivateMediaSourceAVFObjCh">trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationobjcMediaPlayerPrivateMediaSourceAVFObjCmm">trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsgstreamerMediaPlayerPrivateGStreamercpp">trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsgstreamerMediaPlayerPrivateGStreamerh">trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsiosMediaPlayerPrivateIOSh">trunk/Source/WebCore/platform/graphics/ios/MediaPlayerPrivateIOS.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsiosMediaPlayerPrivateIOSmm">trunk/Source/WebCore/platform/graphics/ios/MediaPlayerPrivateIOS.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsmacMediaPlayerPrivateQTKith">trunk/Source/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsmacMediaPlayerPrivateQTKitmm">trunk/Source/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicswinMediaPlayerPrivateQuickTimeVisualContextcpp">trunk/Source/WebCore/platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicswinMediaPlayerPrivateQuickTimeVisualContexth">trunk/Source/WebCore/platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicswinceMediaPlayerPrivateWinCEh">trunk/Source/WebCore/platform/graphics/wince/MediaPlayerPrivateWinCE.h</a></li>
<li><a href="#trunkSourceWebCoreplatformmockmediasourceMockMediaPlayerMediaSourcecpp">trunk/Source/WebCore/platform/mock/mediasource/MockMediaPlayerMediaSource.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformmockmediasourceMockMediaPlayerMediaSourceh">trunk/Source/WebCore/platform/mock/mediasource/MockMediaPlayerMediaSource.h</a></li>
<li><a href="#trunkSourceWebKitChangeLog">trunk/Source/WebKit/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitWebKitvcxprojWebKitExportGeneratorWebKitExportsdefin">trunk/Source/WebKit/WebKit.vcxproj/WebKitExportGenerator/WebKitExports.def.in</a></li>
<li><a href="#trunkToolsChangeLog">trunk/Tools/ChangeLog</a></li>
<li><a href="#trunkToolsTestWebKitAPITestsWebCoreTimeRangescpp">trunk/Tools/TestWebKitAPI/Tests/WebCore/TimeRanges.cpp</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreplatformgraphicsPlatformTimeRangescpp">trunk/Source/WebCore/platform/graphics/PlatformTimeRanges.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsPlatformTimeRangesh">trunk/Source/WebCore/platform/graphics/PlatformTimeRanges.h</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreCMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/CMakeLists.txt (164497 => 164498)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/CMakeLists.txt        2014-02-21 21:56:14 UTC (rev 164497)
+++ trunk/Source/WebCore/CMakeLists.txt        2014-02-21 22:04:06 UTC (rev 164498)
</span><span class="lines">@@ -1910,6 +1910,7 @@
</span><span class="cx"> platform/graphics/Path.cpp
</span><span class="cx"> platform/graphics/PathTraversalState.cpp
</span><span class="cx"> platform/graphics/Pattern.cpp
</span><ins>+ platform/graphics/PlatformTimeRanges.cpp
</ins><span class="cx"> platform/graphics/Region.cpp
</span><span class="cx"> platform/graphics/RoundedRect.cpp
</span><span class="cx"> platform/graphics/SVGGlyph.cpp
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (164497 => 164498)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-02-21 21:56:14 UTC (rev 164497)
+++ trunk/Source/WebCore/ChangeLog        2014-02-21 22:04:06 UTC (rev 164498)
</span><span class="lines">@@ -1,3 +1,110 @@
</span><ins>+2014-02-21 Eric Carlson <eric.carlson@apple.com>
+
+ Fix TimeRanges layering violations
+ https://bugs.webkit.org/show_bug.cgi?id=128717
+
+ Reviewed by Jer Noble.
+
+ 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:
+
</ins><span class="cx"> 2014-02-21 Enrica Casucci <enrica@apple.com>
</span><span class="cx">
</span><span class="cx"> Support WebSelections in WK2 on iOS.
</span></span></pre></div>
<a id="trunkSourceWebCoreGNUmakefilelistam"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/GNUmakefile.list.am (164497 => 164498)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/GNUmakefile.list.am        2014-02-21 21:56:14 UTC (rev 164497)
+++ trunk/Source/WebCore/GNUmakefile.list.am        2014-02-21 22:04:06 UTC (rev 164498)
</span><span class="lines">@@ -5338,6 +5338,8 @@
</span><span class="cx">         Source/WebCore/platform/graphics/MediaPlayer.cpp \
</span><span class="cx">         Source/WebCore/platform/graphics/MediaPlayer.h \
</span><span class="cx">         Source/WebCore/platform/graphics/MediaPlayerPrivate.h \
</span><ins>+        Source/WebCore/platform/graphics/PlatformTimeRanges.cpp \
+        Source/WebCore/platform/graphics/PlatformTimeRanges.h \
</ins><span class="cx">         Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp \
</span><span class="cx">         Source/WebCore/platform/graphics/opengl/TemporaryOpenGLSetting.cpp \
</span><span class="cx">         Source/WebCore/platform/graphics/opengl/TemporaryOpenGLSetting.h \
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesmediasourceMediaSourcecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/mediasource/MediaSource.cpp (164497 => 164498)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediasource/MediaSource.cpp        2014-02-21 21:56:14 UTC (rev 164497)
+++ trunk/Source/WebCore/Modules/mediasource/MediaSource.cpp        2014-02-21 22:04:06 UTC (rev 164498)
</span><span class="lines">@@ -131,7 +131,7 @@
</span><span class="cx"> return isClosed() ? std::numeric_limits<float>::quiet_NaN() : m_private->duration();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-PassRefPtr<TimeRanges> MediaSource::buffered() const
</del><ins>+std::unique_ptr<PlatformTimeRanges> MediaSource::buffered() const
</ins><span class="cx"> {
</span><span class="cx"> // Implements MediaSource algorithm for HTMLMediaElement.buffered.
</span><span class="cx"> // https://dvcs.w3.org/hg/html-media/raw-file/default/media-source/media-source.html#htmlmediaelement-extensions
</span><span class="lines">@@ -139,7 +139,7 @@
</span><span class="cx">
</span><span class="cx"> // 1. If activeSourceBuffers.length equals 0 then return an empty TimeRanges object and abort these steps.
</span><span class="cx"> if (ranges.isEmpty())
</span><del>- return TimeRanges::create();
</del><ins>+ return PlatformTimeRanges::create();
</ins><span class="cx">
</span><span class="cx"> // 2. Let active ranges be the ranges returned by buffered for each SourceBuffer object in activeSourceBuffers.
</span><span class="cx"> // 3. Let highest end time be the largest range end time in the active ranges.
</span><span class="lines">@@ -152,7 +152,7 @@
</span><span class="cx">
</span><span class="cx"> // Return an empty range if all ranges are empty.
</span><span class="cx"> if (highestEndTime < 0)
</span><del>- return TimeRanges::create();
</del><ins>+ return PlatformTimeRanges::create();
</ins><span class="cx">
</span><span class="cx"> // 4. Let intersection ranges equal a TimeRange object containing a single range from 0 to highest end time.
</span><span class="cx"> RefPtr<TimeRanges> intersectionRanges = TimeRanges::create(0, highestEndTime);
</span><span class="lines">@@ -169,10 +169,10 @@
</span><span class="cx">
</span><span class="cx"> // 5.3 Let new intersection ranges equal the the intersection between the intersection ranges and the source ranges.
</span><span class="cx"> // 5.4 Replace the ranges in intersection ranges with the new intersection ranges.
</span><del>- intersectionRanges->intersectWith(sourceRanges);
</del><ins>+ intersectionRanges->intersectWith(*sourceRanges);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>- return intersectionRanges.release();
</del><ins>+ return PlatformTimeRanges::create(intersectionRanges->ranges());
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> class SourceBufferBufferedDoesNotContainTime {
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesmediasourceMediaSourceh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/mediasource/MediaSource.h (164497 => 164498)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediasource/MediaSource.h        2014-02-21 21:56:14 UTC (rev 164497)
+++ trunk/Source/WebCore/Modules/mediasource/MediaSource.h        2014-02-21 22:04:06 UTC (rev 164498)
</span><span class="lines">@@ -72,7 +72,7 @@
</span><span class="cx"> // MediaSourcePrivateClient
</span><span class="cx"> virtual void setPrivateAndOpen(PassRef<MediaSourcePrivate>) override;
</span><span class="cx"> virtual double duration() const override;
</span><del>- virtual PassRefPtr<TimeRanges> buffered() const override;
</del><ins>+ virtual std::unique_ptr<PlatformTimeRanges> buffered() const override;
</ins><span class="cx">
</span><span class="cx"> bool attachToElement(HTMLMediaElement*);
</span><span class="cx"> void close();
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesmediasourceSourceBuffercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/mediasource/SourceBuffer.cpp (164497 => 164498)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediasource/SourceBuffer.cpp        2014-02-21 21:56:14 UTC (rev 164497)
+++ trunk/Source/WebCore/Modules/mediasource/SourceBuffer.cpp        2014-02-21 22:04:06 UTC (rev 164498)
</span><span class="lines">@@ -967,7 +967,7 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> erasedRanges->invert();
</span><del>- m_buffered->intersectWith(erasedRanges.get());
</del><ins>+ m_buffered->intersectWith(*erasedRanges.get());
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> // 1.17 If spliced audio frame is set:
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCoreexpin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.exp.in (164497 => 164498)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.exp.in        2014-02-21 21:56:14 UTC (rev 164497)
+++ trunk/Source/WebCore/WebCore.exp.in        2014-02-21 22:04:06 UTC (rev 164498)
</span><span class="lines">@@ -1423,8 +1423,10 @@
</span><span class="cx"> __ZN7WebCore9toElementEN3JSC7JSValueE
</span><span class="cx"> __ZN7WebCore9unionRectERKN3WTF6VectorINS_9FloatRectELm0ENS0_15CrashOnOverflowEEE
</span><span class="cx"> __ZN7WebCore10Pasteboard21createForCopyAndPasteEv
</span><del>-__ZN7WebCore10TimeRanges13intersectWithEPKS0_
</del><ins>+__ZN7WebCore10TimeRanges6createEv
+__ZN7WebCore10TimeRanges6createEdd
</ins><span class="cx"> __ZN7WebCore10TimeRangesC1Edd
</span><ins>+__ZN7WebCore10TimeRanges13intersectWithERKS0_
</ins><span class="cx"> __ZN7WebCore13SelectionRectC1ERKNS_7IntRectEbi
</span><span class="cx"> __ZNK3JSC8Bindings10RootObject12globalObjectEv
</span><span class="cx"> __ZNK3WTF6String14createCFStringEv
</span><span class="lines">@@ -1462,6 +1464,7 @@
</span><span class="cx"> __ZNK7WebCore10TimeRanges3endEjRi
</span><span class="cx"> __ZNK7WebCore10TimeRanges4copyEv
</span><span class="cx"> __ZNK7WebCore10TimeRanges5startEjRi
</span><ins>+__ZNK7WebCore10TimeRanges6lengthEv
</ins><span class="cx"> __ZNK7WebCore11FrameLoader10isCompleteEv
</span><span class="cx"> __ZNK7WebCore11FrameLoader14cancelledErrorERKNS_15ResourceRequestE
</span><span class="cx"> __ZNK7WebCore11FrameLoader14frameHasLoadedEv
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorevcxprojWebCorevcxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj (164497 => 164498)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj        2014-02-21 21:56:14 UTC (rev 164497)
+++ trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj        2014-02-21 22:04:06 UTC (rev 164498)
</span><span class="lines">@@ -7675,6 +7675,7 @@
</span><span class="cx"> <ClCompile Include="..\platform\graphics\Path.cpp" />
</span><span class="cx"> <ClCompile Include="..\platform\graphics\PathTraversalState.cpp" />
</span><span class="cx"> <ClCompile Include="..\platform\graphics\Pattern.cpp" />
</span><ins>+ <ClCompile Include="..\platform\graphics\PlatformTimeRanges.cpp" />
</ins><span class="cx"> <ClCompile Include="..\platform\graphics\Region.cpp" />
</span><span class="cx"> <ClCompile Include="..\platform\graphics\RoundedRect.cpp" />
</span><span class="cx"> <ClCompile Include="..\platform\graphics\SegmentedFontData.cpp" />
</span><span class="lines">@@ -19111,6 +19112,7 @@
</span><span class="cx"> <ClInclude Include="..\platform\graphics\PathTraversalState.h" />
</span><span class="cx"> <ClInclude Include="..\platform\graphics\Pattern.h" />
</span><span class="cx"> <ClInclude Include="..\platform\graphics\PlatformLayer.h" />
</span><ins>+ <ClInclude Include="..\platform\graphics\PlatformTimeRanges.h" />
</ins><span class="cx"> <ClInclude Include="..\platform\graphics\Region.h" />
</span><span class="cx"> <ClInclude Include="..\platform\graphics\RoundedRect.h" />
</span><span class="cx"> <ClInclude Include="..\platform\graphics\SegmentedFontData.h" />
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorevcxprojWebCorevcxprojfilters"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters (164497 => 164498)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters        2014-02-21 21:56:14 UTC (rev 164497)
+++ trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters        2014-02-21 22:04:06 UTC (rev 164498)
</span><span class="lines">@@ -1383,6 +1383,9 @@
</span><span class="cx"> <ClCompile Include="..\platform\graphics\Region.cpp">
</span><span class="cx"> <Filter>platform\graphics</Filter>
</span><span class="cx"> </ClCompile>
</span><ins>+ <ClCompile Include="..\platform\graphics\PlatformTimeRanges.cpp">
+ <Filter>platform\graphics</Filter>
+ </ClCompile>
</ins><span class="cx"> <ClCompile Include="..\platform\graphics\RoundedRect.cpp">
</span><span class="cx"> <Filter>platform\graphics</Filter>
</span><span class="cx"> </ClCompile>
</span><span class="lines">@@ -8324,6 +8327,9 @@
</span><span class="cx"> <ClInclude Include="..\platform\graphics\PlatformLayer.h">
</span><span class="cx"> <Filter>platform\graphics</Filter>
</span><span class="cx"> </ClInclude>
</span><ins>+ <ClInclude Include="..\platform\graphics\PlatformTimeRanges.h">
+ <Filter>platform\graphics</Filter>
+ </ClInclude>
</ins><span class="cx"> <ClInclude Include="..\platform\graphics\Region.h">
</span><span class="cx"> <Filter>platform\graphics</Filter>
</span><span class="cx"> </ClInclude>
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (164497 => 164498)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2014-02-21 21:56:14 UTC (rev 164497)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2014-02-21 22:04:06 UTC (rev 164498)
</span><span class="lines">@@ -172,6 +172,8 @@
</span><span class="cx">                 073BE35017D181A6002BD431 /* RTCPeerConnectionHandler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 07221BA817CF0AD400848E51 /* RTCPeerConnectionHandler.cpp */; };
</span><span class="cx">                 074300A50F4B8BCF008076CD /* MediaPlayerPrivateIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = 074300A30F4B8BCF008076CD /* MediaPlayerPrivateIOS.mm */; };
</span><span class="cx">                 074300A60F4B8BCF008076CD /* MediaPlayerPrivateIOS.h in Headers */ = {isa = PBXBuildFile; fileRef = 074300A40F4B8BCF008076CD /* MediaPlayerPrivateIOS.h */; };
</span><ins>+                074E82BA18A69F0E007EF54C /* PlatformTimeRanges.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 074E82B818A69F0E007EF54C /* PlatformTimeRanges.cpp */; };
+                074E82BB18A69F0E007EF54C /* PlatformTimeRanges.h in Headers */ = {isa = PBXBuildFile; fileRef = 074E82B918A69F0E007EF54C /* PlatformTimeRanges.h */; settings = {ATTRIBUTES = (Private, ); }; };
</ins><span class="cx">                 0753860214489E9800B78452 /* CachedTextTrack.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0753860014489E9800B78452 /* CachedTextTrack.cpp */; };
</span><span class="cx">                 0753860314489E9800B78452 /* CachedTextTrack.h in Headers */ = {isa = PBXBuildFile; fileRef = 0753860114489E9800B78452 /* CachedTextTrack.h */; };
</span><span class="cx">                 076306D017E1478D005A7C4E /* MediaStreamTrackSourcesCallback.h in Headers */ = {isa = PBXBuildFile; fileRef = 076306CC17E1478D005A7C4E /* MediaStreamTrackSourcesCallback.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="lines">@@ -6961,6 +6963,8 @@
</span><span class="cx">                 073BE34717D17E7A002BD431 /* JSNavigatorUserMediaSuccessCallback.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSNavigatorUserMediaSuccessCallback.h; sourceTree = "<group>"; };
</span><span class="cx">                 074300A30F4B8BCF008076CD /* MediaPlayerPrivateIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MediaPlayerPrivateIOS.mm; sourceTree = "<group>"; };
</span><span class="cx">                 074300A40F4B8BCF008076CD /* MediaPlayerPrivateIOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaPlayerPrivateIOS.h; sourceTree = "<group>"; };
</span><ins>+                074E82B818A69F0E007EF54C /* PlatformTimeRanges.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PlatformTimeRanges.cpp; sourceTree = "<group>"; };
+                074E82B918A69F0E007EF54C /* PlatformTimeRanges.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlatformTimeRanges.h; sourceTree = "<group>"; };
</ins><span class="cx">                 0753860014489E9800B78452 /* CachedTextTrack.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CachedTextTrack.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 0753860114489E9800B78452 /* CachedTextTrack.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CachedTextTrack.h; sourceTree = "<group>"; };
</span><span class="cx">                 076306CC17E1478D005A7C4E /* MediaStreamTrackSourcesCallback.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaStreamTrackSourcesCallback.h; sourceTree = "<group>"; };
</span><span class="lines">@@ -19899,6 +19903,8 @@
</span><span class="cx">                                 0562F9601573F88F0031CA16 /* PlatformLayer.h */,
</span><span class="cx">                                 072847E216EBC5B00043CFA4 /* PlatformTextTrack.h */,
</span><span class="cx">                                 072847E316EBC5B00043CFA4 /* PlatformTextTrackMenu.h */,
</span><ins>+                                074E82B818A69F0E007EF54C /* PlatformTimeRanges.cpp */,
+                                074E82B918A69F0E007EF54C /* PlatformTimeRanges.h */,
</ins><span class="cx">                                 BCAB417F13E356E800D8AAF3 /* Region.cpp */,
</span><span class="cx">                                 BCAB418013E356E800D8AAF3 /* Region.h */,
</span><span class="cx">                                 A73F95FC12C97BFE0031AAF9 /* RoundedRect.cpp */,
</span><span class="lines">@@ -24837,6 +24843,7 @@
</span><span class="cx">                                 297BE3D616C03C0B003316BD /* PlatformSpeechSynthesisVoice.h in Headers */,
</span><span class="cx">                                 297BE3D716C03C0E003316BD /* PlatformSpeechSynthesizer.h in Headers */,
</span><span class="cx">                                 1AD8F81B11CAB9E900E93E54 /* PlatformStrategies.h in Headers */,
</span><ins>+                                074E82BB18A69F0E007EF54C /* PlatformTimeRanges.h in Headers */,
</ins><span class="cx">                                 935C476B09AC4D4F00A6AAB4 /* PlatformWheelEvent.h in Headers */,
</span><span class="cx">                                 31D591B316697A6C00E6BF02 /* PlugInClient.h in Headers */,
</span><span class="cx">                                 A9C6E4F40D745E48006442E9 /* PluginData.h in Headers */,
</span><span class="lines">@@ -28218,6 +28225,7 @@
</span><span class="cx">                                 297BE3DA16C043D8003316BD /* PlatformSpeechSynthesizer.cpp in Sources */,
</span><span class="cx">                                 297BE3D816C03CCE003316BD /* PlatformSpeechSynthesizerMac.mm in Sources */,
</span><span class="cx">                                 1AD8F81C11CAB9E900E93E54 /* PlatformStrategies.cpp in Sources */,
</span><ins>+                                074E82BA18A69F0E007EF54C /* PlatformTimeRanges.cpp in Sources */,
</ins><span class="cx">                                 A9C6E4F30D745E48006442E9 /* PluginData.cpp in Sources */,
</span><span class="cx">                                 97205ABB1239292700B17380 /* PluginDocument.cpp in Sources */,
</span><span class="cx">                                 1ADA14100E1AE5D900023EE5 /* PluginMainThreadScheduler.cpp in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLMediaElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLMediaElement.cpp (164497 => 164498)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLMediaElement.cpp        2014-02-21 21:56:14 UTC (rev 164497)
+++ trunk/Source/WebCore/html/HTMLMediaElement.cpp        2014-02-21 22:04:06 UTC (rev 164498)
</span><span class="lines">@@ -3075,10 +3075,11 @@
</span><span class="cx"> return 0;
</span><span class="cx">
</span><span class="cx"> double buffered = 0;
</span><del>- RefPtr<TimeRanges> timeRanges = m_player->buffered();
</del><ins>+ bool ignored;
+ std::unique_ptr<PlatformTimeRanges> timeRanges = m_player->buffered();
</ins><span class="cx"> for (unsigned i = 0; i < timeRanges->length(); ++i) {
</span><del>- double start = timeRanges->start(i, IGNORE_EXCEPTION);
- double end = timeRanges->end(i, IGNORE_EXCEPTION);
</del><ins>+ double start = timeRanges->start(i, ignored);
+ double end = timeRanges->end(i, ignored);
</ins><span class="cx"> buffered += end - start;
</span><span class="cx"> }
</span><span class="cx"> return buffered / duration;
</span><span class="lines">@@ -4112,10 +4113,10 @@
</span><span class="cx">
</span><span class="cx"> #if ENABLE(MEDIA_SOURCE)
</span><span class="cx"> if (m_mediaSource)
</span><del>- return m_mediaSource->buffered();
</del><ins>+ return TimeRanges::create(*m_mediaSource->buffered());
</ins><span class="cx"> #endif
</span><span class="cx">
</span><del>- return m_player->buffered();
</del><ins>+ return TimeRanges::create(*m_player->buffered());
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> PassRefPtr<TimeRanges> HTMLMediaElement::played()
</span><span class="lines">@@ -4134,7 +4135,10 @@
</span><span class="cx">
</span><span class="cx"> PassRefPtr<TimeRanges> HTMLMediaElement::seekable() const
</span><span class="cx"> {
</span><del>- return m_player ? m_player->seekable() : TimeRanges::create();
</del><ins>+ if (m_player)
+ return TimeRanges::create(*m_player->seekable());
+
+ return TimeRanges::create();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> bool HTMLMediaElement::potentiallyPlaying() const
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlMediaControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/MediaController.cpp (164497 => 164498)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/MediaController.cpp        2014-02-21 21:56:14 UTC (rev 164497)
+++ trunk/Source/WebCore/html/MediaController.cpp        2014-02-21 22:04:06 UTC (rev 164498)
</span><span class="lines">@@ -95,7 +95,7 @@
</span><span class="cx"> // user agent has buffered, at the time the attribute is evaluated.
</span><span class="cx"> RefPtr<TimeRanges> bufferedRanges = m_mediaElements.first()->buffered();
</span><span class="cx"> for (size_t index = 1; index < m_mediaElements.size(); ++index)
</span><del>- bufferedRanges->intersectWith(m_mediaElements[index]->buffered().get());
</del><ins>+ bufferedRanges->intersectWith(*m_mediaElements[index]->buffered().get());
</ins><span class="cx"> return bufferedRanges;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -109,7 +109,7 @@
</span><span class="cx"> // user agent is able to seek to, at the time the attribute is evaluated.
</span><span class="cx"> RefPtr<TimeRanges> seekableRanges = m_mediaElements.first()->seekable();
</span><span class="cx"> for (size_t index = 1; index < m_mediaElements.size(); ++index)
</span><del>- seekableRanges->intersectWith(m_mediaElements[index]->seekable().get());
</del><ins>+ seekableRanges->intersectWith(*m_mediaElements[index]->seekable().get());
</ins><span class="cx"> return seekableRanges;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -123,7 +123,7 @@
</span><span class="cx"> // user agent has so far rendered, at the time the attribute is evaluated.
</span><span class="cx"> RefPtr<TimeRanges> playedRanges = m_mediaElements.first()->played();
</span><span class="cx"> for (size_t index = 1; index < m_mediaElements.size(); ++index)
</span><del>- playedRanges->unionWith(m_mediaElements[index]->played().get());
</del><ins>+ playedRanges->unionWith(*m_mediaElements[index]->played().get());
</ins><span class="cx"> return playedRanges;
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlTimeRangescpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/TimeRanges.cpp (164497 => 164498)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/TimeRanges.cpp        2014-02-21 21:56:14 UTC (rev 164497)
+++ trunk/Source/WebCore/html/TimeRanges.cpp        2014-02-21 22:04:06 UTC (rev 164498)
</span><span class="lines">@@ -29,180 +29,110 @@
</span><span class="cx">
</span><span class="cx"> #include "ExceptionCode.h"
</span><span class="cx"> #include "ExceptionCodePlaceholder.h"
</span><del>-#include <math.h>
</del><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><del>-TimeRanges::TimeRanges(double start, double end)
</del><ins>+PassRefPtr<TimeRanges> TimeRanges::create()
</ins><span class="cx"> {
</span><del>- add(start, end);
</del><ins>+ return adoptRef(new TimeRanges);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-PassRefPtr<TimeRanges> TimeRanges::copy() const
</del><ins>+PassRefPtr<TimeRanges> TimeRanges::create(double start, double end)
</ins><span class="cx"> {
</span><del>- RefPtr<TimeRanges> newSession = TimeRanges::create();
-
- unsigned size = m_ranges.size();
- for (unsigned i = 0; i < size; i++)
- newSession->add(m_ranges[i].m_start, m_ranges[i].m_end);
-
- return newSession.release();
</del><ins>+ return adoptRef(new TimeRanges(start, end));
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-void TimeRanges::invert()
</del><ins>+PassRefPtr<TimeRanges> TimeRanges::create(const PlatformTimeRanges& other)
</ins><span class="cx"> {
</span><del>- RefPtr<TimeRanges> inverted = TimeRanges::create();
- double posInf = std::numeric_limits<double>::infinity();
- double negInf = -std::numeric_limits<double>::infinity();
-
- if (!m_ranges.size())
- inverted->add(negInf, posInf);
- else {
- double start = m_ranges.first().m_start;
- if (start != negInf)
- inverted->add(negInf, start);
-
- for (size_t index = 0; index + 1 < m_ranges.size(); ++index)
- inverted->add(m_ranges[index].m_end, m_ranges[index + 1].m_start);
-
- double end = m_ranges.last().m_end;
- if (end != posInf)
- inverted->add(end, posInf);
- }
-
- m_ranges.swap(inverted->m_ranges);
</del><ins>+ return adoptRef(new TimeRanges(other));
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-void TimeRanges::intersectWith(const TimeRanges* other)
</del><ins>+TimeRanges::TimeRanges()
</ins><span class="cx"> {
</span><del>- ASSERT(other);
-
- if (other == this)
- return;
-
- RefPtr<TimeRanges> invertedOther = other->copy();
- invertedOther->invert();
-
- invert();
- unionWith(invertedOther.get());
- invert();
</del><span class="cx"> }
</span><span class="cx">
</span><del>-void TimeRanges::unionWith(const TimeRanges* other)
</del><ins>+TimeRanges::TimeRanges(double start, double end)
+ : m_ranges(PlatformTimeRanges(start, end))
</ins><span class="cx"> {
</span><del>- ASSERT(other);
- RefPtr<TimeRanges> unioned = copy();
- for (size_t index = 0; index < other->m_ranges.size(); ++index) {
- const Range& range = other->m_ranges[index];
- unioned->add(range.m_start, range.m_end);
- }
</del><ins>+}
</ins><span class="cx">
</span><del>- m_ranges.swap(unioned->m_ranges);
</del><ins>+TimeRanges::TimeRanges(const PlatformTimeRanges& other)
+ : m_ranges(other)
+{
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-double TimeRanges::start(unsigned index, ExceptionCode& ec) const
-{
- if (index >= length()) {
</del><ins>+double TimeRanges::start(unsigned index, ExceptionCode& ec) const
+{
+ bool valid;
+ double result = m_ranges.start(index, valid);
+
+ if (!valid) {
</ins><span class="cx"> ec = INDEX_SIZE_ERR;
</span><span class="cx"> return 0;
</span><span class="cx"> }
</span><del>- return m_ranges[index].m_start;
</del><ins>+ return result;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> double TimeRanges::end(unsigned index, ExceptionCode& ec) const
</span><span class="cx"> {
</span><del>- if (index >= length()) {
</del><ins>+ bool valid;
+ double result = m_ranges.end(index, valid);
+
+ if (!valid) {
</ins><span class="cx"> ec = INDEX_SIZE_ERR;
</span><span class="cx"> return 0;
</span><span class="cx"> }
</span><del>- return m_ranges[index].m_end;
</del><ins>+ return result;
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-void TimeRanges::add(double start, double end)
</del><ins>+void TimeRanges::invert()
</ins><span class="cx"> {
</span><del>- ASSERT(start <= end);
- unsigned int overlappingArcIndex;
- Range addedRange(start, end);
</del><ins>+ m_ranges.invert();
+}
</ins><span class="cx">
</span><del>- // For each present range check if we need to:
- // - merge with the added range, in case we are overlapping or contiguous
- // - Need to insert in place, we we are completely, not overlapping and not contiguous
- // in between two ranges.
- //
- // TODO: Given that we assume that ranges are correctly ordered, this could be optimized.
</del><ins>+PassRefPtr<TimeRanges> TimeRanges::copy() const
+{
+ return TimeRanges::create(m_ranges);
+}
</ins><span class="cx">
</span><del>- for (overlappingArcIndex = 0; overlappingArcIndex < m_ranges.size(); overlappingArcIndex++) {
- if (addedRange.isOverlappingRange(m_ranges[overlappingArcIndex])
- || addedRange.isContiguousWithRange(m_ranges[overlappingArcIndex])) {
- // We need to merge the addedRange and that range.
- addedRange = addedRange.unionWithOverlappingOrContiguousRange(m_ranges[overlappingArcIndex]);
- m_ranges.remove(overlappingArcIndex);
- overlappingArcIndex--;
- } else {
- // Check the case for which there is no more to do
- if (!overlappingArcIndex) {
- if (addedRange.isBeforeRange(m_ranges[0])) {
- // First index, and we are completely before that range (and not contiguous, nor overlapping).
- // We just need to be inserted here.
- break;
- }
- } else {
- if (m_ranges[overlappingArcIndex - 1].isBeforeRange(addedRange)
- && addedRange.isBeforeRange(m_ranges[overlappingArcIndex])) {
- // We are exactly after the current previous range, and before the current range, while
- // not overlapping with none of them. Insert here.
- break;
- }
- }
- }
- }
</del><ins>+void TimeRanges::intersectWith(const TimeRanges& other)
+{
+ m_ranges.intersectWith(other.ranges());
+}
</ins><span class="cx">
</span><del>- // Now that we are sure we don't overlap with any range, just add it.
- m_ranges.insert(overlappingArcIndex, addedRange);
</del><ins>+void TimeRanges::unionWith(const TimeRanges& other)
+{
+ m_ranges.unionWith(other.ranges());
</ins><span class="cx"> }
</span><span class="cx">
</span><ins>+unsigned TimeRanges::length() const
+{
+ return m_ranges.length();
+}
+
+void TimeRanges::add(double start, double end)
+{
+ m_ranges.add(start, end);
+}
+
</ins><span class="cx"> bool TimeRanges::contain(double time) const
</span><span class="cx"> {
</span><del>- return find(time) != notFound;
</del><ins>+ return m_ranges.contain(time);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> size_t TimeRanges::find(double time) const
</span><span class="cx"> {
</span><del>- for (unsigned n = 0; n < length(); n++) {
- if (time >= start(n, IGNORE_EXCEPTION) && time <= end(n, IGNORE_EXCEPTION))
- return n;
- }
- return notFound;
</del><ins>+ return m_ranges.find(time);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> double TimeRanges::nearest(double time) const
</span><span class="cx"> {
</span><del>- double closestDelta = std::numeric_limits<double>::infinity();
- double closestTime = 0;
- unsigned count = length();
- for (unsigned ndx = 0; ndx < count; ndx++) {
- double startTime = start(ndx, IGNORE_EXCEPTION);
- double endTime = end(ndx, IGNORE_EXCEPTION);
- if (time >= startTime && time <= endTime)
- return time;
- if (fabs(startTime - time) < closestDelta) {
- closestTime = startTime;
- closestDelta = fabsf(startTime - time);
- }
- if (fabs(endTime - time) < closestDelta) {
- closestTime = endTime;
- closestDelta = fabsf(endTime - time);
- }
- }
- return closestTime;
</del><ins>+ return m_ranges.nearest(time);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> double TimeRanges::totalDuration() const
</span><span class="cx"> {
</span><del>- double total = 0;
- for (unsigned n = 0; n < length(); n++)
- total += fabs(end(n, IGNORE_EXCEPTION) - start(n, IGNORE_EXCEPTION));
- return total;
</del><ins>+ return m_ranges.totalDuration();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlTimeRangesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/TimeRanges.h (164497 => 164498)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/TimeRanges.h        2014-02-21 21:56:14 UTC (rev 164497)
+++ trunk/Source/WebCore/html/TimeRanges.h        2014-02-21 22:04:06 UTC (rev 164498)
</span><span class="lines">@@ -26,6 +26,7 @@
</span><span class="cx"> #ifndef TimeRanges_h
</span><span class="cx"> #define TimeRanges_h
</span><span class="cx">
</span><ins>+#include "PlatformTimeRanges.h"
</ins><span class="cx"> #include <algorithm>
</span><span class="cx"> #include <wtf/PassRefPtr.h>
</span><span class="cx"> #include <wtf/RefCounted.h>
</span><span class="lines">@@ -37,82 +38,36 @@
</span><span class="cx">
</span><span class="cx"> class TimeRanges : public RefCounted<TimeRanges> {
</span><span class="cx"> public:
</span><del>- static PassRefPtr<TimeRanges> create()
- {
- return adoptRef(new TimeRanges);
- }
- static PassRefPtr<TimeRanges> create(double start, double end)
- {
- return adoptRef(new TimeRanges(start, end));
- }
</del><ins>+ static PassRefPtr<TimeRanges> create();
+ static PassRefPtr<TimeRanges> create(double start, double end);
+ static PassRefPtr<TimeRanges> create(const PlatformTimeRanges&);
</ins><span class="cx">
</span><del>- PassRefPtr<TimeRanges> copy() const;
- void invert();
- void intersectWith(const TimeRanges*);
- void unionWith(const TimeRanges*);
-
- unsigned length() const { return m_ranges.size(); }
</del><span class="cx"> double start(unsigned index, ExceptionCode&) const;
</span><span class="cx"> double end(unsigned index, ExceptionCode&) const;
</span><span class="cx">
</span><del>- void add(double start, double end);
</del><ins>+ PassRefPtr<TimeRanges> copy() const;
+ void invert();
+ void intersectWith(const TimeRanges&);
+ void unionWith(const TimeRanges&);
</ins><span class="cx">
</span><del>- bool contain(double time) const;
</del><ins>+ unsigned length() const;
</ins><span class="cx">
</span><del>- size_t find(double time) const;
</del><ins>+ void add(double start, double end);
+ bool contain(double time) const;
</ins><span class="cx">
</span><ins>+ size_t find(double time) const;
</ins><span class="cx"> double nearest(double time) const;
</span><del>-
</del><span class="cx"> double totalDuration() const;
</span><span class="cx">
</span><ins>+ const PlatformTimeRanges& ranges() const { return m_ranges; }
+
</ins><span class="cx"> private:
</span><del>- TimeRanges() { }
</del><ins>+ explicit TimeRanges();
</ins><span class="cx"> TimeRanges(double start, double end);
</span><del>- TimeRanges(const TimeRanges&);
</del><ins>+ TimeRanges(const PlatformTimeRanges&);
</ins><span class="cx">
</span><del>- // We consider all the Ranges to be semi-bounded as follow: [start, end[
- struct Range {
- Range() { }
- Range(double start, double end)
- {
- m_start = start;
- m_end = end;
- }
- double m_start;
- double m_end;
</del><span class="cx">
</span><del>- inline bool isPointInRange(double point) const
- {
- return m_start <= point && point < m_end;
- }
-
- inline bool isOverlappingRange(const Range& range) const
- {
- return isPointInRange(range.m_start) || isPointInRange(range.m_end) || range.isPointInRange(m_start);
- }
-
- inline bool isContiguousWithRange(const Range& range) const
- {
- return range.m_start == m_end || range.m_end == m_start;
- }
-
- inline Range unionWithOverlappingOrContiguousRange(const Range& range) const
- {
- Range ret;
-
- ret.m_start = std::min(m_start, range.m_start);
- ret.m_end = std::max(m_end, range.m_end);
-
- return ret;
- }
-
- inline bool isBeforeRange(const Range& range) const
- {
- return range.m_start >= m_end;
- }
- };
-
- Vector<Range> m_ranges;
</del><ins>+ PlatformTimeRanges m_ranges;
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsMediaPlayercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/MediaPlayer.cpp (164497 => 164498)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/MediaPlayer.cpp        2014-02-21 21:56:14 UTC (rev 164497)
+++ trunk/Source/WebCore/platform/graphics/MediaPlayer.cpp        2014-02-21 22:04:06 UTC (rev 164498)
</span><span class="lines">@@ -36,8 +36,8 @@
</span><span class="cx"> #include "Logging.h"
</span><span class="cx"> #include "MIMETypeRegistry.h"
</span><span class="cx"> #include "MediaPlayerPrivate.h"
</span><ins>+#include "PlatformTimeRanges.h"
</ins><span class="cx"> #include "Settings.h"
</span><del>-#include "TimeRanges.h"
</del><span class="cx"> #include <wtf/text/CString.h>
</span><span class="cx">
</span><span class="cx"> #if ENABLE(VIDEO_TRACK)
</span><span class="lines">@@ -127,7 +127,7 @@
</span><span class="cx">
</span><span class="cx"> virtual double maxTimeSeekableDouble() const { return 0; }
</span><span class="cx"> virtual double minTimeSeekable() const { return 0; }
</span><del>- virtual PassRefPtr<TimeRanges> buffered() const { return TimeRanges::create(); }
</del><ins>+ virtual std::unique_ptr<PlatformTimeRanges> buffered() const { return PlatformTimeRanges::create(); }
</ins><span class="cx">
</span><span class="cx"> virtual unsigned totalBytes() const { return 0; }
</span><span class="cx"> virtual bool didLoadingProgress() const { return false; }
</span><span class="lines">@@ -703,12 +703,12 @@
</span><span class="cx"> m_private->setPreservesPitch(preservesPitch);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-PassRefPtr<TimeRanges> MediaPlayer::buffered()
</del><ins>+std::unique_ptr<PlatformTimeRanges> MediaPlayer::buffered()
</ins><span class="cx"> {
</span><span class="cx"> return m_private->buffered();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-PassRefPtr<TimeRanges> MediaPlayer::seekable()
</del><ins>+std::unique_ptr<PlatformTimeRanges> MediaPlayer::seekable()
</ins><span class="cx"> {
</span><span class="cx"> return m_private->seekable();
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsMediaPlayerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/MediaPlayer.h (164497 => 164498)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/MediaPlayer.h        2014-02-21 21:56:14 UTC (rev 164497)
+++ trunk/Source/WebCore/platform/graphics/MediaPlayer.h        2014-02-21 22:04:06 UTC (rev 164498)
</span><span class="lines">@@ -128,12 +128,12 @@
</span><span class="cx"> class FrameView;
</span><span class="cx"> class GraphicsContext;
</span><span class="cx"> class GraphicsContext3D;
</span><ins>+class HostWindow;
</ins><span class="cx"> class IntRect;
</span><span class="cx"> class IntSize;
</span><span class="cx"> class MediaPlayer;
</span><span class="cx"> struct MediaPlayerFactory;
</span><del>-class TimeRanges;
-class HostWindow;
</del><ins>+class PlatformTimeRanges;
</ins><span class="cx">
</span><span class="cx"> #if PLATFORM(WIN) && USE(AVFOUNDATION)
</span><span class="cx"> struct GraphicsDeviceAdapter;
</span><span class="lines">@@ -352,8 +352,8 @@
</span><span class="cx"> bool preservesPitch() const;
</span><span class="cx"> void setPreservesPitch(bool);
</span><span class="cx">
</span><del>- PassRefPtr<TimeRanges> buffered();
- PassRefPtr<TimeRanges> seekable();
</del><ins>+ std::unique_ptr<PlatformTimeRanges> buffered();
+ std::unique_ptr<PlatformTimeRanges> seekable();
</ins><span class="cx"> double minTimeSeekable();
</span><span class="cx"> double maxTimeSeekable();
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsMediaPlayerPrivateh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/MediaPlayerPrivate.h (164497 => 164498)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/MediaPlayerPrivate.h        2014-02-21 21:56:14 UTC (rev 164497)
+++ trunk/Source/WebCore/platform/graphics/MediaPlayerPrivate.h        2014-02-21 22:04:06 UTC (rev 164498)
</span><span class="lines">@@ -29,8 +29,9 @@
</span><span class="cx"> #if ENABLE(VIDEO)
</span><span class="cx">
</span><span class="cx"> #include "MediaPlayer.h"
</span><del>-#include "TimeRanges.h"
</del><ins>+#include "PlatformTimeRanges.h"
</ins><span class="cx"> #include <wtf/Forward.h>
</span><ins>+#include <wtf/OwnPtr.h>
</ins><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><span class="lines">@@ -108,11 +109,11 @@
</span><span class="cx"> virtual MediaPlayer::NetworkState networkState() const = 0;
</span><span class="cx"> virtual MediaPlayer::ReadyState readyState() const = 0;
</span><span class="cx">
</span><del>- virtual PassRefPtr<TimeRanges> seekable() const { return maxTimeSeekableDouble() ? TimeRanges::create(minTimeSeekable(), maxTimeSeekableDouble()) : TimeRanges::create(); }
</del><ins>+ virtual std::unique_ptr<PlatformTimeRanges> seekable() const { return maxTimeSeekableDouble() ? PlatformTimeRanges::create(minTimeSeekable(), maxTimeSeekableDouble()) : PlatformTimeRanges::create(); }
</ins><span class="cx"> virtual float maxTimeSeekable() const { return 0; }
</span><span class="cx"> virtual double maxTimeSeekableDouble() const { return maxTimeSeekable(); }
</span><span class="cx"> virtual double minTimeSeekable() const { return 0; }
</span><del>- virtual PassRefPtr<TimeRanges> buffered() const = 0;
</del><ins>+ virtual std::unique_ptr<PlatformTimeRanges> buffered() const = 0;
</ins><span class="cx">
</span><span class="cx"> virtual bool didLoadingProgress() const = 0;
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsMediaSourcePrivateClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/MediaSourcePrivateClient.h (164497 => 164498)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/MediaSourcePrivateClient.h        2014-02-21 21:56:14 UTC (rev 164497)
+++ trunk/Source/WebCore/platform/graphics/MediaSourcePrivateClient.h        2014-02-21 22:04:06 UTC (rev 164498)
</span><span class="lines">@@ -28,7 +28,7 @@
</span><span class="cx">
</span><span class="cx"> #if ENABLE(MEDIA_SOURCE)
</span><span class="cx">
</span><del>-#include "TimeRanges.h"
</del><ins>+#include "PlatformTimeRanges.h"
</ins><span class="cx"> #include <wtf/RefCounted.h>
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="lines">@@ -41,7 +41,7 @@
</span><span class="cx">
</span><span class="cx"> virtual void setPrivateAndOpen(PassRef<MediaSourcePrivate>) = 0;
</span><span class="cx"> virtual double duration() const = 0;
</span><del>- virtual PassRefPtr<TimeRanges> buffered() const = 0;
</del><ins>+ virtual std::unique_ptr<PlatformTimeRanges> buffered() const = 0;
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsPlatformTimeRangescpp"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/platform/graphics/PlatformTimeRanges.cpp (0 => 164498)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/PlatformTimeRanges.cpp         (rev 0)
+++ trunk/Source/WebCore/platform/graphics/PlatformTimeRanges.cpp        2014-02-21 22:04:06 UTC (rev 164498)
</span><span class="lines">@@ -0,0 +1,230 @@
</span><ins>+/*
+ * Copyright (C) 2014 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "PlatformTimeRanges.h"
+
+#include <math.h>
+
+namespace WebCore {
+
+std::unique_ptr<PlatformTimeRanges> PlatformTimeRanges::create()
+{
+ return std::make_unique<PlatformTimeRanges>();
+}
+
+std::unique_ptr<PlatformTimeRanges> PlatformTimeRanges::create(double start, double end)
+{
+ return std::make_unique<PlatformTimeRanges>(start, end);
+}
+
+std::unique_ptr<PlatformTimeRanges> PlatformTimeRanges::create(const PlatformTimeRanges& other)
+{
+ return std::make_unique<PlatformTimeRanges>(other);
+}
+
+PlatformTimeRanges::PlatformTimeRanges(double start, double end)
+{
+ add(start, end);
+}
+
+PlatformTimeRanges::PlatformTimeRanges(const PlatformTimeRanges& other)
+{
+ copy(other);
+}
+
+PlatformTimeRanges& PlatformTimeRanges::operator=(const PlatformTimeRanges& other)
+{
+ return copy(other);
+}
+
+PlatformTimeRanges& PlatformTimeRanges::copy(const PlatformTimeRanges& other)
+{
+ unsigned size = other.m_ranges.size();
+ for (unsigned i = 0; i < size; i++)
+ add(other.m_ranges[i].m_start, other.m_ranges[i].m_end);
+
+ return *this;
+}
+
+void PlatformTimeRanges::invert()
+{
+ PlatformTimeRanges inverted;
+ double posInf = std::numeric_limits<double>::infinity();
+ double negInf = -std::numeric_limits<double>::infinity();
+
+ if (!m_ranges.size())
+ inverted.add(negInf, posInf);
+ else {
+ double start = m_ranges.first().m_start;
+ if (start != negInf)
+ inverted.add(negInf, start);
+
+ for (size_t index = 0; index + 1 < m_ranges.size(); ++index)
+ inverted.add(m_ranges[index].m_end, m_ranges[index + 1].m_start);
+
+ double end = m_ranges.last().m_end;
+ if (end != posInf)
+ inverted.add(end, posInf);
+ }
+
+ m_ranges.swap(inverted.m_ranges);
+}
+
+void PlatformTimeRanges::intersectWith(const PlatformTimeRanges& other)
+{
+ PlatformTimeRanges invertedOther(other);
+
+ invertedOther.invert();
+ invert();
+ unionWith(invertedOther);
+ invert();
+}
+
+void PlatformTimeRanges::unionWith(const PlatformTimeRanges& other)
+{
+ PlatformTimeRanges unioned(*this);
+
+ for (size_t index = 0; index < other.m_ranges.size(); ++index) {
+ const Range& range = other.m_ranges[index];
+ unioned.add(range.m_start, range.m_end);
+ }
+
+ m_ranges.swap(unioned.m_ranges);
+}
+
+double PlatformTimeRanges::start(unsigned index, bool& valid) const
+{
+ if (index >= length()) {
+ valid = false;
+ return 0;
+ }
+
+ valid = true;
+ return m_ranges[index].m_start;
+}
+
+double PlatformTimeRanges::end(unsigned index, bool& valid) const
+{
+ if (index >= length()) {
+ valid = false;
+ return 0;
+ }
+
+ valid = true;
+ return m_ranges[index].m_end;
+}
+
+void PlatformTimeRanges::add(double start, double end)
+{
+ ASSERT(start <= end);
+ unsigned overlappingArcIndex;
+ Range addedRange(start, end);
+
+ // For each present range check if we need to:
+ // - merge with the added range, in case we are overlapping or contiguous
+ // - Need to insert in place, we we are completely, not overlapping and not contiguous
+ // in between two ranges.
+ //
+ // TODO: Given that we assume that ranges are correctly ordered, this could be optimized.
+
+ for (overlappingArcIndex = 0; overlappingArcIndex < m_ranges.size(); overlappingArcIndex++) {
+ if (addedRange.isOverlappingRange(m_ranges[overlappingArcIndex]) || addedRange.isContiguousWithRange(m_ranges[overlappingArcIndex])) {
+ // We need to merge the addedRange and that range.
+ addedRange = addedRange.unionWithOverlappingOrContiguousRange(m_ranges[overlappingArcIndex]);
+ m_ranges.remove(overlappingArcIndex);
+ overlappingArcIndex--;
+ } else {
+ // Check the case for which there is no more to do
+ if (!overlappingArcIndex) {
+ if (addedRange.isBeforeRange(m_ranges[0])) {
+ // First index, and we are completely before that range (and not contiguous, nor overlapping).
+ // We just need to be inserted here.
+ break;
+ }
+ } else {
+ if (m_ranges[overlappingArcIndex - 1].isBeforeRange(addedRange) && addedRange.isBeforeRange(m_ranges[overlappingArcIndex])) {
+ // We are exactly after the current previous range, and before the current range, while
+ // not overlapping with none of them. Insert here.
+ break;
+ }
+ }
+ }
+ }
+
+ // Now that we are sure we don't overlap with any range, just add it.
+ m_ranges.insert(overlappingArcIndex, addedRange);
+}
+
+bool PlatformTimeRanges::contain(double time) const
+{
+ return find(time) != notFound;
+}
+
+size_t PlatformTimeRanges::find(double time) const
+{
+ bool ignoreInvalid;
+ for (unsigned n = 0; n < length(); n++) {
+ if (time >= start(n, ignoreInvalid) && time <= end(n, ignoreInvalid))
+ return n;
+ }
+ return notFound;
+}
+
+double PlatformTimeRanges::nearest(double time) const
+{
+ double closestDelta = std::numeric_limits<double>::infinity();
+ double closestTime = 0;
+ unsigned count = length();
+ bool ignoreInvalid;
+
+ for (unsigned ndx = 0; ndx < count; ndx++) {
+ double startTime = start(ndx, ignoreInvalid);
+ double endTime = end(ndx, ignoreInvalid);
+ if (time >= startTime && time <= endTime)
+ return time;
+ if (fabs(startTime - time) < closestDelta) {
+ closestTime = startTime;
+ closestDelta = fabsf(startTime - time);
+ }
+ if (fabs(endTime - time) < closestDelta) {
+ closestTime = endTime;
+ closestDelta = fabsf(endTime - time);
+ }
+ }
+ return closestTime;
+}
+
+double PlatformTimeRanges::totalDuration() const
+{
+ double total = 0;
+ bool ignoreInvalid;
+
+ for (unsigned n = 0; n < length(); n++)
+ total += fabs(end(n, ignoreInvalid) - start(n, ignoreInvalid));
+ return total;
+}
+
+}
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsPlatformTimeRangesh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/platform/graphics/PlatformTimeRanges.h (0 => 164498)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/PlatformTimeRanges.h         (rev 0)
+++ trunk/Source/WebCore/platform/graphics/PlatformTimeRanges.h        2014-02-21 22:04:06 UTC (rev 164498)
</span><span class="lines">@@ -0,0 +1,117 @@
</span><ins>+/*
+ * Copyright (C) 2014 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef PlatformTimeRanges_h
+#define PlatformTimeRanges_h
+
+#include <algorithm>
+#include <wtf/PassRefPtr.h>
+#include <wtf/RefCounted.h>
+#include <wtf/Vector.h>
+
+namespace WebCore {
+
+class PlatformTimeRanges {
+public:
+ static std::unique_ptr<PlatformTimeRanges> create();
+ static std::unique_ptr<PlatformTimeRanges> create(double start, double end);
+ static std::unique_ptr<PlatformTimeRanges> create(const PlatformTimeRanges&);
+
+ explicit PlatformTimeRanges() { }
+ PlatformTimeRanges(double start, double end);
+ PlatformTimeRanges(const PlatformTimeRanges&);
+
+ PlatformTimeRanges& operator=(const PlatformTimeRanges&);
+
+ double start(unsigned index, bool& valid) const;
+ double end(unsigned index, bool& valid) const;
+
+ void invert();
+ void intersectWith(const PlatformTimeRanges&);
+ void unionWith(const PlatformTimeRanges&);
+
+ unsigned length() const { return m_ranges.size(); }
+
+ void add(double start, double end);
+
+ bool contain(double time) const;
+
+ size_t find(double time) const;
+
+ double nearest(double time) const;
+
+ double totalDuration() const;
+
+private:
+ PlatformTimeRanges& copy(const PlatformTimeRanges&);
+
+ // We consider all the Ranges to be semi-bounded as follow: [start, end[
+ struct Range {
+ Range() { }
+ Range(double start, double end)
+ {
+ m_start = start;
+ m_end = end;
+ }
+ double m_start;
+ double m_end;
+
+ inline bool isPointInRange(double point) const
+ {
+ return m_start <= point && point < m_end;
+ }
+
+ inline bool isOverlappingRange(const Range& range) const
+ {
+ return isPointInRange(range.m_start) || isPointInRange(range.m_end) || range.isPointInRange(m_start);
+ }
+
+ inline bool isContiguousWithRange(const Range& range) const
+ {
+ return range.m_start == m_end || range.m_end == m_start;
+ }
+
+ inline Range unionWithOverlappingOrContiguousRange(const Range& range) const
+ {
+ Range ret;
+
+ ret.m_start = std::min(m_start, range.m_start);
+ ret.m_end = std::max(m_end, range.m_end);
+
+ return ret;
+ }
+
+ inline bool isBeforeRange(const Range& range) const
+ {
+ return range.m_start >= m_end;
+ }
+ };
+
+ Vector<Range> m_ranges;
+};
+
+} // namespace WebCore
+
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationMediaPlayerPrivateAVFoundationcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp (164497 => 164498)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp        2014-02-21 21:56:14 UTC (rev 164497)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp        2014-02-21 22:04:06 UTC (rev 164498)
</span><span class="lines">@@ -38,11 +38,12 @@
</span><span class="cx"> #include "URL.h"
</span><span class="cx"> #include "Logging.h"
</span><span class="cx"> #include "PlatformLayer.h"
</span><ins>+#include "PlatformTimeRanges.h"
</ins><span class="cx"> #include "Settings.h"
</span><span class="cx"> #include "SoftLinking.h"
</span><del>-#include "TimeRanges.h"
</del><span class="cx"> #include <CoreMedia/CoreMedia.h>
</span><span class="cx"> #include <wtf/MainThread.h>
</span><ins>+#include <wtf/text/CString.h>
</ins><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><span class="lines">@@ -385,12 +386,12 @@
</span><span class="cx"> characteristicsChanged();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-PassRefPtr<TimeRanges> MediaPlayerPrivateAVFoundation::buffered() const
</del><ins>+std::unique_ptr<PlatformTimeRanges> MediaPlayerPrivateAVFoundation::buffered() const
</ins><span class="cx"> {
</span><span class="cx"> if (!m_cachedLoadedTimeRanges)
</span><span class="cx"> m_cachedLoadedTimeRanges = platformBufferedTimeRanges();
</span><span class="cx">
</span><del>- return m_cachedLoadedTimeRanges->copy();
</del><ins>+ return PlatformTimeRanges::create(*m_cachedLoadedTimeRanges);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> double MediaPlayerPrivateAVFoundation::maxTimeSeekableDouble() const
</span><span class="lines">@@ -620,7 +621,7 @@
</span><span class="cx">
</span><span class="cx"> void MediaPlayerPrivateAVFoundation::loadedTimeRangesChanged()
</span><span class="cx"> {
</span><del>- m_cachedLoadedTimeRanges = 0;
</del><ins>+ m_cachedLoadedTimeRanges = nullptr;
</ins><span class="cx"> m_cachedMaxTimeLoaded = 0;
</span><span class="cx"> invalidateCachedDuration();
</span><span class="cx"> }
</span><span class="lines">@@ -768,8 +769,9 @@
</span><span class="cx"> {
</span><span class="cx"> #define DEFINE_TYPE_STRING_CASE(type) case MediaPlayerPrivateAVFoundation::Notification::type: return #type;
</span><span class="cx"> switch (notification.type()) {
</span><del>- FOR_EACH_MEDIAPLAYERPRIVATEAVFOUNDATION_NOTIFICATION_TYPE(DEFINE_TYPE_STRING_CASE)
- default: return "";
</del><ins>+ FOR_EACH_MEDIAPLAYERPRIVATEAVFOUNDATION_NOTIFICATION_TYPE(DEFINE_TYPE_STRING_CASE)
+ case MediaPlayerPrivateAVFoundation::Notification::FunctionType: return "FunctionType";
+ default: ASSERT_NOT_REACHED(); return "";
</ins><span class="cx"> }
</span><span class="cx"> #undef DEFINE_TYPE_STRING_CASE
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationMediaPlayerPrivateAVFoundationh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h (164497 => 164498)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h        2014-02-21 21:56:14 UTC (rev 164497)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h        2014-02-21 22:04:06 UTC (rev 164498)
</span><span class="lines">@@ -174,7 +174,7 @@
</span><span class="cx"> virtual MediaPlayer::ReadyState readyState() const override { return m_readyState; }
</span><span class="cx"> virtual double maxTimeSeekableDouble() const override;
</span><span class="cx"> virtual double minTimeSeekable() const override;
</span><del>- virtual PassRefPtr<TimeRanges> buffered() const override;
</del><ins>+ virtual std::unique_ptr<PlatformTimeRanges> buffered() const override;
</ins><span class="cx"> virtual bool didLoadingProgress() const override;
</span><span class="cx"> virtual void setSize(const IntSize&) override;
</span><span class="cx"> virtual void paint(GraphicsContext*, const IntRect&) = 0;
</span><span class="lines">@@ -229,7 +229,7 @@
</span><span class="cx"> virtual float rate() const = 0;
</span><span class="cx"> virtual void seekToTime(double time, double negativeTolerance, double positiveTolerance) = 0;
</span><span class="cx"> virtual unsigned long long totalBytes() const = 0;
</span><del>- virtual PassRefPtr<TimeRanges> platformBufferedTimeRanges() const = 0;
</del><ins>+ virtual std::unique_ptr<PlatformTimeRanges> platformBufferedTimeRanges() const = 0;
</ins><span class="cx"> virtual double platformMaxTimeSeekable() const = 0;
</span><span class="cx"> virtual double platformMinTimeSeekable() const = 0;
</span><span class="cx"> virtual float platformMaxTimeLoaded() const = 0;
</span><span class="lines">@@ -304,7 +304,7 @@
</span><span class="cx"> Vector<Notification> m_queuedNotifications;
</span><span class="cx"> mutable Mutex m_queueMutex;
</span><span class="cx">
</span><del>- mutable RefPtr<TimeRanges> m_cachedLoadedTimeRanges;
</del><ins>+ mutable std::unique_ptr<PlatformTimeRanges> m_cachedLoadedTimeRanges;
</ins><span class="cx">
</span><span class="cx"> MediaPlayer::NetworkState m_networkState;
</span><span class="cx"> MediaPlayer::ReadyState m_readyState;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationcfMediaPlayerPrivateAVFoundationCFcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp (164497 => 164498)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp        2014-02-21 21:56:14 UTC (rev 164497)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp        2014-02-21 22:04:06 UTC (rev 164498)
</span><span class="lines">@@ -618,16 +618,16 @@
</span><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-PassRefPtr<TimeRanges> MediaPlayerPrivateAVFoundationCF::platformBufferedTimeRanges() const
</del><ins>+std::unique_ptr<PlatformTimeRanges> MediaPlayerPrivateAVFoundationCF::platformBufferedTimeRanges() const
</ins><span class="cx"> {
</span><del>- RefPtr<TimeRanges> timeRanges = TimeRanges::create();
</del><ins>+ auto timeRanges = PlatformTimeRanges::create();
</ins><span class="cx">
</span><span class="cx"> if (!avPlayerItem(m_avfWrapper))
</span><del>- return timeRanges.release();
</del><ins>+ return timeRanges;
</ins><span class="cx">
</span><span class="cx"> RetainPtr<CFArrayRef> loadedRanges = adoptCF(AVCFPlayerItemCopyLoadedTimeRanges(avPlayerItem(m_avfWrapper)));
</span><span class="cx"> if (!loadedRanges)
</span><del>- return timeRanges.release();
</del><ins>+ return timeRanges;
</ins><span class="cx">
</span><span class="cx"> CFIndex rangeCount = CFArrayGetCount(loadedRanges.get());
</span><span class="cx"> for (CFIndex i = 0; i < rangeCount; i++) {
</span><span class="lines">@@ -642,7 +642,7 @@
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><del>- return timeRanges.release();
</del><ins>+ return timeRanges;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> double MediaPlayerPrivateAVFoundationCF::platformMinTimeSeekable() const
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationcfMediaPlayerPrivateAVFoundationCFh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.h (164497 => 164498)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.h        2014-02-21 21:56:14 UTC (rev 164497)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.h        2014-02-21 22:04:06 UTC (rev 164498)
</span><span class="lines">@@ -78,7 +78,7 @@
</span><span class="cx"> virtual float rate() const;
</span><span class="cx"> virtual void seekToTime(double time, double negativeTolerance, double positiveTolerance);
</span><span class="cx"> virtual unsigned long long totalBytes() const;
</span><del>- virtual PassRefPtr<TimeRanges> platformBufferedTimeRanges() const;
</del><ins>+ virtual std::unique_ptr<PlatformTimeRanges> platformBufferedTimeRanges() const;
</ins><span class="cx"> virtual double platformMinTimeSeekable() const;
</span><span class="cx"> virtual double platformMaxTimeSeekable() const;
</span><span class="cx"> virtual float platformDuration() const;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationobjcMediaPlayerPrivateAVFoundationObjCh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h (164497 => 164498)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h        2014-02-21 21:56:14 UTC (rev 164497)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h        2014-02-21 22:04:06 UTC (rev 164498)
</span><span class="lines">@@ -153,7 +153,7 @@
</span><span class="cx"> virtual float rate() const;
</span><span class="cx"> virtual void seekToTime(double time, double negativeTolerance, double positiveTolerance);
</span><span class="cx"> virtual unsigned long long totalBytes() const;
</span><del>- virtual PassRefPtr<TimeRanges> platformBufferedTimeRanges() const;
</del><ins>+ virtual std::unique_ptr<PlatformTimeRanges> platformBufferedTimeRanges() const;
</ins><span class="cx"> virtual double platformMinTimeSeekable() const;
</span><span class="cx"> virtual double platformMaxTimeSeekable() const;
</span><span class="cx"> virtual float platformDuration() const;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationobjcMediaPlayerPrivateAVFoundationObjCmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm (164497 => 164498)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm        2014-02-21 21:56:14 UTC (rev 164497)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm        2014-02-21 22:04:06 UTC (rev 164498)
</span><span class="lines">@@ -43,9 +43,9 @@
</span><span class="cx"> #import "InbandTextTrackPrivateLegacyAVFObjC.h"
</span><span class="cx"> #import "URL.h"
</span><span class="cx"> #import "Logging.h"
</span><ins>+#import "PlatformTimeRanges.h"
</ins><span class="cx"> #import "SecurityOrigin.h"
</span><span class="cx"> #import "SoftLinking.h"
</span><del>-#import "TimeRanges.h"
</del><span class="cx"> #import "UUID.h"
</span><span class="cx"> #import "VideoTrackPrivateAVFObjC.h"
</span><span class="cx"> #import "WebCoreAVFResourceLoader.h"
</span><span class="lines">@@ -752,12 +752,12 @@
</span><span class="cx"> return m_cachedRate;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-PassRefPtr<TimeRanges> MediaPlayerPrivateAVFoundationObjC::platformBufferedTimeRanges() const
</del><ins>+std::unique_ptr<PlatformTimeRanges> MediaPlayerPrivateAVFoundationObjC::platformBufferedTimeRanges() const
</ins><span class="cx"> {
</span><del>- RefPtr<TimeRanges> timeRanges = TimeRanges::create();
</del><ins>+ auto timeRanges = PlatformTimeRanges::create();
</ins><span class="cx">
</span><span class="cx"> if (!m_avPlayerItem)
</span><del>- return timeRanges.release();
</del><ins>+ return timeRanges;
</ins><span class="cx">
</span><span class="cx"> for (NSValue *thisRangeValue in m_cachedLoadedRanges.get()) {
</span><span class="cx"> CMTimeRange timeRange = [thisRangeValue CMTimeRangeValue];
</span><span class="lines">@@ -767,7 +767,7 @@
</span><span class="cx"> timeRanges->add(rangeStart, rangeEnd);
</span><span class="cx"> }
</span><span class="cx"> }
</span><del>- return timeRanges.release();
</del><ins>+ return timeRanges;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> double MediaPlayerPrivateAVFoundationObjC::platformMinTimeSeekable() const
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationobjcMediaPlayerPrivateMediaSourceAVFObjCh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h (164497 => 164498)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h        2014-02-21 21:56:14 UTC (rev 164497)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h        2014-02-21 22:04:06 UTC (rev 164498)
</span><span class="lines">@@ -116,10 +116,10 @@
</span><span class="cx"> virtual bool seeking() const override;
</span><span class="cx"> virtual void setRateDouble(double) override;
</span><span class="cx">
</span><del>- virtual PassRefPtr<TimeRanges> seekable() const override;
</del><ins>+ virtual std::unique_ptr<PlatformTimeRanges> seekable() const override;
</ins><span class="cx"> virtual double maxTimeSeekableDouble() const override;
</span><span class="cx"> virtual double minTimeSeekable() const override;
</span><del>- virtual PassRefPtr<TimeRanges> buffered() const override;
</del><ins>+ virtual std::unique_ptr<PlatformTimeRanges> buffered() const override;
</ins><span class="cx">
</span><span class="cx"> virtual bool didLoadingProgress() const override;
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationobjcMediaPlayerPrivateMediaSourceAVFObjCmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm (164497 => 164498)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm        2014-02-21 21:56:14 UTC (rev 164497)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm        2014-02-21 22:04:06 UTC (rev 164498)
</span><span class="lines">@@ -388,9 +388,9 @@
</span><span class="cx"> return m_readyState;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-PassRefPtr<TimeRanges> MediaPlayerPrivateMediaSourceAVFObjC::seekable() const
</del><ins>+std::unique_ptr<PlatformTimeRanges> MediaPlayerPrivateMediaSourceAVFObjC::seekable() const
</ins><span class="cx"> {
</span><del>- return TimeRanges::create(minTimeSeekable(), maxTimeSeekableDouble());
</del><ins>+ return PlatformTimeRanges::create(minTimeSeekable(), maxTimeSeekableDouble());
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> double MediaPlayerPrivateMediaSourceAVFObjC::maxTimeSeekableDouble() const
</span><span class="lines">@@ -403,7 +403,7 @@
</span><span class="cx"> return startTimeDouble();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-PassRefPtr<TimeRanges> MediaPlayerPrivateMediaSourceAVFObjC::buffered() const
</del><ins>+std::unique_ptr<PlatformTimeRanges> MediaPlayerPrivateMediaSourceAVFObjC::buffered() const
</ins><span class="cx"> {
</span><span class="cx"> return m_mediaSource->buffered();
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsgstreamerMediaPlayerPrivateGStreamercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp (164497 => 164498)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp        2014-02-21 21:56:14 UTC (rev 164497)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp        2014-02-21 22:04:06 UTC (rev 164498)
</span><span class="lines">@@ -890,22 +890,22 @@
</span><span class="cx"> m_preservesPitch = preservesPitch;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-PassRefPtr<TimeRanges> MediaPlayerPrivateGStreamer::buffered() const
</del><ins>+std::unique_ptr<PlatformTimeRanges> MediaPlayerPrivateGStreamer::buffered() const
</ins><span class="cx"> {
</span><del>- RefPtr<TimeRanges> timeRanges = TimeRanges::create();
</del><ins>+ auto timeRanges = PlatformTimeRanges::create();
</ins><span class="cx"> if (m_errorOccured || isLiveStream())
</span><del>- return timeRanges.release();
</del><ins>+ return timeRanges;
</ins><span class="cx">
</span><span class="cx"> #if GST_CHECK_VERSION(0, 10, 31)
</span><span class="cx"> float mediaDuration(duration());
</span><span class="cx"> if (!mediaDuration || std::isinf(mediaDuration))
</span><del>- return timeRanges.release();
</del><ins>+ return timeRanges;
</ins><span class="cx">
</span><span class="cx"> GstQuery* query = gst_query_new_buffering(GST_FORMAT_PERCENT);
</span><span class="cx">
</span><span class="cx"> if (!gst_element_query(m_playBin.get(), query)) {
</span><span class="cx"> gst_query_unref(query);
</span><del>- return timeRanges.release();
</del><ins>+ return timeRanges;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> for (guint index = 0; index < gst_query_get_n_buffering_ranges(query); index++) {
</span><span class="lines">@@ -927,7 +927,7 @@
</span><span class="cx"> if (!m_errorOccured && !isLiveStream() && loaded > 0)
</span><span class="cx"> timeRanges->add(0, loaded);
</span><span class="cx"> #endif
</span><del>- return timeRanges.release();
</del><ins>+ return timeRanges;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> gboolean MediaPlayerPrivateGStreamer::handleMessage(GstMessage* message)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsgstreamerMediaPlayerPrivateGStreamerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h (164497 => 164498)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h        2014-02-21 21:56:14 UTC (rev 164497)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h        2014-02-21 22:04:06 UTC (rev 164498)
</span><span class="lines">@@ -81,7 +81,7 @@
</span><span class="cx"> void setPreload(MediaPlayer::Preload);
</span><span class="cx"> void fillTimerFired(Timer<MediaPlayerPrivateGStreamer>*);
</span><span class="cx">
</span><del>- PassRefPtr<TimeRanges> buffered() const;
</del><ins>+ std::unique_ptr<PlatformTimeRanges> buffered() const;
</ins><span class="cx"> float maxTimeSeekable() const;
</span><span class="cx"> bool didLoadingProgress() const;
</span><span class="cx"> unsigned totalBytes() const;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsiosMediaPlayerPrivateIOSh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/ios/MediaPlayerPrivateIOS.h (164497 => 164498)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ios/MediaPlayerPrivateIOS.h        2014-02-21 21:56:14 UTC (rev 164497)
+++ trunk/Source/WebCore/platform/graphics/ios/MediaPlayerPrivateIOS.h        2014-02-21 22:04:06 UTC (rev 164498)
</span><span class="lines">@@ -119,7 +119,7 @@
</span><span class="cx">
</span><span class="cx"> float maxTimeBuffered() const;
</span><span class="cx"> virtual float maxTimeSeekable() const override;
</span><del>- virtual PassRefPtr<TimeRanges> buffered() const override;
</del><ins>+ virtual std::unique_ptr<PlatformTimeRanges> buffered() const override;
</ins><span class="cx">
</span><span class="cx"> virtual bool didLoadingProgress() const override;
</span><span class="cx"> bool totalBytesKnown() const;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsiosMediaPlayerPrivateIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/ios/MediaPlayerPrivateIOS.mm (164497 => 164498)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ios/MediaPlayerPrivateIOS.mm        2014-02-21 21:56:14 UTC (rev 164497)
+++ trunk/Source/WebCore/platform/graphics/ios/MediaPlayerPrivateIOS.mm        2014-02-21 22:04:06 UTC (rev 164498)
</span><span class="lines">@@ -497,16 +497,16 @@
</span><span class="cx"> return [m_mediaPlayerHelper.get() _maxTimeSeekable];
</span><span class="cx"> }
</span><span class="cx">
</span><del>-PassRefPtr<TimeRanges> MediaPlayerPrivateIOS::buffered() const
</del><ins>+std::unique_ptr<PlatformTimeRanges> MediaPlayerPrivateIOS::buffered()
</ins><span class="cx"> {
</span><del>- RefPtr<TimeRanges> timeRanges = TimeRanges::create();
</del><ins>+ auto timeRanges = PlatformTimeRanges::create();
</ins><span class="cx">
</span><span class="cx"> if (!m_mediaPlayerHelper)
</span><del>- return timeRanges.release();
</del><ins>+ return timeRanges;
</ins><span class="cx">
</span><span class="cx"> NSArray *ranges = [m_mediaPlayerHelper.get() _bufferedTimeRanges];
</span><span class="cx"> if (!ranges)
</span><del>- return timeRanges.release();
</del><ins>+ return timeRanges;
</ins><span class="cx">
</span><span class="cx"> float timeRange[2];
</span><span class="cx"> int count = [ranges count];
</span><span class="lines">@@ -517,7 +517,7 @@
</span><span class="cx"> timeRanges->add(timeRange[0], timeRange[1]);
</span><span class="cx"> }
</span><span class="cx">
</span><del>- return timeRanges.release();
</del><ins>+ return timeRanges;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void MediaPlayerPrivateIOS::setSize(const IntSize&)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsmacMediaPlayerPrivateQTKith"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.h (164497 => 164498)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.h        2014-02-21 21:56:14 UTC (rev 164497)
+++ trunk/Source/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.h        2014-02-21 22:04:06 UTC (rev 164498)
</span><span class="lines">@@ -120,7 +120,7 @@
</span><span class="cx"> MediaPlayer::NetworkState networkState() const { return m_networkState; }
</span><span class="cx"> MediaPlayer::ReadyState readyState() const { return m_readyState; }
</span><span class="cx">
</span><del>- PassRefPtr<TimeRanges> buffered() const;
</del><ins>+ std::unique_ptr<PlatformTimeRanges> buffered() const;
</ins><span class="cx"> float maxTimeSeekable() const;
</span><span class="cx"> bool didLoadingProgress() const;
</span><span class="cx"> unsigned totalBytes() const;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsmacMediaPlayerPrivateQTKitmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.mm (164497 => 164498)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.mm        2014-02-21 21:56:14 UTC (rev 164497)
+++ trunk/Source/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.mm        2014-02-21 22:04:06 UTC (rev 164498)
</span><span class="lines">@@ -39,9 +39,9 @@
</span><span class="cx"> #import "Logging.h"
</span><span class="cx"> #import "MIMETypeRegistry.h"
</span><span class="cx"> #import "PlatformLayer.h"
</span><ins>+#import "PlatformTimeRanges.h"
</ins><span class="cx"> #import "SecurityOrigin.h"
</span><span class="cx"> #import "SoftLinking.h"
</span><del>-#import "TimeRanges.h"
</del><span class="cx"> #import "WebCoreSystemInterface.h"
</span><span class="cx"> #import <QTKit/QTKit.h>
</span><span class="cx"> #import <objc/runtime.h>
</span><span class="lines">@@ -917,13 +917,13 @@
</span><span class="cx"> createQTMovie([movieAttributes.get() valueForKey:QTMovieURLAttribute], movieAttributes.get());
</span><span class="cx"> }
</span><span class="cx">
</span><del>-PassRefPtr<TimeRanges> MediaPlayerPrivateQTKit::buffered() const
</del><ins>+std::unique_ptr<PlatformTimeRanges> MediaPlayerPrivateQTKit::buffered() const
</ins><span class="cx"> {
</span><del>- RefPtr<TimeRanges> timeRanges = TimeRanges::create();
</del><ins>+ auto timeRanges = PlatformTimeRanges::create();
</ins><span class="cx"> float loaded = maxTimeLoaded();
</span><span class="cx"> if (loaded > 0)
</span><span class="cx"> timeRanges->add(0, loaded);
</span><del>- return timeRanges.release();
</del><ins>+ return timeRanges;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> float MediaPlayerPrivateQTKit::maxTimeSeekable() const
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicswinMediaPlayerPrivateQuickTimeVisualContextcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.cpp (164497 => 164498)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.cpp        2014-02-21 21:56:14 UTC (rev 164497)
+++ trunk/Source/WebCore/platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.cpp        2014-02-21 22:04:06 UTC (rev 164498)
</span><span class="lines">@@ -547,14 +547,15 @@
</span><span class="cx"> m_movie->setClosedCaptionsVisible(visible);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-PassRefPtr<TimeRanges> MediaPlayerPrivateQuickTimeVisualContext::buffered() const
</del><ins>+std::unique_ptr<PlatformTimeRanges> MediaPlayerPrivateQuickTimeVisualContext::buffered() const
</ins><span class="cx"> {
</span><del>- RefPtr<TimeRanges> timeRanges = TimeRanges::create();
</del><ins>+ auto timeRanges = PlatformTimeRanges::create();
+
</ins><span class="cx"> float loaded = maxTimeLoaded();
</span><span class="cx"> // rtsp streams are not buffered
</span><span class="cx"> if (!m_isStreaming && loaded > 0)
</span><span class="cx"> timeRanges->add(0, loaded);
</span><del>- return timeRanges.release();
</del><ins>+ return timeRanges;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> float MediaPlayerPrivateQuickTimeVisualContext::maxTimeSeekable() const
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicswinMediaPlayerPrivateQuickTimeVisualContexth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.h (164497 => 164498)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.h        2014-02-21 21:56:14 UTC (rev 164497)
+++ trunk/Source/WebCore/platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.h        2014-02-21 22:04:06 UTC (rev 164498)
</span><span class="lines">@@ -92,7 +92,7 @@
</span><span class="cx"> MediaPlayer::NetworkState networkState() const { return m_networkState; }
</span><span class="cx"> MediaPlayer::ReadyState readyState() const { return m_readyState; }
</span><span class="cx">
</span><del>- PassRefPtr<TimeRanges> buffered() const;
</del><ins>+ std::unique_ptr<PlatformTimeRanges> buffered() const;
</ins><span class="cx"> float maxTimeSeekable() const;
</span><span class="cx"> bool didLoadingProgress() const;
</span><span class="cx"> unsigned totalBytes() const;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicswinceMediaPlayerPrivateWinCEh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/wince/MediaPlayerPrivateWinCE.h (164497 => 164498)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/wince/MediaPlayerPrivateWinCE.h        2014-02-21 21:56:14 UTC (rev 164497)
+++ trunk/Source/WebCore/platform/graphics/wince/MediaPlayerPrivateWinCE.h        2014-02-21 22:04:06 UTC (rev 164498)
</span><span class="lines">@@ -68,7 +68,7 @@
</span><span class="cx"> MediaPlayer::NetworkState networkState() const { return m_networkState; }
</span><span class="cx"> MediaPlayer::ReadyState readyState() const { return m_readyState; }
</span><span class="cx">
</span><del>- PassRefPtr<TimeRanges> buffered() const;
</del><ins>+ std::unique_ptr<PlatformTimeRanges> buffered() const;
</ins><span class="cx"> float maxTimeSeekable() const;
</span><span class="cx"> // FIXME: bytesLoaded() should be replaced with didLoadingProgress() (by somebody who can find the implementation of this class).
</span><span class="cx"> unsigned bytesLoaded() const;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmockmediasourceMockMediaPlayerMediaSourcecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mock/mediasource/MockMediaPlayerMediaSource.cpp (164497 => 164498)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mock/mediasource/MockMediaPlayerMediaSource.cpp        2014-02-21 21:56:14 UTC (rev 164497)
+++ trunk/Source/WebCore/platform/mock/mediasource/MockMediaPlayerMediaSource.cpp        2014-02-21 22:04:06 UTC (rev 164498)
</span><span class="lines">@@ -166,9 +166,12 @@
</span><span class="cx"> return m_duration;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-PassRefPtr<TimeRanges> MockMediaPlayerMediaSource::buffered() const
</del><ins>+std::unique_ptr<PlatformTimeRanges> MockMediaPlayerMediaSource::buffered() const
</ins><span class="cx"> {
</span><del>- return m_mediaSource ? m_mediaSource->buffered() : TimeRanges::create();
</del><ins>+ if (m_mediaSource)
+ return m_mediaSource->buffered();
+
+ return PlatformTimeRanges::create();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> bool MockMediaPlayerMediaSource::didLoadingProgress() const
</span><span class="lines">@@ -209,12 +212,16 @@
</span><span class="cx">
</span><span class="cx"> void MockMediaPlayerMediaSource::advanceCurrentTime()
</span><span class="cx"> {
</span><del>- RefPtr<TimeRanges> buffered = this->buffered();
</del><ins>+ if (!m_mediaSource)
+ return;
+
+ auto buffered = m_mediaSource->buffered();
</ins><span class="cx"> size_t pos = buffered->find(m_currentTime.toDouble());
</span><span class="cx"> if (pos == notFound)
</span><span class="cx"> return;
</span><span class="cx">
</span><del>- m_currentTime = MediaTime::createWithDouble(std::min(m_duration, buffered->end(pos, IGNORE_EXCEPTION)));
</del><ins>+ bool ignoreError;
+ m_currentTime = MediaTime::createWithDouble(std::min(m_duration, buffered->end(pos, ignoreError)));
</ins><span class="cx"> m_player->timeChanged();
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmockmediasourceMockMediaPlayerMediaSourceh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mock/mediasource/MockMediaPlayerMediaSource.h (164497 => 164498)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mock/mediasource/MockMediaPlayerMediaSource.h        2014-02-21 21:56:14 UTC (rev 164497)
+++ trunk/Source/WebCore/platform/mock/mediasource/MockMediaPlayerMediaSource.h        2014-02-21 22:04:06 UTC (rev 164498)
</span><span class="lines">@@ -70,7 +70,7 @@
</span><span class="cx"> virtual bool paused() const override;
</span><span class="cx"> virtual MediaPlayer::NetworkState networkState() const override;
</span><span class="cx"> virtual double maxTimeSeekableDouble() const override;
</span><del>- virtual PassRefPtr<TimeRanges> buffered() const override;
</del><ins>+ virtual std::unique_ptr<PlatformTimeRanges> buffered() const override;
</ins><span class="cx"> virtual bool didLoadingProgress() const override;
</span><span class="cx"> virtual void setSize(const IntSize&) override;
</span><span class="cx"> virtual void paint(GraphicsContext*, const IntRect&) override;
</span></span></pre></div>
<a id="trunkSourceWebKitChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/ChangeLog (164497 => 164498)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/ChangeLog        2014-02-21 21:56:14 UTC (rev 164497)
+++ trunk/Source/WebKit/ChangeLog        2014-02-21 22:04:06 UTC (rev 164498)
</span><span class="lines">@@ -1,3 +1,12 @@
</span><ins>+2014-02-21 Eric Carlson <eric.carlson@apple.com>
+
+ Fix TimeRanges layering violations
+ https://bugs.webkit.org/show_bug.cgi?id=128717
+
+ Reviewed by Jer Noble.
+
+ * WebKit.vcxproj/WebKitExportGenerator/WebKitExports.def.in: TimeRanges::create(void) for Internals.
+
</ins><span class="cx"> 2014-02-20 Enrique Ocaña González <eocanha@igalia.com>
</span><span class="cx">
</span><span class="cx"> WebKitGTK+ should stop using COMPILE_ASSERT_MATCHING_ENUM macros
</span></span></pre></div>
<a id="trunkSourceWebKitWebKitvcxprojWebKitExportGeneratorWebKitExportsdefin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebKit.vcxproj/WebKitExportGenerator/WebKitExports.def.in (164497 => 164498)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebKit.vcxproj/WebKitExportGenerator/WebKitExports.def.in        2014-02-21 21:56:14 UTC (rev 164497)
+++ trunk/Source/WebKit/WebKit.vcxproj/WebKitExportGenerator/WebKitExports.def.in        2014-02-21 22:04:06 UTC (rev 164498)
</span><span class="lines">@@ -452,6 +452,7 @@
</span><span class="cx"> symbolWithPointer(?toJS@WebCore@@YA?AVJSValue@JSC@@PAVExecState@3@PAVJSDOMGlobalObject@1@PAVTimeRanges@1@@Z, ?toJS@WebCore@@YA?AVJSValue@JSC@@PEAVExecState@3@PEAVJSDOMGlobalObject@1@PEAVTimeRanges@1@@Z)
</span><span class="cx"> symbolWithPointer(?nearest@TimeRanges@WebCore@@QBENN@Z, ?nearest@TimeRanges@WebCore@@QEBANN@Z)
</span><span class="cx"> symbolWithPointer(?add@TimeRanges@WebCore@@QAEXNN@Z, ?add@TimeRanges@WebCore@@QEAAXNN@Z)
</span><ins>+ symbolWithPointer(?create@TimeRanges@WebCore@@SA?AV?$PassRefPtr@VTimeRanges@WebCore@@@WTF@@XZ, ?create@TimeRanges@WebCore@@SA?AV?$PassRefPtr@VTimeRanges@WebCore@@@WTF@@XZ)
</ins><span class="cx"> #if USE(GSTREAMER)
</span><span class="cx"> symbolWithPointer(?simulateAudioInterruption@MediaPlayer@WebCore@@QAEXXZ, ?simulateAudioInterruption@MediaPlayer@WebCore@@QEAAXXZ)
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (164497 => 164498)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog        2014-02-21 21:56:14 UTC (rev 164497)
+++ trunk/Tools/ChangeLog        2014-02-21 22:04:06 UTC (rev 164498)
</span><span class="lines">@@ -1,3 +1,13 @@
</span><ins>+2014-02-21 Eric Carlson <eric.carlson@apple.com>
+
+ Fix TimeRanges layering violations
+ https://bugs.webkit.org/show_bug.cgi?id=128717
+
+ Reviewed by Jer Noble.
+
+ * TestWebKitAPI/Tests/WebCore/TimeRanges.cpp: TimeRanges* -> TimeRanges&.
+ (TestWebKitAPI::TEST):
+
</ins><span class="cx"> 2014-02-21 Diego Pino García <dpino@igalia.com>
</span><span class="cx">
</span><span class="cx"> Web Inspector: update check-webkit-style to flag single quotes in WebInspectorUI projects
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPITestsWebCoreTimeRangescpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/Tests/WebCore/TimeRanges.cpp (164497 => 164498)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/Tests/WebCore/TimeRanges.cpp        2014-02-21 21:56:14 UTC (rev 164497)
+++ trunk/Tools/TestWebKitAPI/Tests/WebCore/TimeRanges.cpp        2014-02-21 22:04:06 UTC (rev 164498)
</span><span class="lines">@@ -115,7 +115,7 @@
</span><span class="cx">
</span><span class="cx"> ASSERT_RANGE("{ [0,2) }", ranges);
</span><span class="cx">
</span><del>- ranges->intersectWith(ranges.get());
</del><ins>+ ranges->intersectWith(*ranges.get());
</ins><span class="cx">
</span><span class="cx"> ASSERT_RANGE("{ [0,2) }", ranges);
</span><span class="cx"> }
</span><span class="lines">@@ -128,7 +128,7 @@
</span><span class="cx"> ASSERT_RANGE("{ [0,2) }", rangesA);
</span><span class="cx"> ASSERT_RANGE("{ [0,2) }", rangesB);
</span><span class="cx">
</span><del>- rangesA->intersectWith(rangesB.get());
</del><ins>+ rangesA->intersectWith(*rangesB.get());
</ins><span class="cx">
</span><span class="cx"> ASSERT_RANGE("{ [0,2) }", rangesA);
</span><span class="cx"> ASSERT_RANGE("{ [0,2) }", rangesB);
</span><span class="lines">@@ -142,7 +142,7 @@
</span><span class="cx"> ASSERT_RANGE("{ [0,2) }", rangesA);
</span><span class="cx"> ASSERT_RANGE("{ }", rangesB);
</span><span class="cx">
</span><del>- rangesA->intersectWith(rangesB.get());
</del><ins>+ rangesA->intersectWith(*rangesB.get());
</ins><span class="cx">
</span><span class="cx"> ASSERT_RANGE("{ }", rangesA);
</span><span class="cx"> ASSERT_RANGE("{ }", rangesB);
</span><span class="lines">@@ -150,6 +150,7 @@
</span><span class="cx">
</span><span class="cx"> TEST(TimeRanges, IntersectWith_DisjointRanges1)
</span><span class="cx"> {
</span><ins>+
</ins><span class="cx"> RefPtr<TimeRanges> rangesA = TimeRanges::create();
</span><span class="cx"> RefPtr<TimeRanges> rangesB = TimeRanges::create();
</span><span class="cx">
</span><span class="lines">@@ -162,7 +163,7 @@
</span><span class="cx"> ASSERT_RANGE("{ [0,1) [4,5) }", rangesA);
</span><span class="cx"> ASSERT_RANGE("{ [2,3) [6,7) }", rangesB);
</span><span class="cx">
</span><del>- rangesA->intersectWith(rangesB.get());
</del><ins>+ rangesA->intersectWith(*rangesB.get());
</ins><span class="cx">
</span><span class="cx"> ASSERT_RANGE("{ }", rangesA);
</span><span class="cx"> ASSERT_RANGE("{ [2,3) [6,7) }", rangesB);
</span><span class="lines">@@ -182,7 +183,7 @@
</span><span class="cx"> ASSERT_RANGE("{ [0,1) [4,5) }", rangesA);
</span><span class="cx"> ASSERT_RANGE("{ [1,4) [5,7) }", rangesB);
</span><span class="cx">
</span><del>- rangesA->intersectWith(rangesB.get());
</del><ins>+ rangesA->intersectWith(*rangesB.get());
</ins><span class="cx">
</span><span class="cx"> ASSERT_RANGE("{ }", rangesA);
</span><span class="cx"> ASSERT_RANGE("{ [1,4) [5,7) }", rangesB);
</span><span class="lines">@@ -202,7 +203,7 @@
</span><span class="cx"> ASSERT_RANGE("{ [1,3) [4,5) [6,9) }", rangesA);
</span><span class="cx"> ASSERT_RANGE("{ [0,10) }", rangesB);
</span><span class="cx">
</span><del>- rangesA->intersectWith(rangesB.get());
</del><ins>+ rangesA->intersectWith(*rangesB.get());
</ins><span class="cx">
</span><span class="cx"> ASSERT_RANGE("{ [1,3) [4,5) [6,9) }", rangesA);
</span><span class="cx"> ASSERT_RANGE("{ [0,10) }", rangesB);
</span><span class="lines">@@ -222,7 +223,7 @@
</span><span class="cx"> ASSERT_RANGE("{ [1,3) [4,5) [6,9) }", rangesA);
</span><span class="cx"> ASSERT_RANGE("{ [1,9) }", rangesB);
</span><span class="cx">
</span><del>- rangesA->intersectWith(rangesB.get());
</del><ins>+ rangesA->intersectWith(*rangesB.get());
</ins><span class="cx">
</span><span class="cx"> ASSERT_RANGE("{ [1,3) [4,5) [6,9) }", rangesA);
</span><span class="cx"> ASSERT_RANGE("{ [1,9) }", rangesB);
</span><span class="lines">@@ -241,7 +242,7 @@
</span><span class="cx"> ASSERT_RANGE("{ [0,2) [4,6) }", rangesA);
</span><span class="cx"> ASSERT_RANGE("{ [1,5) }", rangesB);
</span><span class="cx">
</span><del>- rangesA->intersectWith(rangesB.get());
</del><ins>+ rangesA->intersectWith(*rangesB.get());
</ins><span class="cx">
</span><span class="cx"> ASSERT_RANGE("{ [1,2) [4,5) }", rangesA);
</span><span class="cx"> ASSERT_RANGE("{ [1,5) }", rangesB);
</span><span class="lines">@@ -261,7 +262,7 @@
</span><span class="cx"> ASSERT_RANGE("{ [0,2) [4,6) [8,10) }", rangesA);
</span><span class="cx"> ASSERT_RANGE("{ [1,9) }", rangesB);
</span><span class="cx">
</span><del>- rangesA->intersectWith(rangesB.get());
</del><ins>+ rangesA->intersectWith(*rangesB.get());
</ins><span class="cx">
</span><span class="cx"> ASSERT_RANGE("{ [1,2) [4,6) [8,9) }", rangesA);
</span><span class="cx"> ASSERT_RANGE("{ [1,9) }", rangesB);
</span><span class="lines">@@ -282,7 +283,7 @@
</span><span class="cx"> ASSERT_RANGE("{ [0,2) [4,7) [8,10) }", rangesA);
</span><span class="cx"> ASSERT_RANGE("{ [1,5) [6,9) }", rangesB);
</span><span class="cx">
</span><del>- rangesA->intersectWith(rangesB.get());
</del><ins>+ rangesA->intersectWith(*rangesB.get());
</ins><span class="cx">
</span><span class="cx"> ASSERT_RANGE("{ [1,2) [4,5) [6,7) [8,9) }", rangesA);
</span><span class="cx"> ASSERT_RANGE("{ [1,5) [6,9) }", rangesB);
</span></span></pre>
</div>
</div>
</body>
</html>