<!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>[243581] branches/safari-607-branch/Source/WebCore</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/243581">243581</a></dd>
<dt>Author</dt> <dd>alancoon@apple.com</dd>
<dt>Date</dt> <dd>2019-03-27 16:44:04 -0700 (Wed, 27 Mar 2019)</dd>
</dl>

<h3>Log Message</h3>
<pre>Cherry-pick <a href="http://trac.webkit.org/projects/webkit/changeset/243337">r243337</a>. rdar://problem/49307958

    Hardening: Use WeakPtrs in PlaybackSessionInterface{Mac,AVKit}
    https://bugs.webkit.org/show_bug.cgi?id=195935
    <rdar://problem/49007015>

    Reviewed by Eric Carlson.

    The PlaybackSessionInterface{Mac,AVKit} implementations store their playback session model
    and playback controls manager members as bare pointers, something we've been working
    to eliminate.

    This patch corrects this oversight.

    No new tests since no changes in behavior.

    * platform/cocoa/PlaybackSessionModel.h:
    * platform/ios/PlaybackSessionInterfaceAVKit.h:
    * platform/ios/PlaybackSessionInterfaceAVKit.mm:
    (WebCore::PlaybackSessionInterfaceAVKit::PlaybackSessionInterfaceAVKit):
    (WebCore::playbackSessionModel const): Moved to implementation since WEBCORE_EXPORT is not
    supposed to be used with inline methods.
    * platform/mac/PlaybackSessionInterfaceMac.h:
    * platform/mac/PlaybackSessionInterfaceMac.mm:
    (WebCore::PlaybackSessionInterfaceMac::PlaybackSessionInterfaceMac):
    (WebCore::PlaybackSessionInterfaceMac::playbackSessionModel const):
    (WebCore::PlaybackSessionInterfaceMac::beginScrubbing):
    (WebCore::PlaybackSessionInterfaceMac::endScrubbing):
    (WebCore::PlaybackSessionInterfaceMac::playBackControlsManager):
    * platform/mac/VideoFullscreenInterfaceMac.mm:
    (WebCore::VideoFullscreenInterfaceMac::~VideoFullscreenInterfaceMac):
    * platform/mac/WebPlaybackControlsManager.mm:
    (-[WebPlaybackControlsManager seekToTime:toleranceBefore:toleranceAfter:]):
    (-[WebPlaybackControlsManager setCurrentAudioTouchBarMediaSelectionOption:]):
    (-[WebPlaybackControlsManager setCurrentLegibleTouchBarMediaSelectionOption:]):

    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@243337 268f45cc-cd09-0410-ab3c-d52691b4dbfc</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#branchessafari607branchSourceWebCoreChangeLog">branches/safari-607-branch/Source/WebCore/ChangeLog</a></li>
<li><a href="#branchessafari607branchSourceWebCoreplatformcocoaPlaybackSessionModelh">branches/safari-607-branch/Source/WebCore/platform/cocoa/PlaybackSessionModel.h</a></li>
<li><a href="#branchessafari607branchSourceWebCoreplatformiosPlaybackSessionInterfaceAVKith">branches/safari-607-branch/Source/WebCore/platform/ios/PlaybackSessionInterfaceAVKit.h</a></li>
<li><a href="#branchessafari607branchSourceWebCoreplatformiosPlaybackSessionInterfaceAVKitmm">branches/safari-607-branch/Source/WebCore/platform/ios/PlaybackSessionInterfaceAVKit.mm</a></li>
<li><a href="#branchessafari607branchSourceWebCoreplatformmacPlaybackSessionInterfaceMach">branches/safari-607-branch/Source/WebCore/platform/mac/PlaybackSessionInterfaceMac.h</a></li>
<li><a href="#branchessafari607branchSourceWebCoreplatformmacPlaybackSessionInterfaceMacmm">branches/safari-607-branch/Source/WebCore/platform/mac/PlaybackSessionInterfaceMac.mm</a></li>
<li><a href="#branchessafari607branchSourceWebCoreplatformmacVideoFullscreenInterfaceMacmm">branches/safari-607-branch/Source/WebCore/platform/mac/VideoFullscreenInterfaceMac.mm</a></li>
<li><a href="#branchessafari607branchSourceWebCoreplatformmacWebPlaybackControlsManagermm">branches/safari-607-branch/Source/WebCore/platform/mac/WebPlaybackControlsManager.mm</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="branchessafari607branchSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-607-branch/Source/WebCore/ChangeLog (243580 => 243581)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-607-branch/Source/WebCore/ChangeLog      2019-03-27 23:44:01 UTC (rev 243580)
+++ branches/safari-607-branch/Source/WebCore/ChangeLog 2019-03-27 23:44:04 UTC (rev 243581)
</span><span class="lines">@@ -1,5 +1,81 @@
</span><span class="cx"> 2019-03-27  Alan Coon  <alancoon@apple.com>
</span><span class="cx"> 
</span><ins>+        Cherry-pick r243337. rdar://problem/49307958
+
+    Hardening: Use WeakPtrs in PlaybackSessionInterface{Mac,AVKit}
+    https://bugs.webkit.org/show_bug.cgi?id=195935
+    <rdar://problem/49007015>
+    
+    Reviewed by Eric Carlson.
+    
+    The PlaybackSessionInterface{Mac,AVKit} implementations store their playback session model
+    and playback controls manager members as bare pointers, something we've been working
+    to eliminate.
+    
+    This patch corrects this oversight.
+    
+    No new tests since no changes in behavior.
+    
+    * platform/cocoa/PlaybackSessionModel.h:
+    * platform/ios/PlaybackSessionInterfaceAVKit.h:
+    * platform/ios/PlaybackSessionInterfaceAVKit.mm:
+    (WebCore::PlaybackSessionInterfaceAVKit::PlaybackSessionInterfaceAVKit):
+    (WebCore::playbackSessionModel const): Moved to implementation since WEBCORE_EXPORT is not
+    supposed to be used with inline methods.
+    * platform/mac/PlaybackSessionInterfaceMac.h:
+    * platform/mac/PlaybackSessionInterfaceMac.mm:
+    (WebCore::PlaybackSessionInterfaceMac::PlaybackSessionInterfaceMac):
+    (WebCore::PlaybackSessionInterfaceMac::playbackSessionModel const):
+    (WebCore::PlaybackSessionInterfaceMac::beginScrubbing):
+    (WebCore::PlaybackSessionInterfaceMac::endScrubbing):
+    (WebCore::PlaybackSessionInterfaceMac::playBackControlsManager):
+    * platform/mac/VideoFullscreenInterfaceMac.mm:
+    (WebCore::VideoFullscreenInterfaceMac::~VideoFullscreenInterfaceMac):
+    * platform/mac/WebPlaybackControlsManager.mm:
+    (-[WebPlaybackControlsManager seekToTime:toleranceBefore:toleranceAfter:]):
+    (-[WebPlaybackControlsManager setCurrentAudioTouchBarMediaSelectionOption:]):
+    (-[WebPlaybackControlsManager setCurrentLegibleTouchBarMediaSelectionOption:]):
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@243337 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2019-03-21  Brent Fulgham  <bfulgham@apple.com>
+
+            Hardening: Use WeakPtrs in PlaybackSessionInterface{Mac,AVKit}
+            https://bugs.webkit.org/show_bug.cgi?id=195935
+            <rdar://problem/49007015>
+
+            Reviewed by Eric Carlson.
+
+            The PlaybackSessionInterface{Mac,AVKit} implementations store their playback session model
+            and playback controls manager members as bare pointers, something we've been working
+            to eliminate.
+
+            This patch corrects this oversight.
+
+            No new tests since no changes in behavior.
+
+            * platform/cocoa/PlaybackSessionModel.h:
+            * platform/ios/PlaybackSessionInterfaceAVKit.h:
+            * platform/ios/PlaybackSessionInterfaceAVKit.mm:
+            (WebCore::PlaybackSessionInterfaceAVKit::PlaybackSessionInterfaceAVKit):
+            (WebCore::playbackSessionModel const): Moved to implementation since WEBCORE_EXPORT is not
+            supposed to be used with inline methods.
+            * platform/mac/PlaybackSessionInterfaceMac.h:
+            * platform/mac/PlaybackSessionInterfaceMac.mm:
+            (WebCore::PlaybackSessionInterfaceMac::PlaybackSessionInterfaceMac):
+            (WebCore::PlaybackSessionInterfaceMac::playbackSessionModel const):
+            (WebCore::PlaybackSessionInterfaceMac::beginScrubbing):
+            (WebCore::PlaybackSessionInterfaceMac::endScrubbing):
+            (WebCore::PlaybackSessionInterfaceMac::playBackControlsManager):
+            * platform/mac/VideoFullscreenInterfaceMac.mm:
+            (WebCore::VideoFullscreenInterfaceMac::~VideoFullscreenInterfaceMac):
+            * platform/mac/WebPlaybackControlsManager.mm:
+            (-[WebPlaybackControlsManager seekToTime:toleranceBefore:toleranceAfter:]):
+            (-[WebPlaybackControlsManager setCurrentAudioTouchBarMediaSelectionOption:]):
+            (-[WebPlaybackControlsManager setCurrentLegibleTouchBarMediaSelectionOption:]):
+
+2019-03-27  Alan Coon  <alancoon@apple.com>
+
</ins><span class="cx">         Cherry-pick r243331. rdar://problem/49308068
</span><span class="cx"> 
</span><span class="cx">     Do not insert the first-letter anonymous container until after we've constructed the first-letter renderer.
</span></span></pre></div>
<a id="branchessafari607branchSourceWebCoreplatformcocoaPlaybackSessionModelh"></a>
<div class="modfile"><h4>Modified: branches/safari-607-branch/Source/WebCore/platform/cocoa/PlaybackSessionModel.h (243580 => 243581)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-607-branch/Source/WebCore/platform/cocoa/PlaybackSessionModel.h  2019-03-27 23:44:01 UTC (rev 243580)
+++ branches/safari-607-branch/Source/WebCore/platform/cocoa/PlaybackSessionModel.h     2019-03-27 23:44:04 UTC (rev 243581)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2016-2017 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2016-2019 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -30,6 +30,7 @@
</span><span class="cx"> #include <wtf/Forward.h>
</span><span class="cx"> #include <wtf/Ref.h>
</span><span class="cx"> #include <wtf/Vector.h>
</span><ins>+#include <wtf/WeakPtr.h>
</ins><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="lines">@@ -37,7 +38,7 @@
</span><span class="cx"> class PlaybackSessionModelClient;
</span><span class="cx"> struct MediaSelectionOption;
</span><span class="cx"> 
</span><del>-class PlaybackSessionModel {
</del><ins>+class PlaybackSessionModel : public CanMakeWeakPtr<PlaybackSessionModel> {
</ins><span class="cx"> public:
</span><span class="cx">     virtual ~PlaybackSessionModel() { };
</span><span class="cx">     virtual void addClient(PlaybackSessionModelClient&) = 0;
</span></span></pre></div>
<a id="branchessafari607branchSourceWebCoreplatformiosPlaybackSessionInterfaceAVKith"></a>
<div class="modfile"><h4>Modified: branches/safari-607-branch/Source/WebCore/platform/ios/PlaybackSessionInterfaceAVKit.h (243580 => 243581)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-607-branch/Source/WebCore/platform/ios/PlaybackSessionInterfaceAVKit.h   2019-03-27 23:44:01 UTC (rev 243580)
+++ branches/safari-607-branch/Source/WebCore/platform/ios/PlaybackSessionInterfaceAVKit.h      2019-03-27 23:44:04 UTC (rev 243581)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2016-2018 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2016-2019 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -62,7 +62,7 @@
</span><span class="cx">         return adoptRef(*new PlaybackSessionInterfaceAVKit(model));
</span><span class="cx">     }
</span><span class="cx">     virtual ~PlaybackSessionInterfaceAVKit();
</span><del>-    PlaybackSessionModel* playbackSessionModel() const { return m_playbackSessionModel; }
</del><ins>+    PlaybackSessionModel* playbackSessionModel() const;
</ins><span class="cx"> 
</span><span class="cx">     // PlaybackSessionModelClient
</span><span class="cx">     WEBCORE_EXPORT void durationChanged(double) override;
</span><span class="lines">@@ -86,7 +86,7 @@
</span><span class="cx">     WEBCORE_EXPORT PlaybackSessionInterfaceAVKit(PlaybackSessionModel&);
</span><span class="cx"> 
</span><span class="cx">     RetainPtr<WebAVPlayerController> m_playerController;
</span><del>-    PlaybackSessionModel* m_playbackSessionModel { nullptr };
</del><ins>+    WeakPtr<PlaybackSessionModel> m_playbackSessionModel;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> }
</span></span></pre></div>
<a id="branchessafari607branchSourceWebCoreplatformiosPlaybackSessionInterfaceAVKitmm"></a>
<div class="modfile"><h4>Modified: branches/safari-607-branch/Source/WebCore/platform/ios/PlaybackSessionInterfaceAVKit.mm (243580 => 243581)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-607-branch/Source/WebCore/platform/ios/PlaybackSessionInterfaceAVKit.mm  2019-03-27 23:44:01 UTC (rev 243580)
+++ branches/safari-607-branch/Source/WebCore/platform/ios/PlaybackSessionInterfaceAVKit.mm     2019-03-27 23:44:04 UTC (rev 243581)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2014, 2015 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2014-2019 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -51,7 +51,7 @@
</span><span class="cx"> 
</span><span class="cx"> PlaybackSessionInterfaceAVKit::PlaybackSessionInterfaceAVKit(PlaybackSessionModel& model)
</span><span class="cx">     : m_playerController(adoptNS([[WebAVPlayerController alloc] init]))
</span><del>-    , m_playbackSessionModel(&model)
</del><ins>+    , m_playbackSessionModel(makeWeakPtr(model))
</ins><span class="cx"> {
</span><span class="cx">     model.addClient(*this);
</span><span class="cx">     [m_playerController setPlaybackSessionInterface:this];
</span><span class="lines">@@ -77,6 +77,11 @@
</span><span class="cx">     invalidate();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+PlaybackSessionModel* playbackSessionModel() const
+{
+    return m_playbackSessionModel.get();
+}
+
</ins><span class="cx"> void PlaybackSessionInterfaceAVKit::durationChanged(double duration)
</span><span class="cx"> {
</span><span class="cx">     WebAVPlayerController* playerController = m_playerController.get();
</span></span></pre></div>
<a id="branchessafari607branchSourceWebCoreplatformmacPlaybackSessionInterfaceMach"></a>
<div class="modfile"><h4>Modified: branches/safari-607-branch/Source/WebCore/platform/mac/PlaybackSessionInterfaceMac.h (243580 => 243581)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-607-branch/Source/WebCore/platform/mac/PlaybackSessionInterfaceMac.h     2019-03-27 23:44:01 UTC (rev 243580)
+++ branches/safari-607-branch/Source/WebCore/platform/mac/PlaybackSessionInterfaceMac.h        2019-03-27 23:44:04 UTC (rev 243581)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2016-2017 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2016-2019 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -32,6 +32,8 @@
</span><span class="cx"> #include "PlaybackSessionModel.h"
</span><span class="cx"> #include <wtf/RefCounted.h>
</span><span class="cx"> #include <wtf/RetainPtr.h>
</span><ins>+#include <wtf/WeakObjCPtr.h>
+#include <wtf/WeakPtr.h>
</ins><span class="cx"> #include <wtf/text/WTFString.h>
</span><span class="cx"> 
</span><span class="cx"> OBJC_CLASS WebPlaybackControlsManager;
</span><span class="lines">@@ -74,9 +76,9 @@
</span><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     PlaybackSessionInterfaceMac(PlaybackSessionModel&);
</span><del>-    PlaybackSessionModel* m_playbackSessionModel { nullptr };
</del><ins>+    WeakPtr<PlaybackSessionModel> m_playbackSessionModel;
</ins><span class="cx"> #if ENABLE(WEB_PLAYBACK_CONTROLS_MANAGER)
</span><del>-    WebPlaybackControlsManager *m_playbackControlsManager  { nullptr };
</del><ins>+    WeakObjCPtr<WebPlaybackControlsManager> m_playbackControlsManager;
</ins><span class="cx"> 
</span><span class="cx">     void updatePlaybackControlsManagerTiming(double currentTime, double anchorTime, double playbackRate, bool isPlaying);
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="branchessafari607branchSourceWebCoreplatformmacPlaybackSessionInterfaceMacmm"></a>
<div class="modfile"><h4>Modified: branches/safari-607-branch/Source/WebCore/platform/mac/PlaybackSessionInterfaceMac.mm (243580 => 243581)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-607-branch/Source/WebCore/platform/mac/PlaybackSessionInterfaceMac.mm    2019-03-27 23:44:01 UTC (rev 243580)
+++ branches/safari-607-branch/Source/WebCore/platform/mac/PlaybackSessionInterfaceMac.mm       2019-03-27 23:44:04 UTC (rev 243581)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2016-2017 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2016-2019 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -52,7 +52,7 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> PlaybackSessionInterfaceMac::PlaybackSessionInterfaceMac(PlaybackSessionModel& model)
</span><del>-    : m_playbackSessionModel(&model)
</del><ins>+    : m_playbackSessionModel(makeWeakPtr(model))
</ins><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -63,7 +63,7 @@
</span><span class="cx"> 
</span><span class="cx"> PlaybackSessionModel* PlaybackSessionInterfaceMac::playbackSessionModel() const
</span><span class="cx"> {
</span><del>-    return m_playbackSessionModel;
</del><ins>+    return m_playbackSessionModel.get();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void PlaybackSessionInterfaceMac::durationChanged(double duration)
</span><span class="lines">@@ -110,12 +110,14 @@
</span><span class="cx"> #if ENABLE(WEB_PLAYBACK_CONTROLS_MANAGER)
</span><span class="cx">     updatePlaybackControlsManagerTiming(m_playbackSessionModel ? m_playbackSessionModel->currentTime() : 0, [[NSProcessInfo processInfo] systemUptime], 0, false);
</span><span class="cx"> #endif
</span><del>-    playbackSessionModel()->beginScrubbing();
</del><ins>+    if (auto* model = playbackSessionModel())
+        model->beginScrubbing();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void PlaybackSessionInterfaceMac::endScrubbing()
</span><span class="cx"> {
</span><del>-    playbackSessionModel()->endScrubbing();
</del><ins>+    if (auto* model = playbackSessionModel())
+        model->endScrubbing();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(WEB_PLAYBACK_CONTROLS_MANAGER)
</span><span class="lines">@@ -214,7 +216,7 @@
</span><span class="cx"> 
</span><span class="cx"> WebPlaybackControlsManager *PlaybackSessionInterfaceMac::playBackControlsManager()
</span><span class="cx"> {
</span><del>-    return m_playbackControlsManager;
</del><ins>+    return m_playbackControlsManager.getAutoreleased();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void PlaybackSessionInterfaceMac::setPlayBackControlsManager(WebPlaybackControlsManager *manager)
</span></span></pre></div>
<a id="branchessafari607branchSourceWebCoreplatformmacVideoFullscreenInterfaceMacmm"></a>
<div class="modfile"><h4>Modified: branches/safari-607-branch/Source/WebCore/platform/mac/VideoFullscreenInterfaceMac.mm (243580 => 243581)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-607-branch/Source/WebCore/platform/mac/VideoFullscreenInterfaceMac.mm    2019-03-27 23:44:01 UTC (rev 243580)
+++ branches/safari-607-branch/Source/WebCore/platform/mac/VideoFullscreenInterfaceMac.mm       2019-03-27 23:44:04 UTC (rev 243581)
</span><span class="lines">@@ -366,8 +366,8 @@
</span><span class="cx"> 
</span><span class="cx"> VideoFullscreenInterfaceMac::~VideoFullscreenInterfaceMac()
</span><span class="cx"> {
</span><del>-    if (m_playbackSessionInterface->playbackSessionModel())
-        m_playbackSessionInterface->playbackSessionModel()->removeClient(*this);
</del><ins>+    if (auto* model = m_playbackSessionInterface->playbackSessionModel())
+        model->removeClient(*this);
</ins><span class="cx">     if (m_videoFullscreenModel)
</span><span class="cx">         m_videoFullscreenModel->removeClient(*this);
</span><span class="cx"> }
</span></span></pre></div>
<a id="branchessafari607branchSourceWebCoreplatformmacWebPlaybackControlsManagermm"></a>
<div class="modfile"><h4>Modified: branches/safari-607-branch/Source/WebCore/platform/mac/WebPlaybackControlsManager.mm (243580 => 243581)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-607-branch/Source/WebCore/platform/mac/WebPlaybackControlsManager.mm     2019-03-27 23:44:01 UTC (rev 243580)
+++ branches/safari-607-branch/Source/WebCore/platform/mac/WebPlaybackControlsManager.mm        2019-03-27 23:44:04 UTC (rev 243581)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2016-2017 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2016-2019 Apple Inc. All rights reserved.
</ins><span class="cx">  * 
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -94,7 +94,8 @@
</span><span class="cx"> {
</span><span class="cx">     UNUSED_PARAM(toleranceBefore);
</span><span class="cx">     UNUSED_PARAM(toleranceAfter);
</span><del>-    _playbackSessionInterfaceMac->playbackSessionModel()->seekToTime(time);
</del><ins>+    if (auto* model = _playbackSessionInterfaceMac->playbackSessionModel())
+        model->seekToTime(time);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (void)cancelThumbnailAndAudioAmplitudeSampleGeneration
</span><span class="lines">@@ -193,7 +194,8 @@
</span><span class="cx">     if (audioMediaSelectionOption && _audioTouchBarMediaSelectionOptions)
</span><span class="cx">         index = [_audioTouchBarMediaSelectionOptions indexOfObject:audioMediaSelectionOption];
</span><span class="cx"> 
</span><del>-    _playbackSessionInterfaceMac->playbackSessionModel()->selectAudioMediaOption(index != NSNotFound ? index : UINT64_MAX);
</del><ins>+    if (auto* model = _playbackSessionInterfaceMac->playbackSessionModel())
+        model->selectAudioMediaOption(index != NSNotFound ? index : UINT64_MAX);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (NSArray<AVTouchBarMediaSelectionOption *> *)legibleTouchBarMediaSelectionOptions
</span><span class="lines">@@ -223,7 +225,8 @@
</span><span class="cx">     if (legibleMediaSelectionOption && _legibleTouchBarMediaSelectionOptions)
</span><span class="cx">         index = [_legibleTouchBarMediaSelectionOptions indexOfObject:legibleMediaSelectionOption];
</span><span class="cx"> 
</span><del>-    _playbackSessionInterfaceMac->playbackSessionModel()->selectLegibleMediaOption(index != NSNotFound ? index : UINT64_MAX);
</del><ins>+    if (auto* model = _playbackSessionInterfaceMac->playbackSessionModel())
+        model->selectLegibleMediaOption(index != NSNotFound ? index : UINT64_MAX);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101300
</span></span></pre>
</div>
</div>

</body>
</html>