<!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 -&gt; PlatformTimeRanges.
* Modules/mediasource/MediaSource.h:

* Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample): TimeRanges* -&gt; TimeRanges&amp;.

* 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* -&gt; TimeRanges&amp;.
(MediaController::seekable): Ditto.
(MediaController::played): Ditto.

Move all of the logic into PlatformTimeRanges. Change API to take TimeRanges&amp; 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 -&gt; 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 -&gt; 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 -&gt; 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* -&gt; TimeRanges&amp;.
(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  &lt;eric.carlson@apple.com&gt;
+
+        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 -&gt; PlatformTimeRanges.
+        * Modules/mediasource/MediaSource.h:
+
+        * Modules/mediasource/SourceBuffer.cpp:
+        (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample): TimeRanges* -&gt; TimeRanges&amp;.
+
+        * 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* -&gt; TimeRanges&amp;.
+        (MediaController::seekable): Ditto.
+        (MediaController::played): Ditto.
+
+        Move all of the logic into PlatformTimeRanges. Change API to take TimeRanges&amp; 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 -&gt; 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 -&gt; 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 -&gt; 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  &lt;enrica@apple.com&gt;
</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&lt;float&gt;::quiet_NaN() : m_private-&gt;duration();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-PassRefPtr&lt;TimeRanges&gt; MediaSource::buffered() const
</del><ins>+std::unique_ptr&lt;PlatformTimeRanges&gt; 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 &lt; 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&lt;TimeRanges&gt; 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-&gt;intersectWith(sourceRanges);
</del><ins>+        intersectionRanges-&gt;intersectWith(*sourceRanges);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><del>-    return intersectionRanges.release();
</del><ins>+    return PlatformTimeRanges::create(intersectionRanges-&gt;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&lt;MediaSourcePrivate&gt;) override;
</span><span class="cx">     virtual double duration() const override;
</span><del>-    virtual PassRefPtr&lt;TimeRanges&gt; buffered() const override;
</del><ins>+    virtual std::unique_ptr&lt;PlatformTimeRanges&gt; 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-&gt;invert();
</span><del>-            m_buffered-&gt;intersectWith(erasedRanges.get());
</del><ins>+            m_buffered-&gt;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">     &lt;ClCompile Include=&quot;..\platform\graphics\Path.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\platform\graphics\PathTraversalState.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\platform\graphics\Pattern.cpp&quot; /&gt;
</span><ins>+    &lt;ClCompile Include=&quot;..\platform\graphics\PlatformTimeRanges.cpp&quot; /&gt;
</ins><span class="cx">     &lt;ClCompile Include=&quot;..\platform\graphics\Region.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\platform\graphics\RoundedRect.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\platform\graphics\SegmentedFontData.cpp&quot; /&gt;
</span><span class="lines">@@ -19111,6 +19112,7 @@
</span><span class="cx">     &lt;ClInclude Include=&quot;..\platform\graphics\PathTraversalState.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\platform\graphics\Pattern.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\platform\graphics\PlatformLayer.h&quot; /&gt;
</span><ins>+    &lt;ClInclude Include=&quot;..\platform\graphics\PlatformTimeRanges.h&quot; /&gt;
</ins><span class="cx">     &lt;ClInclude Include=&quot;..\platform\graphics\Region.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\platform\graphics\RoundedRect.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\platform\graphics\SegmentedFontData.h&quot; /&gt;
</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">     &lt;ClCompile Include=&quot;..\platform\graphics\Region.cpp&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;platform\graphics&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClCompile&gt;
</span><ins>+    &lt;ClCompile Include=&quot;..\platform\graphics\PlatformTimeRanges.cpp&quot;&gt;
+      &lt;Filter&gt;platform\graphics&lt;/Filter&gt;
+    &lt;/ClCompile&gt;
</ins><span class="cx">     &lt;ClCompile Include=&quot;..\platform\graphics\RoundedRect.cpp&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;platform\graphics&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClCompile&gt;
</span><span class="lines">@@ -8324,6 +8327,9 @@
</span><span class="cx">     &lt;ClInclude Include=&quot;..\platform\graphics\PlatformLayer.h&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;platform\graphics&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClInclude&gt;
</span><ins>+    &lt;ClInclude Include=&quot;..\platform\graphics\PlatformTimeRanges.h&quot;&gt;
+      &lt;Filter&gt;platform\graphics&lt;/Filter&gt;
+    &lt;/ClInclude&gt;
</ins><span class="cx">     &lt;ClInclude Include=&quot;..\platform\graphics\Region.h&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;platform\graphics&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClInclude&gt;
</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 = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 074300A30F4B8BCF008076CD /* MediaPlayerPrivateIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MediaPlayerPrivateIOS.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 074300A40F4B8BCF008076CD /* MediaPlayerPrivateIOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaPlayerPrivateIOS.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                074E82B818A69F0E007EF54C /* PlatformTimeRanges.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PlatformTimeRanges.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                074E82B918A69F0E007EF54C /* PlatformTimeRanges.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlatformTimeRanges.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 0753860014489E9800B78452 /* CachedTextTrack.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CachedTextTrack.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 0753860114489E9800B78452 /* CachedTextTrack.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CachedTextTrack.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 076306CC17E1478D005A7C4E /* MediaStreamTrackSourcesCallback.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaStreamTrackSourcesCallback.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</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&lt;TimeRanges&gt; timeRanges = m_player-&gt;buffered();
</del><ins>+    bool ignored;
+    std::unique_ptr&lt;PlatformTimeRanges&gt; timeRanges = m_player-&gt;buffered();
</ins><span class="cx">     for (unsigned i = 0; i &lt; timeRanges-&gt;length(); ++i) {
</span><del>-        double start = timeRanges-&gt;start(i, IGNORE_EXCEPTION);
-        double end = timeRanges-&gt;end(i, IGNORE_EXCEPTION);
</del><ins>+        double start = timeRanges-&gt;start(i, ignored);
+        double end = timeRanges-&gt;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-&gt;buffered();
</del><ins>+        return TimeRanges::create(*m_mediaSource-&gt;buffered());
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-    return m_player-&gt;buffered();
</del><ins>+    return TimeRanges::create(*m_player-&gt;buffered());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> PassRefPtr&lt;TimeRanges&gt; HTMLMediaElement::played()
</span><span class="lines">@@ -4134,7 +4135,10 @@
</span><span class="cx"> 
</span><span class="cx"> PassRefPtr&lt;TimeRanges&gt; HTMLMediaElement::seekable() const
</span><span class="cx"> {
</span><del>-    return m_player ? m_player-&gt;seekable() : TimeRanges::create();
</del><ins>+    if (m_player)
+        return TimeRanges::create(*m_player-&gt;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&lt;TimeRanges&gt; bufferedRanges = m_mediaElements.first()-&gt;buffered();
</span><span class="cx">     for (size_t index = 1; index &lt; m_mediaElements.size(); ++index)
</span><del>-        bufferedRanges-&gt;intersectWith(m_mediaElements[index]-&gt;buffered().get());
</del><ins>+        bufferedRanges-&gt;intersectWith(*m_mediaElements[index]-&gt;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&lt;TimeRanges&gt; seekableRanges = m_mediaElements.first()-&gt;seekable();
</span><span class="cx">     for (size_t index = 1; index &lt; m_mediaElements.size(); ++index)
</span><del>-        seekableRanges-&gt;intersectWith(m_mediaElements[index]-&gt;seekable().get());
</del><ins>+        seekableRanges-&gt;intersectWith(*m_mediaElements[index]-&gt;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&lt;TimeRanges&gt; playedRanges = m_mediaElements.first()-&gt;played();
</span><span class="cx">     for (size_t index = 1; index &lt; m_mediaElements.size(); ++index)
</span><del>-        playedRanges-&gt;unionWith(m_mediaElements[index]-&gt;played().get());
</del><ins>+        playedRanges-&gt;unionWith(*m_mediaElements[index]-&gt;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 &quot;ExceptionCode.h&quot;
</span><span class="cx"> #include &quot;ExceptionCodePlaceholder.h&quot;
</span><del>-#include &lt;math.h&gt;
</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&lt;TimeRanges&gt; 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&lt;TimeRanges&gt; TimeRanges::copy() const
</del><ins>+PassRefPtr&lt;TimeRanges&gt; TimeRanges::create(double start, double end)
</ins><span class="cx"> {
</span><del>-    RefPtr&lt;TimeRanges&gt; newSession = TimeRanges::create();
-    
-    unsigned size = m_ranges.size();
-    for (unsigned i = 0; i &lt; size; i++)
-        newSession-&gt;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&lt;TimeRanges&gt; TimeRanges::create(const PlatformTimeRanges&amp; other)
</ins><span class="cx"> {
</span><del>-    RefPtr&lt;TimeRanges&gt; inverted = TimeRanges::create();
-    double posInf = std::numeric_limits&lt;double&gt;::infinity();
-    double negInf = -std::numeric_limits&lt;double&gt;::infinity();
-
-    if (!m_ranges.size())
-        inverted-&gt;add(negInf, posInf);
-    else {
-        double start = m_ranges.first().m_start;
-        if (start != negInf)
-            inverted-&gt;add(negInf, start);
-
-        for (size_t index = 0; index + 1 &lt; m_ranges.size(); ++index)
-            inverted-&gt;add(m_ranges[index].m_end, m_ranges[index + 1].m_start);
-
-        double end = m_ranges.last().m_end;
-        if (end != posInf)
-            inverted-&gt;add(end, posInf);
-    }
-
-    m_ranges.swap(inverted-&gt;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&lt;TimeRanges&gt; invertedOther = other-&gt;copy();
-    invertedOther-&gt;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&lt;TimeRanges&gt; unioned = copy();
-    for (size_t index = 0; index &lt; other-&gt;m_ranges.size(); ++index) {
-        const Range&amp; range = other-&gt;m_ranges[index];
-        unioned-&gt;add(range.m_start, range.m_end);
-    }
</del><ins>+}
</ins><span class="cx"> 
</span><del>-    m_ranges.swap(unioned-&gt;m_ranges);
</del><ins>+TimeRanges::TimeRanges(const PlatformTimeRanges&amp; other)
+    : m_ranges(other)
+{
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-double TimeRanges::start(unsigned index, ExceptionCode&amp; ec) const 
-{ 
-    if (index &gt;= length()) {
</del><ins>+double TimeRanges::start(unsigned index, ExceptionCode&amp; 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&amp; ec) const 
</span><span class="cx"> { 
</span><del>-    if (index &gt;= 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 &lt;= 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&lt;TimeRanges&gt; TimeRanges::copy() const
+{
+    return TimeRanges::create(m_ranges);
+}
</ins><span class="cx"> 
</span><del>-    for (overlappingArcIndex = 0; overlappingArcIndex &lt; 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)
-                 &amp;&amp; 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&amp; 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&amp; 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 &lt; length(); n++) {
-        if (time &gt;= start(n, IGNORE_EXCEPTION) &amp;&amp; time &lt;= 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&lt;double&gt;::infinity();
-    double closestTime = 0;
-    unsigned count = length();
-    for (unsigned ndx = 0; ndx &lt; count; ndx++) {
-        double startTime = start(ndx, IGNORE_EXCEPTION);
-        double endTime = end(ndx, IGNORE_EXCEPTION);
-        if (time &gt;= startTime &amp;&amp; time &lt;= endTime)
-            return time;
-        if (fabs(startTime - time) &lt; closestDelta) {
-            closestTime = startTime;
-            closestDelta = fabsf(startTime - time);
-        }
-        if (fabs(endTime - time) &lt; 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 &lt; 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 &quot;PlatformTimeRanges.h&quot;
</ins><span class="cx"> #include &lt;algorithm&gt;
</span><span class="cx"> #include &lt;wtf/PassRefPtr.h&gt;
</span><span class="cx"> #include &lt;wtf/RefCounted.h&gt;
</span><span class="lines">@@ -37,82 +38,36 @@
</span><span class="cx"> 
</span><span class="cx"> class TimeRanges : public RefCounted&lt;TimeRanges&gt; {
</span><span class="cx"> public:
</span><del>-    static PassRefPtr&lt;TimeRanges&gt; create() 
-    {
-        return adoptRef(new TimeRanges);
-    }
-    static PassRefPtr&lt;TimeRanges&gt; create(double start, double end)
-    {
-        return adoptRef(new TimeRanges(start, end));
-    }
</del><ins>+    static PassRefPtr&lt;TimeRanges&gt; create();
+    static PassRefPtr&lt;TimeRanges&gt; create(double start, double end);
+    static PassRefPtr&lt;TimeRanges&gt; create(const PlatformTimeRanges&amp;);
</ins><span class="cx"> 
</span><del>-    PassRefPtr&lt;TimeRanges&gt; 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&amp;) const;
</span><span class="cx">     double end(unsigned index, ExceptionCode&amp;) const;
</span><span class="cx"> 
</span><del>-    void add(double start, double end);
</del><ins>+    PassRefPtr&lt;TimeRanges&gt; copy() const;
+    void invert();
+    void intersectWith(const TimeRanges&amp;);
+    void unionWith(const TimeRanges&amp;);
</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&amp; 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&amp;);
</del><ins>+    TimeRanges(const PlatformTimeRanges&amp;);
</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 &lt;= point &amp;&amp; point &lt; m_end;
-        }
-        
-        inline bool isOverlappingRange(const Range&amp; range) const
-        {
-            return isPointInRange(range.m_start) || isPointInRange(range.m_end) || range.isPointInRange(m_start);
-        }
-
-        inline bool isContiguousWithRange(const Range&amp; range) const
-        {
-            return range.m_start == m_end || range.m_end == m_start;
-        }
-        
-        inline Range unionWithOverlappingOrContiguousRange(const Range&amp; 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&amp; range) const
-        {
-            return range.m_start &gt;= m_end;
-        }
-    };
-    
-    Vector&lt;Range&gt; 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 &quot;Logging.h&quot;
</span><span class="cx"> #include &quot;MIMETypeRegistry.h&quot;
</span><span class="cx"> #include &quot;MediaPlayerPrivate.h&quot;
</span><ins>+#include &quot;PlatformTimeRanges.h&quot;
</ins><span class="cx"> #include &quot;Settings.h&quot;
</span><del>-#include &quot;TimeRanges.h&quot;
</del><span class="cx"> #include &lt;wtf/text/CString.h&gt;
</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&lt;TimeRanges&gt; buffered() const { return TimeRanges::create(); }
</del><ins>+    virtual std::unique_ptr&lt;PlatformTimeRanges&gt; 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-&gt;setPreservesPitch(preservesPitch);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-PassRefPtr&lt;TimeRanges&gt; MediaPlayer::buffered()
</del><ins>+std::unique_ptr&lt;PlatformTimeRanges&gt; MediaPlayer::buffered()
</ins><span class="cx"> {
</span><span class="cx">     return m_private-&gt;buffered();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-PassRefPtr&lt;TimeRanges&gt; MediaPlayer::seekable()
</del><ins>+std::unique_ptr&lt;PlatformTimeRanges&gt; MediaPlayer::seekable()
</ins><span class="cx"> {
</span><span class="cx">     return m_private-&gt;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) &amp;&amp; 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&lt;TimeRanges&gt; buffered();
-    PassRefPtr&lt;TimeRanges&gt; seekable();
</del><ins>+    std::unique_ptr&lt;PlatformTimeRanges&gt; buffered();
+    std::unique_ptr&lt;PlatformTimeRanges&gt; 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 &quot;MediaPlayer.h&quot;
</span><del>-#include &quot;TimeRanges.h&quot;
</del><ins>+#include &quot;PlatformTimeRanges.h&quot;
</ins><span class="cx"> #include &lt;wtf/Forward.h&gt;
</span><ins>+#include &lt;wtf/OwnPtr.h&gt;
</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&lt;TimeRanges&gt; seekable() const { return maxTimeSeekableDouble() ? TimeRanges::create(minTimeSeekable(), maxTimeSeekableDouble()) : TimeRanges::create(); }
</del><ins>+    virtual std::unique_ptr&lt;PlatformTimeRanges&gt; 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&lt;TimeRanges&gt; buffered() const = 0;
</del><ins>+    virtual std::unique_ptr&lt;PlatformTimeRanges&gt; 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 &quot;TimeRanges.h&quot;
</del><ins>+#include &quot;PlatformTimeRanges.h&quot;
</ins><span class="cx"> #include &lt;wtf/RefCounted.h&gt;
</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&lt;MediaSourcePrivate&gt;) = 0;
</span><span class="cx">     virtual double duration() const = 0;
</span><del>-    virtual PassRefPtr&lt;TimeRanges&gt; buffered() const = 0;
</del><ins>+    virtual std::unique_ptr&lt;PlatformTimeRanges&gt; 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 &quot;config.h&quot;
+#include &quot;PlatformTimeRanges.h&quot;
+
+#include &lt;math.h&gt;
+
+namespace WebCore {
+
+std::unique_ptr&lt;PlatformTimeRanges&gt; PlatformTimeRanges::create()
+{
+    return std::make_unique&lt;PlatformTimeRanges&gt;();
+}
+
+std::unique_ptr&lt;PlatformTimeRanges&gt; PlatformTimeRanges::create(double start, double end)
+{
+    return std::make_unique&lt;PlatformTimeRanges&gt;(start, end);
+}
+
+std::unique_ptr&lt;PlatformTimeRanges&gt; PlatformTimeRanges::create(const PlatformTimeRanges&amp; other)
+{
+    return std::make_unique&lt;PlatformTimeRanges&gt;(other);
+}
+    
+PlatformTimeRanges::PlatformTimeRanges(double start, double end)
+{
+    add(start, end);
+}
+
+PlatformTimeRanges::PlatformTimeRanges(const PlatformTimeRanges&amp; other)
+{
+    copy(other);
+}
+
+PlatformTimeRanges&amp; PlatformTimeRanges::operator=(const PlatformTimeRanges&amp; other)
+{
+    return copy(other);
+}
+
+PlatformTimeRanges&amp; PlatformTimeRanges::copy(const PlatformTimeRanges&amp; other)
+{
+    unsigned size = other.m_ranges.size();
+    for (unsigned i = 0; i &lt; 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&lt;double&gt;::infinity();
+    double negInf = -std::numeric_limits&lt;double&gt;::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 &lt; 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&amp; other)
+{
+    PlatformTimeRanges invertedOther(other);
+
+    invertedOther.invert();
+    invert();
+    unionWith(invertedOther);
+    invert();
+}
+
+void PlatformTimeRanges::unionWith(const PlatformTimeRanges&amp; other)
+{
+    PlatformTimeRanges unioned(*this);
+
+    for (size_t index = 0; index &lt; other.m_ranges.size(); ++index) {
+        const Range&amp; 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&amp; valid) const
+{ 
+    if (index &gt;= length()) {
+        valid = false;
+        return 0;
+    }
+    
+    valid = true;
+    return m_ranges[index].m_start;
+}
+
+double PlatformTimeRanges::end(unsigned index, bool&amp; valid) const
+{ 
+    if (index &gt;= length()) {
+        valid = false;
+        return 0;
+    }
+
+    valid = true;
+    return m_ranges[index].m_end;
+}
+
+void PlatformTimeRanges::add(double start, double end)
+{
+    ASSERT(start &lt;= 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 &lt; 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) &amp;&amp; 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 &lt; length(); n++) {
+        if (time &gt;= start(n, ignoreInvalid) &amp;&amp; time &lt;= end(n, ignoreInvalid))
+            return n;
+    }
+    return notFound;
+}
+
+double PlatformTimeRanges::nearest(double time) const
+{
+    double closestDelta = std::numeric_limits&lt;double&gt;::infinity();
+    double closestTime = 0;
+    unsigned count = length();
+    bool ignoreInvalid;
+
+    for (unsigned ndx = 0; ndx &lt; count; ndx++) {
+        double startTime = start(ndx, ignoreInvalid);
+        double endTime = end(ndx, ignoreInvalid);
+        if (time &gt;= startTime &amp;&amp; time &lt;= endTime)
+            return time;
+        if (fabs(startTime - time) &lt; closestDelta) {
+            closestTime = startTime;
+            closestDelta = fabsf(startTime - time);
+        }
+        if (fabs(endTime - time) &lt; closestDelta) {
+            closestTime = endTime;
+            closestDelta = fabsf(endTime - time);
+        }
+    }
+    return closestTime;
+}
+
+double PlatformTimeRanges::totalDuration() const
+{
+    double total = 0;
+    bool ignoreInvalid;
+
+    for (unsigned n = 0; n &lt; 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 &lt;algorithm&gt;
+#include &lt;wtf/PassRefPtr.h&gt;
+#include &lt;wtf/RefCounted.h&gt;
+#include &lt;wtf/Vector.h&gt;
+
+namespace WebCore {
+
+class PlatformTimeRanges {
+public:
+    static std::unique_ptr&lt;PlatformTimeRanges&gt; create();
+    static std::unique_ptr&lt;PlatformTimeRanges&gt; create(double start, double end);
+    static std::unique_ptr&lt;PlatformTimeRanges&gt; create(const PlatformTimeRanges&amp;);
+
+    explicit PlatformTimeRanges() { }
+    PlatformTimeRanges(double start, double end);
+    PlatformTimeRanges(const PlatformTimeRanges&amp;);
+
+    PlatformTimeRanges&amp; operator=(const PlatformTimeRanges&amp;);
+
+    double start(unsigned index, bool&amp; valid) const;
+    double end(unsigned index, bool&amp; valid) const;
+
+    void invert();
+    void intersectWith(const PlatformTimeRanges&amp;);
+    void unionWith(const PlatformTimeRanges&amp;);
+
+    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&amp; copy(const PlatformTimeRanges&amp;);
+
+    // 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 &lt;= point &amp;&amp; point &lt; m_end;
+        }
+        
+        inline bool isOverlappingRange(const Range&amp; range) const
+        {
+            return isPointInRange(range.m_start) || isPointInRange(range.m_end) || range.isPointInRange(m_start);
+        }
+
+        inline bool isContiguousWithRange(const Range&amp; range) const
+        {
+            return range.m_start == m_end || range.m_end == m_start;
+        }
+        
+        inline Range unionWithOverlappingOrContiguousRange(const Range&amp; 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&amp; range) const
+        {
+            return range.m_start &gt;= m_end;
+        }
+    };
+    
+    Vector&lt;Range&gt; 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 &quot;URL.h&quot;
</span><span class="cx"> #include &quot;Logging.h&quot;
</span><span class="cx"> #include &quot;PlatformLayer.h&quot;
</span><ins>+#include &quot;PlatformTimeRanges.h&quot;
</ins><span class="cx"> #include &quot;Settings.h&quot;
</span><span class="cx"> #include &quot;SoftLinking.h&quot;
</span><del>-#include &quot;TimeRanges.h&quot;
</del><span class="cx"> #include &lt;CoreMedia/CoreMedia.h&gt;
</span><span class="cx"> #include &lt;wtf/MainThread.h&gt;
</span><ins>+#include &lt;wtf/text/CString.h&gt;
</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&lt;TimeRanges&gt; MediaPlayerPrivateAVFoundation::buffered() const
</del><ins>+std::unique_ptr&lt;PlatformTimeRanges&gt; 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-&gt;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 &quot;&quot;;
</del><ins>+    FOR_EACH_MEDIAPLAYERPRIVATEAVFOUNDATION_NOTIFICATION_TYPE(DEFINE_TYPE_STRING_CASE)
+    case MediaPlayerPrivateAVFoundation::Notification::FunctionType: return &quot;FunctionType&quot;;
+    default: ASSERT_NOT_REACHED(); return &quot;&quot;;
</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&lt;TimeRanges&gt; buffered() const override;
</del><ins>+    virtual std::unique_ptr&lt;PlatformTimeRanges&gt; buffered() const override;
</ins><span class="cx">     virtual bool didLoadingProgress() const override;
</span><span class="cx">     virtual void setSize(const IntSize&amp;) override;
</span><span class="cx">     virtual void paint(GraphicsContext*, const IntRect&amp;) = 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&lt;TimeRanges&gt; platformBufferedTimeRanges() const = 0;
</del><ins>+    virtual std::unique_ptr&lt;PlatformTimeRanges&gt; 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&lt;Notification&gt; m_queuedNotifications;
</span><span class="cx">     mutable Mutex m_queueMutex;
</span><span class="cx"> 
</span><del>-    mutable RefPtr&lt;TimeRanges&gt; m_cachedLoadedTimeRanges;
</del><ins>+    mutable std::unique_ptr&lt;PlatformTimeRanges&gt; 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&lt;TimeRanges&gt; MediaPlayerPrivateAVFoundationCF::platformBufferedTimeRanges() const
</del><ins>+std::unique_ptr&lt;PlatformTimeRanges&gt; MediaPlayerPrivateAVFoundationCF::platformBufferedTimeRanges() const
</ins><span class="cx"> {
</span><del>-    RefPtr&lt;TimeRanges&gt; 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&lt;CFArrayRef&gt; 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 &lt; 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&lt;TimeRanges&gt; platformBufferedTimeRanges() const;
</del><ins>+    virtual std::unique_ptr&lt;PlatformTimeRanges&gt; 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&lt;TimeRanges&gt; platformBufferedTimeRanges() const;
</del><ins>+    virtual std::unique_ptr&lt;PlatformTimeRanges&gt; 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 &quot;InbandTextTrackPrivateLegacyAVFObjC.h&quot;
</span><span class="cx"> #import &quot;URL.h&quot;
</span><span class="cx"> #import &quot;Logging.h&quot;
</span><ins>+#import &quot;PlatformTimeRanges.h&quot;
</ins><span class="cx"> #import &quot;SecurityOrigin.h&quot;
</span><span class="cx"> #import &quot;SoftLinking.h&quot;
</span><del>-#import &quot;TimeRanges.h&quot;
</del><span class="cx"> #import &quot;UUID.h&quot;
</span><span class="cx"> #import &quot;VideoTrackPrivateAVFObjC.h&quot;
</span><span class="cx"> #import &quot;WebCoreAVFResourceLoader.h&quot;
</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&lt;TimeRanges&gt; MediaPlayerPrivateAVFoundationObjC::platformBufferedTimeRanges() const
</del><ins>+std::unique_ptr&lt;PlatformTimeRanges&gt; MediaPlayerPrivateAVFoundationObjC::platformBufferedTimeRanges() const
</ins><span class="cx"> {
</span><del>-    RefPtr&lt;TimeRanges&gt; 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-&gt;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&lt;TimeRanges&gt; seekable() const override;
</del><ins>+    virtual std::unique_ptr&lt;PlatformTimeRanges&gt; 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&lt;TimeRanges&gt; buffered() const override;
</del><ins>+    virtual std::unique_ptr&lt;PlatformTimeRanges&gt; 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&lt;TimeRanges&gt; MediaPlayerPrivateMediaSourceAVFObjC::seekable() const
</del><ins>+std::unique_ptr&lt;PlatformTimeRanges&gt; 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&lt;TimeRanges&gt; MediaPlayerPrivateMediaSourceAVFObjC::buffered() const
</del><ins>+std::unique_ptr&lt;PlatformTimeRanges&gt; MediaPlayerPrivateMediaSourceAVFObjC::buffered() const
</ins><span class="cx"> {
</span><span class="cx">     return m_mediaSource-&gt;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&lt;TimeRanges&gt; MediaPlayerPrivateGStreamer::buffered() const
</del><ins>+std::unique_ptr&lt;PlatformTimeRanges&gt; MediaPlayerPrivateGStreamer::buffered() const
</ins><span class="cx"> {
</span><del>-    RefPtr&lt;TimeRanges&gt; 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 &lt; gst_query_get_n_buffering_ranges(query); index++) {
</span><span class="lines">@@ -927,7 +927,7 @@
</span><span class="cx">     if (!m_errorOccured &amp;&amp; !isLiveStream() &amp;&amp; loaded &gt; 0)
</span><span class="cx">         timeRanges-&gt;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&lt;MediaPlayerPrivateGStreamer&gt;*);
</span><span class="cx"> 
</span><del>-    PassRefPtr&lt;TimeRanges&gt; buffered() const;
</del><ins>+    std::unique_ptr&lt;PlatformTimeRanges&gt; 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&lt;TimeRanges&gt; buffered() const override;
</del><ins>+    virtual std::unique_ptr&lt;PlatformTimeRanges&gt; 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&lt;TimeRanges&gt; MediaPlayerPrivateIOS::buffered() const
</del><ins>+std::unique_ptr&lt;PlatformTimeRanges&gt; MediaPlayerPrivateIOS::buffered()
</ins><span class="cx"> {
</span><del>-    RefPtr&lt;TimeRanges&gt; 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-&gt;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&amp;)
</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&lt;TimeRanges&gt; buffered() const;
</del><ins>+    std::unique_ptr&lt;PlatformTimeRanges&gt; 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 &quot;Logging.h&quot;
</span><span class="cx"> #import &quot;MIMETypeRegistry.h&quot;
</span><span class="cx"> #import &quot;PlatformLayer.h&quot;
</span><ins>+#import &quot;PlatformTimeRanges.h&quot;
</ins><span class="cx"> #import &quot;SecurityOrigin.h&quot;
</span><span class="cx"> #import &quot;SoftLinking.h&quot;
</span><del>-#import &quot;TimeRanges.h&quot;
</del><span class="cx"> #import &quot;WebCoreSystemInterface.h&quot;
</span><span class="cx"> #import &lt;QTKit/QTKit.h&gt;
</span><span class="cx"> #import &lt;objc/runtime.h&gt;
</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&lt;TimeRanges&gt; MediaPlayerPrivateQTKit::buffered() const
</del><ins>+std::unique_ptr&lt;PlatformTimeRanges&gt; MediaPlayerPrivateQTKit::buffered() const
</ins><span class="cx"> {
</span><del>-    RefPtr&lt;TimeRanges&gt; timeRanges = TimeRanges::create();
</del><ins>+    auto timeRanges = PlatformTimeRanges::create();
</ins><span class="cx">     float loaded = maxTimeLoaded();
</span><span class="cx">     if (loaded &gt; 0)
</span><span class="cx">         timeRanges-&gt;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-&gt;setClosedCaptionsVisible(visible);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-PassRefPtr&lt;TimeRanges&gt; MediaPlayerPrivateQuickTimeVisualContext::buffered() const
</del><ins>+std::unique_ptr&lt;PlatformTimeRanges&gt; MediaPlayerPrivateQuickTimeVisualContext::buffered() const
</ins><span class="cx"> {
</span><del>-    RefPtr&lt;TimeRanges&gt; 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 &amp;&amp; loaded &gt; 0)
</span><span class="cx">         timeRanges-&gt;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&lt;TimeRanges&gt; buffered() const;
</del><ins>+    std::unique_ptr&lt;PlatformTimeRanges&gt; 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&lt;TimeRanges&gt; buffered() const;
</del><ins>+        std::unique_ptr&lt;PlatformTimeRanges&gt; 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&lt;TimeRanges&gt; MockMediaPlayerMediaSource::buffered() const
</del><ins>+std::unique_ptr&lt;PlatformTimeRanges&gt; MockMediaPlayerMediaSource::buffered() const
</ins><span class="cx"> {
</span><del>-    return m_mediaSource ? m_mediaSource-&gt;buffered() : TimeRanges::create();
</del><ins>+    if (m_mediaSource)
+        return m_mediaSource-&gt;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&lt;TimeRanges&gt; buffered = this-&gt;buffered();
</del><ins>+    if (!m_mediaSource)
+        return;
+
+    auto buffered = m_mediaSource-&gt;buffered();
</ins><span class="cx">     size_t pos = buffered-&gt;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-&gt;end(pos, IGNORE_EXCEPTION)));
</del><ins>+    bool ignoreError;
+    m_currentTime = MediaTime::createWithDouble(std::min(m_duration, buffered-&gt;end(pos, ignoreError)));
</ins><span class="cx">     m_player-&gt;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&lt;TimeRanges&gt; buffered() const override;
</del><ins>+    virtual std::unique_ptr&lt;PlatformTimeRanges&gt; buffered() const override;
</ins><span class="cx">     virtual bool didLoadingProgress() const override;
</span><span class="cx">     virtual void setSize(const IntSize&amp;) override;
</span><span class="cx">     virtual void paint(GraphicsContext*, const IntRect&amp;) 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  &lt;eric.carlson@apple.com&gt;
+
+        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  &lt;eocanha@igalia.com&gt;
</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  &lt;eric.carlson@apple.com&gt;
+
+        Fix TimeRanges layering violations
+        https://bugs.webkit.org/show_bug.cgi?id=128717
+
+        Reviewed by Jer Noble.
+
+        * TestWebKitAPI/Tests/WebCore/TimeRanges.cpp: TimeRanges* -&gt; TimeRanges&amp;.
+        (TestWebKitAPI::TEST):
+
</ins><span class="cx"> 2014-02-21  Diego Pino García  &lt;dpino@igalia.com&gt;
</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(&quot;{ [0,2) }&quot;, ranges);
</span><span class="cx"> 
</span><del>-    ranges-&gt;intersectWith(ranges.get());
</del><ins>+    ranges-&gt;intersectWith(*ranges.get());
</ins><span class="cx"> 
</span><span class="cx">     ASSERT_RANGE(&quot;{ [0,2) }&quot;, ranges);
</span><span class="cx"> }
</span><span class="lines">@@ -128,7 +128,7 @@
</span><span class="cx">     ASSERT_RANGE(&quot;{ [0,2) }&quot;, rangesA);
</span><span class="cx">     ASSERT_RANGE(&quot;{ [0,2) }&quot;, rangesB);
</span><span class="cx"> 
</span><del>-    rangesA-&gt;intersectWith(rangesB.get());
</del><ins>+    rangesA-&gt;intersectWith(*rangesB.get());
</ins><span class="cx"> 
</span><span class="cx">     ASSERT_RANGE(&quot;{ [0,2) }&quot;, rangesA);
</span><span class="cx">     ASSERT_RANGE(&quot;{ [0,2) }&quot;, rangesB);
</span><span class="lines">@@ -142,7 +142,7 @@
</span><span class="cx">     ASSERT_RANGE(&quot;{ [0,2) }&quot;, rangesA);
</span><span class="cx">     ASSERT_RANGE(&quot;{ }&quot;, rangesB);
</span><span class="cx"> 
</span><del>-    rangesA-&gt;intersectWith(rangesB.get());
</del><ins>+    rangesA-&gt;intersectWith(*rangesB.get());
</ins><span class="cx"> 
</span><span class="cx">     ASSERT_RANGE(&quot;{ }&quot;, rangesA);
</span><span class="cx">     ASSERT_RANGE(&quot;{ }&quot;, 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&lt;TimeRanges&gt; rangesA = TimeRanges::create();
</span><span class="cx">     RefPtr&lt;TimeRanges&gt; rangesB = TimeRanges::create();
</span><span class="cx"> 
</span><span class="lines">@@ -162,7 +163,7 @@
</span><span class="cx">     ASSERT_RANGE(&quot;{ [0,1) [4,5) }&quot;, rangesA);
</span><span class="cx">     ASSERT_RANGE(&quot;{ [2,3) [6,7) }&quot;, rangesB);
</span><span class="cx"> 
</span><del>-    rangesA-&gt;intersectWith(rangesB.get());
</del><ins>+    rangesA-&gt;intersectWith(*rangesB.get());
</ins><span class="cx"> 
</span><span class="cx">     ASSERT_RANGE(&quot;{ }&quot;, rangesA);
</span><span class="cx">     ASSERT_RANGE(&quot;{ [2,3) [6,7) }&quot;, rangesB);
</span><span class="lines">@@ -182,7 +183,7 @@
</span><span class="cx">     ASSERT_RANGE(&quot;{ [0,1) [4,5) }&quot;, rangesA);
</span><span class="cx">     ASSERT_RANGE(&quot;{ [1,4) [5,7) }&quot;, rangesB);
</span><span class="cx"> 
</span><del>-    rangesA-&gt;intersectWith(rangesB.get());
</del><ins>+    rangesA-&gt;intersectWith(*rangesB.get());
</ins><span class="cx"> 
</span><span class="cx">     ASSERT_RANGE(&quot;{ }&quot;, rangesA);
</span><span class="cx">     ASSERT_RANGE(&quot;{ [1,4) [5,7) }&quot;, rangesB);
</span><span class="lines">@@ -202,7 +203,7 @@
</span><span class="cx">     ASSERT_RANGE(&quot;{ [1,3) [4,5) [6,9) }&quot;, rangesA);
</span><span class="cx">     ASSERT_RANGE(&quot;{ [0,10) }&quot;, rangesB);
</span><span class="cx"> 
</span><del>-    rangesA-&gt;intersectWith(rangesB.get());
</del><ins>+    rangesA-&gt;intersectWith(*rangesB.get());
</ins><span class="cx"> 
</span><span class="cx">     ASSERT_RANGE(&quot;{ [1,3) [4,5) [6,9) }&quot;, rangesA);
</span><span class="cx">     ASSERT_RANGE(&quot;{ [0,10) }&quot;, rangesB);
</span><span class="lines">@@ -222,7 +223,7 @@
</span><span class="cx">     ASSERT_RANGE(&quot;{ [1,3) [4,5) [6,9) }&quot;, rangesA);
</span><span class="cx">     ASSERT_RANGE(&quot;{ [1,9) }&quot;, rangesB);
</span><span class="cx"> 
</span><del>-    rangesA-&gt;intersectWith(rangesB.get());
</del><ins>+    rangesA-&gt;intersectWith(*rangesB.get());
</ins><span class="cx"> 
</span><span class="cx">     ASSERT_RANGE(&quot;{ [1,3) [4,5) [6,9) }&quot;, rangesA);
</span><span class="cx">     ASSERT_RANGE(&quot;{ [1,9) }&quot;, rangesB);
</span><span class="lines">@@ -241,7 +242,7 @@
</span><span class="cx">     ASSERT_RANGE(&quot;{ [0,2) [4,6) }&quot;, rangesA);
</span><span class="cx">     ASSERT_RANGE(&quot;{ [1,5) }&quot;, rangesB);
</span><span class="cx"> 
</span><del>-    rangesA-&gt;intersectWith(rangesB.get());
</del><ins>+    rangesA-&gt;intersectWith(*rangesB.get());
</ins><span class="cx"> 
</span><span class="cx">     ASSERT_RANGE(&quot;{ [1,2) [4,5) }&quot;, rangesA);
</span><span class="cx">     ASSERT_RANGE(&quot;{ [1,5) }&quot;, rangesB);
</span><span class="lines">@@ -261,7 +262,7 @@
</span><span class="cx">     ASSERT_RANGE(&quot;{ [0,2) [4,6) [8,10) }&quot;, rangesA);
</span><span class="cx">     ASSERT_RANGE(&quot;{ [1,9) }&quot;, rangesB);
</span><span class="cx"> 
</span><del>-    rangesA-&gt;intersectWith(rangesB.get());
</del><ins>+    rangesA-&gt;intersectWith(*rangesB.get());
</ins><span class="cx"> 
</span><span class="cx">     ASSERT_RANGE(&quot;{ [1,2) [4,6) [8,9) }&quot;, rangesA);
</span><span class="cx">     ASSERT_RANGE(&quot;{ [1,9) }&quot;, rangesB);
</span><span class="lines">@@ -282,7 +283,7 @@
</span><span class="cx">     ASSERT_RANGE(&quot;{ [0,2) [4,7) [8,10) }&quot;, rangesA);
</span><span class="cx">     ASSERT_RANGE(&quot;{ [1,5) [6,9) }&quot;, rangesB);
</span><span class="cx"> 
</span><del>-    rangesA-&gt;intersectWith(rangesB.get());
</del><ins>+    rangesA-&gt;intersectWith(*rangesB.get());
</ins><span class="cx"> 
</span><span class="cx">     ASSERT_RANGE(&quot;{ [1,2) [4,5) [6,7) [8,9) }&quot;, rangesA);
</span><span class="cx">     ASSERT_RANGE(&quot;{ [1,5) [6,9) }&quot;, rangesB);
</span></span></pre>
</div>
</div>

</body>
</html>