<!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>[179480] trunk/Source</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/179480">179480</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2015-02-02 11:40:57 -0800 (Mon, 02 Feb 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>Prevent crash when accessing WebAVPlayerController.delegate.
https://bugs.webkit.org/show_bug.cgi?id=140893

Patch by Jeremy Jones &lt;jeremyj@apple.com&gt; on 2015-02-02
Reviewed by Darin Adler.

Source/WebCore:

This patch aims to prevent a null delegate access during invalidation by adding null checks before accessing the delegate, by making explicit the recreation of m_playerController, and by consolidating and correcting the teardown sequence.

* WebCore.exp.in:
* platform/ios/WebVideoFullscreenInterface.h: add resetMediaState()
* platform/ios/WebVideoFullscreenInterfaceAVKit.h: ditto.
* platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
(-[WebAVPlayerController playerViewController:shouldExitFullScreenWithReason:]): Check for null before accessing delegate.
(-[WebAVPlayerController play:]): ditto.
(-[WebAVPlayerController pause:]): ditto.
(-[WebAVPlayerController togglePlayback:]): ditto.
(-[WebAVPlayerController setPlaying:]): ditto.
(-[WebAVPlayerController beginScrubbing:]): ditto.
(-[WebAVPlayerController endScrubbing:]): ditto.
(-[WebAVPlayerController seekToTime:]): ditto.
(-[WebAVPlayerController beginScanningForward:]): ditto.
(-[WebAVPlayerController endScanningForward:]): ditto.
(-[WebAVPlayerController beginScanningBackward:]): ditto.
(-[WebAVPlayerController endScanningBackward:]): ditto.
(-[WebAVPlayerController seekToBeginning:]): ditto.
(-[WebAVPlayerController seekToEnd:]): ditto.
(-[WebAVPlayerController setCurrentAudioMediaSelectionOption:]): ditto.
(-[WebAVPlayerController setCurrentLegibleMediaSelectionOption:]): ditto.
(-[WebAVPlayerController layoutSublayersOfLayer:]): ditto.
(WebVideoFullscreenInterfaceAVKit::WebVideoFullscreenInterfaceAVKit): initialize m_playerController
(WebVideoFullscreenInterfaceAVKit::resetMediaState): Added.
(WebVideoFullscreenInterfaceAVKit::setDuration): remove playerController()
(WebVideoFullscreenInterfaceAVKit::setCurrentTime): ditto.
(WebVideoFullscreenInterfaceAVKit::setRate): ditto.
(WebVideoFullscreenInterfaceAVKit::setVideoDimensions): ditto.
(WebVideoFullscreenInterfaceAVKit::setSeekableRanges): ditto.
(WebVideoFullscreenInterfaceAVKit::setCanPlayFastReverse): ditto.
(WebVideoFullscreenInterfaceAVKit::setAudioMediaSelectionOptions): ditto.
(WebVideoFullscreenInterfaceAVKit::setLegibleMediaSelectionOptions): ditto.
(WebVideoFullscreenInterfaceAVKit::setExternalPlayback): ditto.
(WebVideoFullscreenInterfaceAVKit::setupFullscreenInternal): ditto.
(WebVideoFullscreenInterfaceAVKit::enterFullscreenStandard): ditto.
(WebVideoFullscreenInterfaceAVKit::cleanupFullscreenInternal): consolidated cleanup code from invalidate()
(WebVideoFullscreenInterfaceAVKit::invalidate): consolidate cleanup code.
(WebVideoFullscreenInterfaceAVKit::playerController): Deleted.
* platform/ios/WebVideoFullscreenModelVideoElement.mm:
(WebVideoFullscreenModelVideoElement::setVideoElement): call resetMediaState()

Source/WebKit2:

Plumb new resetMediaState() through IPC interface WebVideoFullscreenManagerProxy.

* UIProcess/ios/WebVideoFullscreenManagerProxy.messages.in:
* UIProcess/ios/WebVideoFullscreenManagerProxy.mm:
(WebKit::WebVideoFullscreenManagerProxy::invalidate): remove redundant set to nullptr.
* WebProcess/ios/WebVideoFullscreenManager.h:
* WebProcess/ios/WebVideoFullscreenManager.mm:
(WebKit::WebVideoFullscreenManager::resetMediaState):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreWebCoreexpin">trunk/Source/WebCore/WebCore.exp.in</a></li>
<li><a href="#trunkSourceWebCoreplatformiosWebVideoFullscreenInterfaceh">trunk/Source/WebCore/platform/ios/WebVideoFullscreenInterface.h</a></li>
<li><a href="#trunkSourceWebCoreplatformiosWebVideoFullscreenInterfaceAVKith">trunk/Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.h</a></li>
<li><a href="#trunkSourceWebCoreplatformiosWebVideoFullscreenInterfaceAVKitmm">trunk/Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformiosWebVideoFullscreenModelVideoElementmm">trunk/Source/WebCore/platform/ios/WebVideoFullscreenModelVideoElement.mm</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2UIProcessiosWebVideoFullscreenManagerProxymessagesin">trunk/Source/WebKit2/UIProcess/ios/WebVideoFullscreenManagerProxy.messages.in</a></li>
<li><a href="#trunkSourceWebKit2UIProcessiosWebVideoFullscreenManagerProxymm">trunk/Source/WebKit2/UIProcess/ios/WebVideoFullscreenManagerProxy.mm</a></li>
<li><a href="#trunkSourceWebKit2WebProcessiosWebVideoFullscreenManagerh">trunk/Source/WebKit2/WebProcess/ios/WebVideoFullscreenManager.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessiosWebVideoFullscreenManagermm">trunk/Source/WebKit2/WebProcess/ios/WebVideoFullscreenManager.mm</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (179479 => 179480)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-02-02 19:05:46 UTC (rev 179479)
+++ trunk/Source/WebCore/ChangeLog        2015-02-02 19:40:57 UTC (rev 179480)
</span><span class="lines">@@ -1,3 +1,52 @@
</span><ins>+2015-02-02  Jeremy Jones  &lt;jeremyj@apple.com&gt;
+
+        Prevent crash when accessing WebAVPlayerController.delegate.
+        https://bugs.webkit.org/show_bug.cgi?id=140893
+
+        Reviewed by Darin Adler.
+
+        This patch aims to prevent a null delegate access during invalidation by adding null checks before accessing the delegate, by making explicit the recreation of m_playerController, and by consolidating and correcting the teardown sequence.
+
+        * WebCore.exp.in:
+        * platform/ios/WebVideoFullscreenInterface.h: add resetMediaState()
+        * platform/ios/WebVideoFullscreenInterfaceAVKit.h: ditto.
+        * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
+        (-[WebAVPlayerController playerViewController:shouldExitFullScreenWithReason:]): Check for null before accessing delegate.
+        (-[WebAVPlayerController play:]): ditto.
+        (-[WebAVPlayerController pause:]): ditto.
+        (-[WebAVPlayerController togglePlayback:]): ditto.
+        (-[WebAVPlayerController setPlaying:]): ditto.
+        (-[WebAVPlayerController beginScrubbing:]): ditto.
+        (-[WebAVPlayerController endScrubbing:]): ditto.
+        (-[WebAVPlayerController seekToTime:]): ditto.
+        (-[WebAVPlayerController beginScanningForward:]): ditto.
+        (-[WebAVPlayerController endScanningForward:]): ditto.
+        (-[WebAVPlayerController beginScanningBackward:]): ditto.
+        (-[WebAVPlayerController endScanningBackward:]): ditto.
+        (-[WebAVPlayerController seekToBeginning:]): ditto.
+        (-[WebAVPlayerController seekToEnd:]): ditto.
+        (-[WebAVPlayerController setCurrentAudioMediaSelectionOption:]): ditto.
+        (-[WebAVPlayerController setCurrentLegibleMediaSelectionOption:]): ditto.
+        (-[WebAVPlayerController layoutSublayersOfLayer:]): ditto.
+        (WebVideoFullscreenInterfaceAVKit::WebVideoFullscreenInterfaceAVKit): initialize m_playerController
+        (WebVideoFullscreenInterfaceAVKit::resetMediaState): Added.
+        (WebVideoFullscreenInterfaceAVKit::setDuration): remove playerController()
+        (WebVideoFullscreenInterfaceAVKit::setCurrentTime): ditto.
+        (WebVideoFullscreenInterfaceAVKit::setRate): ditto.
+        (WebVideoFullscreenInterfaceAVKit::setVideoDimensions): ditto.
+        (WebVideoFullscreenInterfaceAVKit::setSeekableRanges): ditto.
+        (WebVideoFullscreenInterfaceAVKit::setCanPlayFastReverse): ditto.
+        (WebVideoFullscreenInterfaceAVKit::setAudioMediaSelectionOptions): ditto.
+        (WebVideoFullscreenInterfaceAVKit::setLegibleMediaSelectionOptions): ditto.
+        (WebVideoFullscreenInterfaceAVKit::setExternalPlayback): ditto.
+        (WebVideoFullscreenInterfaceAVKit::setupFullscreenInternal): ditto.
+        (WebVideoFullscreenInterfaceAVKit::enterFullscreenStandard): ditto.
+        (WebVideoFullscreenInterfaceAVKit::cleanupFullscreenInternal): consolidated cleanup code from invalidate()
+        (WebVideoFullscreenInterfaceAVKit::invalidate): consolidate cleanup code.
+        (WebVideoFullscreenInterfaceAVKit::playerController): Deleted.
+        * platform/ios/WebVideoFullscreenModelVideoElement.mm:
+        (WebVideoFullscreenModelVideoElement::setVideoElement): call resetMediaState()
+
</ins><span class="cx"> 2015-02-02  Darin Adler  &lt;darin@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         REGRESSION (r170576): Storage leaks in parsing of CSS image sizes
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCoreexpin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.exp.in (179479 => 179480)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.exp.in        2015-02-02 19:05:46 UTC (rev 179479)
+++ trunk/Source/WebCore/WebCore.exp.in        2015-02-02 19:40:57 UTC (rev 179480)
</span><span class="lines">@@ -3483,6 +3483,7 @@
</span><span class="cx"> __ZN7WebCore32WebVideoFullscreenInterfaceAVKit14exitFullscreenENS_7IntRectE
</span><span class="cx"> __ZN7WebCore32WebVideoFullscreenInterfaceAVKit14setCurrentTimeEdd
</span><span class="cx"> __ZN7WebCore32WebVideoFullscreenInterfaceAVKit15enterFullscreenEv
</span><ins>+__ZN7WebCore32WebVideoFullscreenInterfaceAVKit15resetMediaStateEv
</ins><span class="cx"> __ZN7WebCore32WebVideoFullscreenInterfaceAVKit15setupFullscreenER7CALayerNS_7IntRectEP6UIViewjb
</span><span class="cx"> __ZN7WebCore32WebVideoFullscreenInterfaceAVKit17cleanupFullscreenEv
</span><span class="cx"> __ZN7WebCore32WebVideoFullscreenInterfaceAVKit17setSeekableRangesERKNS_10TimeRangesE
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformiosWebVideoFullscreenInterfaceh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/ios/WebVideoFullscreenInterface.h (179479 => 179480)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ios/WebVideoFullscreenInterface.h        2015-02-02 19:05:46 UTC (rev 179479)
+++ trunk/Source/WebCore/platform/ios/WebVideoFullscreenInterface.h        2015-02-02 19:40:57 UTC (rev 179480)
</span><span class="lines">@@ -44,6 +44,7 @@
</span><span class="cx">     enum ExternalPlaybackTargetType { TargetTypeNone, TargetTypeAirPlay, TargetTypeTVOut };
</span><span class="cx">     
</span><span class="cx">     virtual ~WebVideoFullscreenInterface() { };
</span><ins>+    virtual void resetMediaState() = 0;
</ins><span class="cx">     virtual void setDuration(double) = 0;
</span><span class="cx">     virtual void setCurrentTime(double currentTime, double anchorTime) = 0;
</span><span class="cx">     virtual void setRate(bool isPlaying, float playbackRate) = 0;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformiosWebVideoFullscreenInterfaceAVKith"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.h (179479 => 179480)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.h        2015-02-02 19:05:46 UTC (rev 179479)
+++ trunk/Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.h        2015-02-02 19:40:57 UTC (rev 179480)
</span><span class="lines">@@ -73,6 +73,7 @@
</span><span class="cx">     WEBCORE_EXPORT void setWebVideoFullscreenModel(WebVideoFullscreenModel*);
</span><span class="cx">     WEBCORE_EXPORT void setWebVideoFullscreenChangeObserver(WebVideoFullscreenChangeObserver*);
</span><span class="cx">     
</span><ins>+    WEBCORE_EXPORT virtual void resetMediaState() override;
</ins><span class="cx">     WEBCORE_EXPORT virtual void setDuration(double) override;
</span><span class="cx">     WEBCORE_EXPORT virtual void setCurrentTime(double currentTime, double anchorTime) override;
</span><span class="cx">     WEBCORE_EXPORT virtual void setRate(bool isPlaying, float playbackRate) override;
</span><span class="lines">@@ -95,6 +96,7 @@
</span><span class="cx">     bool mayAutomaticallyShowVideoOptimized();
</span><span class="cx"> 
</span><span class="cx"> protected:
</span><ins>+    void beginSession();
</ins><span class="cx">     void setupFullscreenInternal(PlatformLayer&amp;, IntRect initialRect, UIView *, HTMLMediaElement::VideoFullscreenMode, bool allowOptimizedFullscreen);
</span><span class="cx">     void enterFullscreenOptimized();
</span><span class="cx">     void enterFullscreenStandard();
</span><span class="lines">@@ -118,8 +120,6 @@
</span><span class="cx">     bool m_exitCompleted;
</span><span class="cx">     bool m_enterRequested;
</span><span class="cx"> 
</span><del>-    WebAVPlayerController *playerController();
-    
</del><span class="cx">     void doEnterFullscreen();
</span><span class="cx"> };
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformiosWebVideoFullscreenInterfaceAVKitmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.mm (179479 => 179480)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.mm        2015-02-02 19:05:46 UTC (rev 179479)
+++ trunk/Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.mm        2015-02-02 19:40:57 UTC (rev 179480)
</span><span class="lines">@@ -86,6 +86,8 @@
</span><span class="cx">     WebAVMediaSelectionOption *_currentLegibleMediaSelectionOption;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+-(void)resetState;
+
</ins><span class="cx"> @property (retain) AVPlayerController* playerControllerProxy;
</span><span class="cx"> @property (assign) WebVideoFullscreenModel* delegate;
</span><span class="cx"> @property (assign) WebVideoFullscreenInterfaceAVKit* fullscreenInterface;
</span><span class="lines">@@ -154,6 +156,37 @@
</span><span class="cx">     [super dealloc];
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+-(void)resetState {
+    self.contentDuration = 0;
+    self.maxTime = 0;
+    self.contentDurationWithinEndTimes = 0;
+    self.loadedTimeRanges = @[];
+    
+    self.canPlay = NO;
+    self.canPause = NO;
+    self.canTogglePlayback = NO;
+    self.hasEnabledAudio = NO;
+    self.canSeek = NO;
+    self.minTime = 0;
+    self.status = AVPlayerControllerStatusUnknown;
+    
+    self.timing = nil;
+    self.rate = 0;
+    
+    self.hasEnabledVideo = NO;
+    self.contentDimensions = CGSizeMake(0, 0);
+    
+    self.seekableTimeRanges = [NSMutableArray array];
+    
+    self.canScanBackward = NO;
+    
+    self.audioMediaSelectionOptions = nil;
+    self.currentAudioMediaSelectionOption = nil;
+    
+    self.legibleMediaSelectionOptions = nil;
+    self.currentLegibleMediaSelectionOption = nil;
+}
+
</ins><span class="cx"> - (AVPlayer*) player {
</span><span class="cx">     return nil;
</span><span class="cx"> }
</span><span class="lines">@@ -168,9 +201,12 @@
</span><span class="cx"> {
</span><span class="cx">     UNUSED_PARAM(playerViewController);
</span><span class="cx">     UNUSED_PARAM(reason);
</span><del>-    ASSERT(self.delegate);
</del><ins>+    if (!self.delegate)
+        return YES;
+    
</ins><span class="cx">     if (reason == AVPlayerViewControllerExitFullScreenReasonDoneButtonTapped || reason == AVPlayerViewControllerExitFullScreenReasonRemoteControlStopEventReceived)
</span><span class="cx">         self.delegate-&gt;pause();
</span><ins>+    
</ins><span class="cx">     self.delegate-&gt;requestExitFullscreen();
</span><span class="cx">     return NO;
</span><span class="cx"> }
</span><span class="lines">@@ -178,21 +214,24 @@
</span><span class="cx"> - (void)play:(id)sender
</span><span class="cx"> {
</span><span class="cx">     UNUSED_PARAM(sender);
</span><del>-    ASSERT(self.delegate);
</del><ins>+    if (!self.delegate)
+        return;
</ins><span class="cx">     self.delegate-&gt;play();
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (void)pause:(id)sender
</span><span class="cx"> {
</span><span class="cx">     UNUSED_PARAM(sender);
</span><del>-    ASSERT(self.delegate);
</del><ins>+    if (!self.delegate)
+        return;
</ins><span class="cx">     self.delegate-&gt;pause();
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (void)togglePlayback:(id)sender
</span><span class="cx"> {
</span><span class="cx">     UNUSED_PARAM(sender);
</span><del>-    ASSERT(self.delegate);
</del><ins>+    if (!self.delegate)
+        return;
</ins><span class="cx">     self.delegate-&gt;togglePlayState();
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -203,12 +242,13 @@
</span><span class="cx"> 
</span><span class="cx"> - (void)setPlaying:(BOOL)playing
</span><span class="cx"> {
</span><del>-    ASSERT(self.delegate);
</del><ins>+    if (!self.delegate)
+        return;
</ins><span class="cx">     if (playing)
</span><span class="cx">         self.delegate-&gt;play();
</span><span class="cx">     else
</span><span class="cx">         self.delegate-&gt;pause();
</span><del>-    }
</del><ins>+}
</ins><span class="cx"> 
</span><span class="cx"> + (NSSet *)keyPathsForValuesAffectingPlaying
</span><span class="cx"> {
</span><span class="lines">@@ -218,20 +258,23 @@
</span><span class="cx"> - (void)beginScrubbing:(id)sender
</span><span class="cx"> {
</span><span class="cx">     UNUSED_PARAM(sender);
</span><del>-    ASSERT(self.delegate);
</del><ins>+    if (!self.delegate)
+        return;
</ins><span class="cx">     self.delegate-&gt;beginScrubbing();
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (void)endScrubbing:(id)sender
</span><span class="cx"> {
</span><span class="cx">     UNUSED_PARAM(sender);
</span><del>-    ASSERT(self.delegate);
</del><ins>+    if (!self.delegate)
+        return;
</ins><span class="cx">     self.delegate-&gt;endScrubbing();
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (void)seekToTime:(NSTimeInterval)time
</span><span class="cx"> {
</span><del>-    ASSERT(self.delegate);
</del><ins>+    if (!self.delegate)
+        return;
</ins><span class="cx">     self.delegate-&gt;fastSeek(time);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -294,28 +337,32 @@
</span><span class="cx"> - (void)beginScanningForward:(id)sender
</span><span class="cx"> {
</span><span class="cx">     UNUSED_PARAM(sender);
</span><del>-    ASSERT(self.delegate);
</del><ins>+    if (!self.delegate)
+        return;
</ins><span class="cx">     self.delegate-&gt;beginScanningForward();
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (void)endScanningForward:(id)sender
</span><span class="cx"> {
</span><span class="cx">     UNUSED_PARAM(sender);
</span><del>-    ASSERT(self.delegate);
</del><ins>+    if (!self.delegate)
+        return;
</ins><span class="cx">     self.delegate-&gt;endScanning();
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (void)beginScanningBackward:(id)sender
</span><span class="cx"> {
</span><span class="cx">     UNUSED_PARAM(sender);
</span><del>-    ASSERT(self.delegate);
</del><ins>+    if (!self.delegate)
+        return;
</ins><span class="cx">     self.delegate-&gt;beginScanningBackward();
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (void)endScanningBackward:(id)sender
</span><span class="cx"> {
</span><span class="cx">     UNUSED_PARAM(sender);
</span><del>-    ASSERT(self.delegate);
</del><ins>+    if (!self.delegate)
+        return;
</ins><span class="cx">     self.delegate-&gt;endScanning();
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -337,8 +384,8 @@
</span><span class="cx"> - (void)seekToBeginning:(id)sender
</span><span class="cx"> {
</span><span class="cx">     UNUSED_PARAM(sender);
</span><del>-    ASSERT(self.delegate);
-
</del><ins>+    if (!self.delegate)
+        return;
</ins><span class="cx">     self.delegate-&gt;seekToTime(-INFINITY);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -365,8 +412,8 @@
</span><span class="cx"> - (void)seekToEnd:(id)sender
</span><span class="cx"> {
</span><span class="cx">     UNUSED_PARAM(sender);
</span><del>-    ASSERT(self.delegate);
-
</del><ins>+    if (!self.delegate)
+        return;
</ins><span class="cx">     self.delegate-&gt;seekToTime(INFINITY);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -419,7 +466,8 @@
</span><span class="cx">     [_currentAudioMediaSelectionOption release];
</span><span class="cx">     _currentAudioMediaSelectionOption = [option retain];
</span><span class="cx">     
</span><del>-    ASSERT(self.delegate);
</del><ins>+    if (!self.delegate)
+        return;
</ins><span class="cx">     
</span><span class="cx">     NSInteger index = NSNotFound;
</span><span class="cx">     
</span><span class="lines">@@ -442,7 +490,8 @@
</span><span class="cx">     [_currentLegibleMediaSelectionOption release];
</span><span class="cx">     _currentLegibleMediaSelectionOption = [option retain];
</span><span class="cx">     
</span><del>-    ASSERT(self.delegate);
</del><ins>+    if (!self.delegate)
+        return;
</ins><span class="cx">     
</span><span class="cx">     NSInteger index = NSNotFound;
</span><span class="cx">     
</span><span class="lines">@@ -465,7 +514,8 @@
</span><span class="cx"> - (void)layoutSublayersOfLayer:(CALayer *)layer
</span><span class="cx"> {
</span><span class="cx">     CGRect layerBounds = [layer bounds];
</span><del>-    self.delegate-&gt;setVideoLayerFrame(CGRectMake(0, 0, CGRectGetWidth(layerBounds), CGRectGetHeight(layerBounds)));
</del><ins>+    if (self.delegate)
+        self.delegate-&gt;setVideoLayerFrame(CGRectMake(0, 0, CGRectGetWidth(layerBounds), CGRectGetHeight(layerBounds)));
</ins><span class="cx">     
</span><span class="cx">     [CATransaction begin];
</span><span class="cx">     for (CALayer *sublayer in [layer sublayers]) {
</span><span class="lines">@@ -614,28 +664,32 @@
</span><span class="cx"> @end
</span><span class="cx"> 
</span><span class="cx"> WebVideoFullscreenInterfaceAVKit::WebVideoFullscreenInterfaceAVKit()
</span><del>-    : m_videoFullscreenModel(nullptr)
</del><ins>+    : m_playerController(adoptNS([[WebAVPlayerController alloc] init]))
+    , m_videoFullscreenModel(nullptr)
</ins><span class="cx">     , m_fullscreenChangeObserver(nullptr)
</span><span class="cx">     , m_mode(HTMLMediaElement::VideoFullscreenModeNone)
</span><span class="cx">     , m_exitRequested(false)
</span><span class="cx">     , m_exitCompleted(false)
</span><span class="cx">     , m_enterRequested(false)
</span><span class="cx"> {
</span><ins>+    [m_playerController setFullscreenInterface:this];
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-WebAVPlayerController *WebVideoFullscreenInterfaceAVKit::playerController()
</del><ins>+void WebVideoFullscreenInterfaceAVKit::resetMediaState()
</ins><span class="cx"> {
</span><del>-    if (!m_playerController)
-    {
-        m_playerController = adoptNS([[WebAVPlayerController alloc] init]);
-        if (m_videoFullscreenModel)
-            [m_playerController setDelegate:m_videoFullscreenModel];
-        [m_playerController setFullscreenInterface:this];
-    }
-    return m_playerController.get();
</del><ins>+    RefPtr&lt;WebVideoFullscreenInterfaceAVKit&gt; strongThis(this);
+    
+    dispatch_async(dispatch_get_main_queue(), [strongThis] {
+        if (!strongThis-&gt;m_playerController) {
+            strongThis-&gt;m_playerController = adoptNS([[WebAVPlayerController alloc] init]);
+            [strongThis-&gt;m_playerController setDelegate:strongThis-&gt;m_videoFullscreenModel];
+            [strongThis-&gt;m_playerController setFullscreenInterface:strongThis.get()];
+            
+        } else
+            [strongThis-&gt;m_playerController resetState];
+    });
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-
</del><span class="cx"> void WebVideoFullscreenInterfaceAVKit::setWebVideoFullscreenModel(WebVideoFullscreenModel* model)
</span><span class="cx"> {
</span><span class="cx">     m_videoFullscreenModel = model;
</span><span class="lines">@@ -652,7 +706,7 @@
</span><span class="cx">     RefPtr&lt;WebVideoFullscreenInterfaceAVKit&gt; strongThis(this);
</span><span class="cx">     
</span><span class="cx">     dispatch_async(dispatch_get_main_queue(), [strongThis, duration] {
</span><del>-        WebAVPlayerController* playerController = strongThis-&gt;playerController();
</del><ins>+        WebAVPlayerController* playerController = strongThis-&gt;m_playerController.get();
</ins><span class="cx"> 
</span><span class="cx">         // FIXME: https://bugs.webkit.org/show_bug.cgi?id=127017 use correct values instead of duration for all these
</span><span class="cx">         playerController.contentDuration = duration;
</span><span class="lines">@@ -676,10 +730,10 @@
</span><span class="cx">     RefPtr&lt;WebVideoFullscreenInterfaceAVKit&gt; strongThis(this);
</span><span class="cx">     
</span><span class="cx">     dispatch_async(dispatch_get_main_queue(), [strongThis, currentTime, anchorTime] {
</span><del>-        NSTimeInterval anchorTimeStamp = ![strongThis-&gt;playerController() rate] ? NAN : anchorTime;
</del><ins>+        NSTimeInterval anchorTimeStamp = ![strongThis-&gt;m_playerController rate] ? NAN : anchorTime;
</ins><span class="cx">         AVValueTiming *timing = [getAVValueTimingClass() valueTimingWithAnchorValue:currentTime
</span><span class="cx">             anchorTimeStamp:anchorTimeStamp rate:0];
</span><del>-        strongThis-&gt;playerController().timing = timing;
</del><ins>+        [strongThis-&gt;m_playerController setTiming:timing];
</ins><span class="cx">     });
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -688,7 +742,7 @@
</span><span class="cx">     RefPtr&lt;WebVideoFullscreenInterfaceAVKit&gt; strongThis(this);
</span><span class="cx">     
</span><span class="cx">     dispatch_async(dispatch_get_main_queue(), [strongThis, isPlaying, playbackRate] {
</span><del>-        strongThis-&gt;playerController().rate = isPlaying ? playbackRate : 0.;
</del><ins>+        [strongThis-&gt;m_playerController setRate:isPlaying ? playbackRate : 0.];
</ins><span class="cx">     });
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -697,8 +751,8 @@
</span><span class="cx">     RefPtr&lt;WebVideoFullscreenInterfaceAVKit&gt; strongThis(this);
</span><span class="cx">     
</span><span class="cx">     dispatch_async(dispatch_get_main_queue(), [strongThis, hasVideo, width, height] {
</span><del>-        strongThis-&gt;playerController().hasEnabledVideo = hasVideo;
-        strongThis-&gt;playerController().contentDimensions = CGSizeMake(width, height);
</del><ins>+        [strongThis-&gt;m_playerController setHasEnabledVideo:hasVideo];
+        [strongThis-&gt;m_playerController setContentDimensions:CGSizeMake(width, height)];
</ins><span class="cx">     });
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -718,7 +772,7 @@
</span><span class="cx">     RefPtr&lt;WebVideoFullscreenInterfaceAVKit&gt; strongThis(this);
</span><span class="cx">     
</span><span class="cx">     dispatch_async(dispatch_get_main_queue(), [strongThis, seekableRanges] {
</span><del>-        strongThis-&gt;playerController().seekableTimeRanges = seekableRanges.get();
</del><ins>+        [strongThis-&gt;m_playerController setSeekableTimeRanges:seekableRanges.get()];
</ins><span class="cx">     });
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -727,7 +781,7 @@
</span><span class="cx">     RefPtr&lt;WebVideoFullscreenInterfaceAVKit&gt; strongThis(this);
</span><span class="cx">     
</span><span class="cx">     dispatch_async(dispatch_get_main_queue(), [strongThis, canPlayFastReverse] {
</span><del>-        strongThis-&gt;playerController().canScanBackward = canPlayFastReverse;
</del><ins>+        [strongThis-&gt;m_playerController setCanScanBackward:canPlayFastReverse];
</ins><span class="cx">     });
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -748,9 +802,9 @@
</span><span class="cx">     RefPtr&lt;WebVideoFullscreenInterfaceAVKit&gt; strongThis(this);
</span><span class="cx">     
</span><span class="cx">     dispatch_async(dispatch_get_main_queue(), [webOptions, strongThis, selectedIndex] {
</span><del>-        strongThis-&gt;playerController().audioMediaSelectionOptions = webOptions.get();
</del><ins>+        [strongThis-&gt;m_playerController setAudioMediaSelectionOptions:webOptions.get()];
</ins><span class="cx">         if (selectedIndex &lt; [webOptions count])
</span><del>-            strongThis-&gt;playerController().currentAudioMediaSelectionOption = [webOptions objectAtIndex:static_cast&lt;NSUInteger&gt;(selectedIndex)];
</del><ins>+            [strongThis-&gt;m_playerController setCurrentAudioMediaSelectionOption:[webOptions objectAtIndex:static_cast&lt;NSUInteger&gt;(selectedIndex)]];
</ins><span class="cx">     });
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -760,9 +814,9 @@
</span><span class="cx">     RefPtr&lt;WebVideoFullscreenInterfaceAVKit&gt; strongThis(this);
</span><span class="cx"> 
</span><span class="cx">     dispatch_async(dispatch_get_main_queue(), [webOptions, strongThis, selectedIndex] {
</span><del>-        strongThis-&gt;playerController().legibleMediaSelectionOptions = webOptions.get();
</del><ins>+        [strongThis-&gt;m_playerController setLegibleMediaSelectionOptions:webOptions.get()];
</ins><span class="cx">         if (selectedIndex &lt; [webOptions count])
</span><del>-            strongThis-&gt;playerController().currentLegibleMediaSelectionOption = [webOptions objectAtIndex:static_cast&lt;NSUInteger&gt;(selectedIndex)];
</del><ins>+            [strongThis-&gt;m_playerController setCurrentLegibleMediaSelectionOption:[webOptions objectAtIndex:static_cast&lt;NSUInteger&gt;(selectedIndex)]];
</ins><span class="cx">     });
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -777,7 +831,7 @@
</span><span class="cx">     RefPtr&lt;WebVideoFullscreenInterfaceAVKit&gt; strongThis(this);
</span><span class="cx"> 
</span><span class="cx">     dispatch_async(dispatch_get_main_queue(), [strongThis, enabled, localizedDeviceName, externalPlaybackType] {
</span><del>-        WebAVPlayerController* playerController = strongThis-&gt;playerController();
</del><ins>+        WebAVPlayerController* playerController = strongThis-&gt;m_playerController.get();
</ins><span class="cx">         playerController.externalPlaybackAirPlayDeviceLocalizedName = localizedDeviceName;
</span><span class="cx">         playerController.externalPlaybackType = externalPlaybackType;
</span><span class="cx">         playerController.externalPlaybackActive = enabled;
</span><span class="lines">@@ -821,17 +875,17 @@
</span><span class="cx">     [m_videoLayer removeFromSuperlayer];
</span><span class="cx"> 
</span><span class="cx">     m_videoLayerContainer = [WebAVVideoLayer videoLayer];
</span><del>-    [m_videoLayerContainer setHidden:playerController().externalPlaybackActive];
</del><ins>+    [m_videoLayerContainer setHidden:[m_playerController isExternalPlaybackActive]];
</ins><span class="cx">     [m_videoLayerContainer setVideoSublayer:m_videoLayer.get()];
</span><span class="cx"> 
</span><del>-    CGSize videoSize = playerController().contentDimensions;
</del><ins>+    CGSize videoSize = [m_playerController contentDimensions];
</ins><span class="cx">     CGRect videoRect = CGRectMake(0, 0, videoSize.width, videoSize.height);
</span><span class="cx">     [m_videoLayerContainer setVideoRect:videoRect];
</span><span class="cx"> 
</span><span class="cx">     m_playerViewController = adoptNS([allocAVPlayerViewControllerInstance() initWithVideoLayer:m_videoLayerContainer.get()]);
</span><span class="cx">     [m_playerViewController setShowsPlaybackControls:NO];
</span><del>-    [m_playerViewController setPlayerController:(AVPlayerController *)playerController()];
-    [m_playerViewController setDelegate:playerController()];
</del><ins>+    [m_playerViewController setPlayerController:(AVPlayerController *)m_playerController.get()];
+    [m_playerViewController setDelegate:m_playerController.get()];
</ins><span class="cx">     [m_playerViewController setAllowsOptimizedFullscreen:allowOptimizedFullscreen];
</span><span class="cx"> 
</span><span class="cx">     [m_videoLayerContainer setPlayerViewController:m_playerViewController.get()];
</span><span class="lines">@@ -1015,18 +1069,31 @@
</span><span class="cx">         if (m_parentWindow)
</span><span class="cx">             [[getUIApplicationClass() sharedApplication] _setStatusBarOrientation:[m_parentWindow interfaceOrientation]];
</span><span class="cx">     }
</span><ins>+    
+    [m_playerController setDelegate:nil];
+    [m_playerController setFullscreenInterface:nil];
+    
</ins><span class="cx">     [m_playerViewController setDelegate:nil];
</span><ins>+    [m_playerViewController setPlayerController:nil];
+    
+    if (m_mode &amp; HTMLMediaElement::VideoFullscreenModeOptimized)
+        [m_playerViewController cancelOptimizedFullscreen];
+    if (m_mode &amp; HTMLMediaElement::VideoFullscreenModeStandard)
+        [m_playerViewController exitFullScreenAnimated:NO completionHandler:nil];
+    
</ins><span class="cx">     [[m_playerViewController view] removeFromSuperview];
</span><span class="cx">     if (m_viewController)
</span><span class="cx">         [m_playerViewController removeFromParentViewController];
</span><del>-    [m_playerViewController setPlayerController:nil];
-    m_playerViewController = nil;
</del><ins>+    
</ins><span class="cx">     [m_videoLayer removeFromSuperlayer];
</span><del>-    m_videoLayer = nil;
</del><span class="cx">     [m_videoLayerContainer removeFromSuperlayer];
</span><span class="cx">     [m_videoLayerContainer setPlayerViewController:nil];
</span><ins>+    [[m_viewController view] removeFromSuperview];
+    
+    m_videoLayer = nil;
</ins><span class="cx">     m_videoLayerContainer = nil;
</span><del>-    [[m_viewController view] removeFromSuperview];
</del><ins>+    m_playerViewController = nil;
+    m_playerController = nil;
</ins><span class="cx">     m_viewController = nil;
</span><span class="cx">     m_window = nil;
</span><span class="cx">     m_parentView = nil;
</span><span class="lines">@@ -1042,31 +1109,10 @@
</span><span class="cx"> 
</span><span class="cx"> void WebVideoFullscreenInterfaceAVKit::invalidate()
</span><span class="cx"> {
</span><del>-    [m_window setHidden:YES];
-    [m_window setRootViewController:nil];
-    m_window = nil;
</del><span class="cx">     m_videoFullscreenModel = nil;
</span><del>-    if (m_mode &amp; HTMLMediaElement::VideoFullscreenModeOptimized)
-        [m_playerViewController cancelOptimizedFullscreen];
-    if (m_mode &amp; HTMLMediaElement::VideoFullscreenModeStandard)
-        [m_playerViewController exitFullScreenAnimated:NO completionHandler:nil];
-    m_playerController = nil;
-    [m_playerViewController setDelegate:nil];
-    [[m_playerViewController view] removeFromSuperview];
-    if (m_viewController)
-        [m_playerViewController removeFromParentViewController];
-    [m_playerViewController setPlayerController:nil];
-    m_playerViewController = nil;
-    [m_videoLayer removeFromSuperlayer];
-    m_videoLayer = nil;
-    [m_videoLayerContainer removeFromSuperlayer];
-    [m_videoLayerContainer setPlayerViewController:nil];
-    m_videoLayerContainer = nil;
-    [[m_viewController view] removeFromSuperview];
-    [m_playerController setFullscreenInterface:nil];
-    m_viewController = nil;
-    m_parentView = nil;
-    m_parentWindow = nil;
</del><ins>+    m_fullscreenChangeObserver = nil;
+    
+    cleanupFullscreenInternal();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WebVideoFullscreenInterfaceAVKit::requestHideAndExitFullscreen()
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformiosWebVideoFullscreenModelVideoElementmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/ios/WebVideoFullscreenModelVideoElement.mm (179479 => 179480)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ios/WebVideoFullscreenModelVideoElement.mm        2015-02-02 19:05:46 UTC (rev 179479)
+++ trunk/Source/WebCore/platform/ios/WebVideoFullscreenModelVideoElement.mm        2015-02-02 19:40:57 UTC (rev 179480)
</span><span class="lines">@@ -67,6 +67,9 @@
</span><span class="cx">     if (m_videoElement == videoElement)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><ins>+    if (m_videoFullscreenInterface)
+        m_videoFullscreenInterface-&gt;resetMediaState();
+    
</ins><span class="cx">     if (m_videoElement &amp;&amp; m_isListening) {
</span><span class="cx">         for (auto eventName : observedEventNames())
</span><span class="cx">             m_videoElement-&gt;removeEventListener(eventName, this, false);
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (179479 => 179480)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2015-02-02 19:05:46 UTC (rev 179479)
+++ trunk/Source/WebKit2/ChangeLog        2015-02-02 19:40:57 UTC (rev 179480)
</span><span class="lines">@@ -1,3 +1,19 @@
</span><ins>+2015-02-02  Jeremy Jones  &lt;jeremyj@apple.com&gt;
+
+        Prevent crash when accessing WebAVPlayerController.delegate.
+        https://bugs.webkit.org/show_bug.cgi?id=140893
+
+        Reviewed by Darin Adler.
+
+        Plumb new resetMediaState() through IPC interface WebVideoFullscreenManagerProxy.
+
+        * UIProcess/ios/WebVideoFullscreenManagerProxy.messages.in:
+        * UIProcess/ios/WebVideoFullscreenManagerProxy.mm:
+        (WebKit::WebVideoFullscreenManagerProxy::invalidate): remove redundant set to nullptr.
+        * WebProcess/ios/WebVideoFullscreenManager.h:
+        * WebProcess/ios/WebVideoFullscreenManager.mm:
+        (WebKit::WebVideoFullscreenManager::resetMediaState):
+
</ins><span class="cx"> 2015-02-01  Chris Dumez  &lt;cdumez@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Use more references in HistoryItem
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessiosWebVideoFullscreenManagerProxymessagesin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/ios/WebVideoFullscreenManagerProxy.messages.in (179479 => 179480)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/ios/WebVideoFullscreenManagerProxy.messages.in        2015-02-02 19:05:46 UTC (rev 179479)
+++ trunk/Source/WebKit2/UIProcess/ios/WebVideoFullscreenManagerProxy.messages.in        2015-02-02 19:40:57 UTC (rev 179480)
</span><span class="lines">@@ -22,6 +22,7 @@
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx"> messages -&gt; WebVideoFullscreenManagerProxy {
</span><ins>+    ResetMediaState()
</ins><span class="cx">     SetCurrentTime(double currentTime, double hostTime)
</span><span class="cx">     SetVideoDimensions(bool hasVideo, unsigned width, unsigned height)
</span><span class="cx">     SetSeekableRangesVector(Vector&lt;std::pair&lt;double, double&gt;&gt; ranges);
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessiosWebVideoFullscreenManagerProxymm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/ios/WebVideoFullscreenManagerProxy.mm (179479 => 179480)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/ios/WebVideoFullscreenManagerProxy.mm        2015-02-02 19:05:46 UTC (rev 179479)
+++ trunk/Source/WebKit2/UIProcess/ios/WebVideoFullscreenManagerProxy.mm        2015-02-02 19:40:57 UTC (rev 179480)
</span><span class="lines">@@ -68,9 +68,6 @@
</span><span class="cx"> {
</span><span class="cx">     WebVideoFullscreenInterfaceAVKit::invalidate();
</span><span class="cx"> 
</span><del>-    setWebVideoFullscreenModel(nullptr);
-    setWebVideoFullscreenChangeObserver(nullptr);
-
</del><span class="cx">     m_page-&gt;process().removeMessageReceiver(Messages::WebVideoFullscreenManagerProxy::messageReceiverName(), m_page-&gt;pageID());
</span><span class="cx">     m_page = nullptr;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessiosWebVideoFullscreenManagerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/ios/WebVideoFullscreenManager.h (179479 => 179480)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/ios/WebVideoFullscreenManager.h        2015-02-02 19:05:46 UTC (rev 179479)
+++ trunk/Source/WebKit2/WebProcess/ios/WebVideoFullscreenManager.h        2015-02-02 19:40:57 UTC (rev 179480)
</span><span class="lines">@@ -68,6 +68,7 @@
</span><span class="cx">     virtual bool operator==(const EventListener&amp; rhs) override { return static_cast&lt;WebCore::EventListener*&gt;(this) == &amp;rhs; }
</span><span class="cx">     
</span><span class="cx">     // FullscreenInterface
</span><ins>+    virtual void resetMediaState() override;
</ins><span class="cx">     virtual void setDuration(double) override;
</span><span class="cx">     virtual void setCurrentTime(double currentTime, double anchorTime) override;
</span><span class="cx">     virtual void setRate(bool isPlaying, float playbackRate) override;
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessiosWebVideoFullscreenManagermm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/ios/WebVideoFullscreenManager.mm (179479 => 179480)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/ios/WebVideoFullscreenManager.mm        2015-02-02 19:05:46 UTC (rev 179479)
+++ trunk/Source/WebKit2/WebProcess/ios/WebVideoFullscreenManager.mm        2015-02-02 19:40:57 UTC (rev 179480)
</span><span class="lines">@@ -119,6 +119,11 @@
</span><span class="cx">     m_page-&gt;send(Messages::WebVideoFullscreenManagerProxy::ExitFullscreen(clientRectForElement(videoElement.get())), m_page-&gt;pageID());
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void WebVideoFullscreenManager::resetMediaState()
+{
+    m_page-&gt;send(Messages::WebVideoFullscreenManagerProxy::ResetMediaState(), m_page-&gt;pageID());
+}
+    
</ins><span class="cx"> void WebVideoFullscreenManager::setDuration(double duration)
</span><span class="cx"> {
</span><span class="cx">     m_page-&gt;send(Messages::WebVideoFullscreenManagerProxy::SetDuration(duration), m_page-&gt;pageID());
</span></span></pre>
</div>
</div>

</body>
</html>