<!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>[190792] branches/safari-601.1.46-branch</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/190792">190792</a></dd>
<dt>Author</dt> <dd>matthew_hanson@apple.com</dd>
<dt>Date</dt> <dd>2015-10-09 07:21:50 -0700 (Fri, 09 Oct 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>Merge <a href="http://trac.webkit.org/projects/webkit/changeset/190434">r190434</a>. rdar://problem/22865007</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#branchessafari601146branchLayoutTestsChangeLog">branches/safari-601.1.46-branch/LayoutTests/ChangeLog</a></li>
<li><a href="#branchessafari601146branchLayoutTestsmediavideointerruptionwithresumeallowingplayexpectedtxt">branches/safari-601.1.46-branch/LayoutTests/media/video-interruption-with-resume-allowing-play-expected.txt</a></li>
<li><a href="#branchessafari601146branchLayoutTestsmediavideointerruptionwithresumeallowingplayhtml">branches/safari-601.1.46-branch/LayoutTests/media/video-interruption-with-resume-allowing-play.html</a></li>
<li><a href="#branchessafari601146branchLayoutTestsmediavideointerruptionwithresumenotallowingplayexpectedtxt">branches/safari-601.1.46-branch/LayoutTests/media/video-interruption-with-resume-not-allowing-play-expected.txt</a></li>
<li><a href="#branchessafari601146branchLayoutTestsmediavideointerruptionwithresumenotallowingplayhtml">branches/safari-601.1.46-branch/LayoutTests/media/video-interruption-with-resume-not-allowing-play.html</a></li>
<li><a href="#branchessafari601146branchSourceWebCoreChangeLog">branches/safari-601.1.46-branch/Source/WebCore/ChangeLog</a></li>
<li><a href="#branchessafari601146branchSourceWebCoreModuleswebaudioAudioContexth">branches/safari-601.1.46-branch/Source/WebCore/Modules/webaudio/AudioContext.h</a></li>
<li><a href="#branchessafari601146branchSourceWebCorehtmlHTMLMediaElementcpp">branches/safari-601.1.46-branch/Source/WebCore/html/HTMLMediaElement.cpp</a></li>
<li><a href="#branchessafari601146branchSourceWebCorehtmlHTMLMediaElementh">branches/safari-601.1.46-branch/Source/WebCore/html/HTMLMediaElement.h</a></li>
<li><a href="#branchessafari601146branchSourceWebCoreplatformaudioPlatformMediaSessioncpp">branches/safari-601.1.46-branch/Source/WebCore/platform/audio/PlatformMediaSession.cpp</a></li>
<li><a href="#branchessafari601146branchSourceWebCoreplatformaudioPlatformMediaSessionh">branches/safari-601.1.46-branch/Source/WebCore/platform/audio/PlatformMediaSession.h</a></li>
<li><a href="#branchessafari601146branchSourceWebCoreplatformaudioPlatformMediaSessionManagercpp">branches/safari-601.1.46-branch/Source/WebCore/platform/audio/PlatformMediaSessionManager.cpp</a></li>
<li><a href="#branchessafari601146branchSourceWebCoreplatformaudioPlatformMediaSessionManagerh">branches/safari-601.1.46-branch/Source/WebCore/platform/audio/PlatformMediaSessionManager.h</a></li>
<li><a href="#branchessafari601146branchSourceWebCoreplatformaudioiosMediaSessionManagerIOSh">branches/safari-601.1.46-branch/Source/WebCore/platform/audio/ios/MediaSessionManagerIOS.h</a></li>
<li><a href="#branchessafari601146branchSourceWebCoreplatformaudioiosMediaSessionManagerIOSmm">branches/safari-601.1.46-branch/Source/WebCore/platform/audio/ios/MediaSessionManagerIOS.mm</a></li>
<li><a href="#branchessafari601146branchSourceWebCoretestingInternalscpp">branches/safari-601.1.46-branch/Source/WebCore/testing/Internals.cpp</a></li>
<li><a href="#branchessafari601146branchSourceWebCoretestingInternalsh">branches/safari-601.1.46-branch/Source/WebCore/testing/Internals.h</a></li>
<li><a href="#branchessafari601146branchSourceWebCoretestingInternalsidl">branches/safari-601.1.46-branch/Source/WebCore/testing/Internals.idl</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="branchessafari601146branchLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1.46-branch/LayoutTests/ChangeLog (190791 => 190792)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1.46-branch/LayoutTests/ChangeLog        2015-10-09 14:21:40 UTC (rev 190791)
+++ branches/safari-601.1.46-branch/LayoutTests/ChangeLog        2015-10-09 14:21:50 UTC (rev 190792)
</span><span class="lines">@@ -1,5 +1,20 @@
</span><span class="cx"> 2015-10-08  Matthew Hanson  &lt;matthew_hanson@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        Merge r190434. rdar://problem/22865007
+
+    2015-10-01  Eric Carlson  &lt;eric.carlson@apple.com&gt;
+
+            [iOS] AirPlay should not stop when the screen locks
+            https://bugs.webkit.org/show_bug.cgi?id=148315
+            &lt;rdar://problem/22770703&gt;
+
+            Reviewed by Jer Noble.
+
+            * media/video-interruption-with-resume-allowing-play.html:
+            * media/video-interruption-with-resume-not-allowing-play.html:
+
+2015-10-08  Matthew Hanson  &lt;matthew_hanson@apple.com&gt;
+
</ins><span class="cx">         Merge r189421. rdar://problem/22823243
</span><span class="cx"> 
</span><span class="cx">     2015-09-04  Myles C. Maxfield  &lt;mmaxfield@apple.com&gt;
</span><span class="lines">@@ -82,21 +97,25 @@
</span><span class="cx">             * webaudio/audiocontext-state-interrupted-expected.txt:
</span><span class="cx">             * webaudio/audiocontext-state-interrupted.html:
</span><span class="cx"> 
</span><del>-2015-10-02  Babak Shafiei  &lt;bshafiei@apple.com&gt;
</del><ins>+2015-10-08  Matthew Hanson  &lt;matthew_hanson@apple.com&gt;
</ins><span class="cx"> 
</span><del>-        Merge r190434.
</del><ins>+        Merge r190478. rdar://problem/22865007
</ins><span class="cx"> 
</span><del>-    2015-10-01  Eric Carlson  &lt;eric.carlson@apple.com&gt;
</del><ins>+    2015-10-02  Babak Shafiei  &lt;bshafiei@apple.com&gt;
</ins><span class="cx"> 
</span><del>-            [iOS] AirPlay should not stop when the screen locks
-            https://bugs.webkit.org/show_bug.cgi?id=148315
-            &lt;rdar://problem/22770703&gt;
</del><ins>+            Merge r190434.
</ins><span class="cx"> 
</span><del>-            Reviewed by Jer Noble.
</del><ins>+        2015-10-01  Eric Carlson  &lt;eric.carlson@apple.com&gt;
</ins><span class="cx"> 
</span><del>-            * media/video-interruption-with-resume-allowing-play.html:
-            * media/video-interruption-with-resume-not-allowing-play.html:
</del><ins>+                [iOS] AirPlay should not stop when the screen locks
+                https://bugs.webkit.org/show_bug.cgi?id=148315
+                &lt;rdar://problem/22770703&gt;
</ins><span class="cx"> 
</span><ins>+                Reviewed by Jer Noble.
+
+                * media/video-interruption-with-resume-allowing-play.html:
+                * media/video-interruption-with-resume-not-allowing-play.html:
+
</ins><span class="cx"> 2015-10-02  Babak Shafiei  &lt;bshafiei@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Merge r190375.
</span><span class="lines">@@ -125,7 +144,7 @@
</span><span class="cx">             Reviewed by Andreas Kling.
</span><span class="cx"> 
</span><span class="cx">             There are multiple variations of the same tests to test
</span><del>-            cases where we JIT and cases without JIT. 
</del><ins>+            cases where we JIT and cases without JIT.
</ins><span class="cx"> 
</span><span class="cx">             * fast/css/indirect-adjacent-style-invalidation-1-expected.txt: Added.
</span><span class="cx">             * fast/css/indirect-adjacent-style-invalidation-1.html: Added.
</span></span></pre></div>
<a id="branchessafari601146branchLayoutTestsmediavideointerruptionwithresumeallowingplayexpectedtxt"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1.46-branch/LayoutTests/media/video-interruption-with-resume-allowing-play-expected.txt (190791 => 190792)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1.46-branch/LayoutTests/media/video-interruption-with-resume-allowing-play-expected.txt        2015-10-09 14:21:40 UTC (rev 190791)
+++ branches/safari-601.1.46-branch/LayoutTests/media/video-interruption-with-resume-allowing-play-expected.txt        2015-10-09 14:21:50 UTC (rev 190792)
</span><span class="lines">@@ -6,7 +6,7 @@
</span><span class="cx"> 
</span><span class="cx"> EVENT(playing)
</span><span class="cx"> EXPECTED (video.paused == 'false') OK
</span><del>-RUN(internals.beginMediaSessionInterruption())
</del><ins>+RUN(internals.beginMediaSessionInterruption('System'))
</ins><span class="cx"> 
</span><span class="cx"> 100ms timer fired...
</span><span class="cx"> EXPECTED (video.paused == 'true') OK
</span><span class="lines">@@ -16,7 +16,7 @@
</span><span class="cx"> EXPECTED (video.paused == 'false') OK
</span><span class="cx"> 
</span><span class="cx"> EXPECTED (video.paused == 'false') OK
</span><del>-RUN(internals.beginMediaSessionInterruption())
</del><ins>+RUN(internals.beginMediaSessionInterruption('System'))
</ins><span class="cx"> 
</span><span class="cx"> 100ms timer fired...
</span><span class="cx"> EXPECTED (video.paused == 'true') OK
</span></span></pre></div>
<a id="branchessafari601146branchLayoutTestsmediavideointerruptionwithresumeallowingplayhtml"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1.46-branch/LayoutTests/media/video-interruption-with-resume-allowing-play.html (190791 => 190792)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1.46-branch/LayoutTests/media/video-interruption-with-resume-allowing-play.html        2015-10-09 14:21:40 UTC (rev 190791)
+++ branches/safari-601.1.46-branch/LayoutTests/media/video-interruption-with-resume-allowing-play.html        2015-10-09 14:21:50 UTC (rev 190792)
</span><span class="lines">@@ -12,7 +12,7 @@
</span><span class="cx">                 case &quot;playing&quot;:
</span><span class="cx">                     testExpected(&quot;video.paused&quot;, false);
</span><span class="cx">                     state = &quot;interrupted&quot;;
</span><del>-                    run(&quot;internals.beginMediaSessionInterruption()&quot;);;
</del><ins>+                    run(&quot;internals.beginMediaSessionInterruption('System')&quot;);;
</ins><span class="cx">                     setTimeout(checkState, 100);
</span><span class="cx">                     consoleWrite(&quot;&quot;);
</span><span class="cx">                     break;
</span></span></pre></div>
<a id="branchessafari601146branchLayoutTestsmediavideointerruptionwithresumenotallowingplayexpectedtxt"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1.46-branch/LayoutTests/media/video-interruption-with-resume-not-allowing-play-expected.txt (190791 => 190792)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1.46-branch/LayoutTests/media/video-interruption-with-resume-not-allowing-play-expected.txt        2015-10-09 14:21:40 UTC (rev 190791)
+++ branches/safari-601.1.46-branch/LayoutTests/media/video-interruption-with-resume-not-allowing-play-expected.txt        2015-10-09 14:21:50 UTC (rev 190792)
</span><span class="lines">@@ -5,7 +5,7 @@
</span><span class="cx"> RUN(video.play())
</span><span class="cx"> 
</span><span class="cx"> EVENT(playing)
</span><del>-RUN(internals.beginMediaSessionInterruption())
</del><ins>+RUN(internals.beginMediaSessionInterruption('System'))
</ins><span class="cx"> 
</span><span class="cx"> 100ms timer fired...
</span><span class="cx"> EXPECTED (video.paused == 'true') OK
</span></span></pre></div>
<a id="branchessafari601146branchLayoutTestsmediavideointerruptionwithresumenotallowingplayhtml"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1.46-branch/LayoutTests/media/video-interruption-with-resume-not-allowing-play.html (190791 => 190792)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1.46-branch/LayoutTests/media/video-interruption-with-resume-not-allowing-play.html        2015-10-09 14:21:40 UTC (rev 190791)
+++ branches/safari-601.1.46-branch/LayoutTests/media/video-interruption-with-resume-not-allowing-play.html        2015-10-09 14:21:50 UTC (rev 190792)
</span><span class="lines">@@ -7,7 +7,7 @@
</span><span class="cx"> 
</span><span class="cx">             function playing()
</span><span class="cx">             {
</span><del>-                run(&quot;internals.beginMediaSessionInterruption()&quot;);;
</del><ins>+                run(&quot;internals.beginMediaSessionInterruption('System')&quot;);;
</ins><span class="cx">                 setTimeout(checkState, 100);
</span><span class="cx">             }
</span><span class="cx"> 
</span></span></pre></div>
<a id="branchessafari601146branchSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1.46-branch/Source/WebCore/ChangeLog (190791 => 190792)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1.46-branch/Source/WebCore/ChangeLog        2015-10-09 14:21:40 UTC (rev 190791)
+++ branches/safari-601.1.46-branch/Source/WebCore/ChangeLog        2015-10-09 14:21:50 UTC (rev 190792)
</span><span class="lines">@@ -1,5 +1,51 @@
</span><span class="cx"> 2015-10-08  Matthew Hanson  &lt;matthew_hanson@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        Merge r190434. rdar://problem/22865007
+
+    2015-10-01  Eric Carlson  &lt;eric.carlson@apple.com&gt;
+
+            [iOS] AirPlay should not stop when the screen locks
+            https://bugs.webkit.org/show_bug.cgi?id=148315
+            &lt;rdar://problem/22770703&gt;
+
+            Reviewed by Jer Noble.
+
+            Tested by media/video-interruption-with-resume-allowing-play.html
+                      media/video-interruption-with-resume-not-allowing-play.html
+
+            * Modules/webaudio/AudioContext.h: overrideBackgroundPlaybackRestriction -&gt;
+              shouldOverrideBackgroundPlaybackRestriction.
+
+            * html/HTMLMediaElement.cpp:
+            (WebCore::HTMLMediaElement::suspendPlayback): Fix a typo in the logging.
+            (WebCore::HTMLMediaElement::mayResumePlayback): Ditto.
+            (WebCore::HTMLMediaElement::shouldOverrideBackgroundPlaybackRestriction): Renamed from
+              overrideBackgroundPlaybackRestriction.
+            (WebCore::HTMLMediaElement::overrideBackgroundPlaybackRestriction): Deleted.
+            * html/HTMLMediaElement.h:
+
+            * platform/audio/PlatformMediaSession.cpp:
+            (WebCore::stateName):
+            (WebCore::interruptionName): New, log the name of the interruption.
+            (WebCore::PlatformMediaSession::beginInterruption): Log the interruption type. Don't
+              increment the interruption counter if we are going to ignore it. Incorporate logic
+              from doInterruption.
+            (WebCore::PlatformMediaSession::doInterruption): Deleted.
+            (WebCore::PlatformMediaSession::shouldDoInterruption): Deleted.
+            (WebCore::PlatformMediaSession::forceInterruption): Deleted.
+
+            * platform/audio/PlatformMediaSession.h: Add SuspendedUnderLock interruption type.
+            * platform/audio/PlatformMediaSessionManager.cpp:
+            (WebCore::PlatformMediaSessionManager::applicationDidEnterBackground): Deleted.
+            * platform/audio/PlatformMediaSessionManager.h:
+
+            * platform/audio/ios/MediaSessionManagerIOS.h:
+            * platform/audio/ios/MediaSessionManagerIOS.mm:
+            (WebCore::MediaSessionManageriOS::applicationDidEnterBackground): Call beginInterruption
+              when appropriate.
+
+2015-10-08  Matthew Hanson  &lt;matthew_hanson@apple.com&gt;
+
</ins><span class="cx">         Merge r189979. rdar://problem/23033080
</span><span class="cx"> 
</span><span class="cx">     2015-09-18  Chris Dumez  &lt;cdumez@apple.com&gt;
</span><span class="lines">@@ -242,52 +288,56 @@
</span><span class="cx">             * testing/Internals.cpp:
</span><span class="cx">             (WebCore::Internals::beginMediaSessionInterruption):
</span><span class="cx"> 
</span><del>-2015-10-02  Babak Shafiei  &lt;bshafiei@apple.com&gt;
</del><ins>+2015-10-08  Matthew Hanson  &lt;matthew_hanson@apple.com&gt;
</ins><span class="cx"> 
</span><del>-        Merge r190434.
</del><ins>+        Merge r190478. rdar://problem/22865007
</ins><span class="cx"> 
</span><del>-    2015-10-01  Eric Carlson  &lt;eric.carlson@apple.com&gt;
</del><ins>+    2015-10-02  Babak Shafiei  &lt;bshafiei@apple.com&gt;
</ins><span class="cx"> 
</span><del>-            [iOS] AirPlay should not stop when the screen locks
-            https://bugs.webkit.org/show_bug.cgi?id=148315
-            &lt;rdar://problem/22770703&gt;
</del><ins>+            Merge r190434.
</ins><span class="cx"> 
</span><del>-            Reviewed by Jer Noble.
</del><ins>+        2015-10-01  Eric Carlson  &lt;eric.carlson@apple.com&gt;
</ins><span class="cx"> 
</span><del>-            Tested by media/video-interruption-with-resume-allowing-play.html
-                      media/video-interruption-with-resume-not-allowing-play.html
</del><ins>+                [iOS] AirPlay should not stop when the screen locks
+                https://bugs.webkit.org/show_bug.cgi?id=148315
+                &lt;rdar://problem/22770703&gt;
</ins><span class="cx"> 
</span><del>-            * Modules/webaudio/AudioContext.h: overrideBackgroundPlaybackRestriction -&gt; 
-              shouldOverrideBackgroundPlaybackRestriction.
</del><ins>+                Reviewed by Jer Noble.
</ins><span class="cx"> 
</span><del>-            * html/HTMLMediaElement.cpp:
-            (WebCore::HTMLMediaElement::suspendPlayback): Fix a typo in the logging.
-            (WebCore::HTMLMediaElement::mayResumePlayback): Ditto.
-            (WebCore::HTMLMediaElement::shouldOverrideBackgroundPlaybackRestriction): Renamed from
-              overrideBackgroundPlaybackRestriction.
-            (WebCore::HTMLMediaElement::overrideBackgroundPlaybackRestriction): Deleted.
-            * html/HTMLMediaElement.h:
</del><ins>+                Tested by media/video-interruption-with-resume-allowing-play.html
+                          media/video-interruption-with-resume-not-allowing-play.html
</ins><span class="cx"> 
</span><del>-            * platform/audio/PlatformMediaSession.cpp:
-            (WebCore::stateName):
-            (WebCore::interruptionName): New, log the name of the interruption.
-            (WebCore::PlatformMediaSession::beginInterruption): Log the interruption type. Don't
-              increment the interruption counter if we are going to ignore it. Incorporate logic
-              from doInterruption.
-            (WebCore::PlatformMediaSession::doInterruption): Deleted.
-            (WebCore::PlatformMediaSession::shouldDoInterruption): Deleted.
-            (WebCore::PlatformMediaSession::forceInterruption): Deleted.
</del><ins>+                * Modules/webaudio/AudioContext.h: overrideBackgroundPlaybackRestriction -&gt;
+                  shouldOverrideBackgroundPlaybackRestriction.
</ins><span class="cx"> 
</span><del>-            * platform/audio/PlatformMediaSession.h: Add SuspendedUnderLock interruption type.
-            * platform/audio/PlatformMediaSessionManager.cpp:
-            (WebCore::PlatformMediaSessionManager::applicationDidEnterBackground): Deleted.
-            * platform/audio/PlatformMediaSessionManager.h:
</del><ins>+                * html/HTMLMediaElement.cpp:
+                (WebCore::HTMLMediaElement::suspendPlayback): Fix a typo in the logging.
+                (WebCore::HTMLMediaElement::mayResumePlayback): Ditto.
+                (WebCore::HTMLMediaElement::shouldOverrideBackgroundPlaybackRestriction): Renamed from
+                  overrideBackgroundPlaybackRestriction.
+                (WebCore::HTMLMediaElement::overrideBackgroundPlaybackRestriction): Deleted.
+                * html/HTMLMediaElement.h:
</ins><span class="cx"> 
</span><del>-            * platform/audio/ios/MediaSessionManagerIOS.h:
-            * platform/audio/ios/MediaSessionManagerIOS.mm:
-            (WebCore::MediaSessionManageriOS::applicationDidEnterBackground): Call beginInterruption
-              when appropriate.
</del><ins>+                * platform/audio/PlatformMediaSession.cpp:
+                (WebCore::stateName):
+                (WebCore::interruptionName): New, log the name of the interruption.
+                (WebCore::PlatformMediaSession::beginInterruption): Log the interruption type. Don't
+                  increment the interruption counter if we are going to ignore it. Incorporate logic
+                  from doInterruption.
+                (WebCore::PlatformMediaSession::doInterruption): Deleted.
+                (WebCore::PlatformMediaSession::shouldDoInterruption): Deleted.
+                (WebCore::PlatformMediaSession::forceInterruption): Deleted.
</ins><span class="cx"> 
</span><ins>+                * platform/audio/PlatformMediaSession.h: Add SuspendedUnderLock interruption type.
+                * platform/audio/PlatformMediaSessionManager.cpp:
+                (WebCore::PlatformMediaSessionManager::applicationDidEnterBackground): Deleted.
+                * platform/audio/PlatformMediaSessionManager.h:
+
+                * platform/audio/ios/MediaSessionManagerIOS.h:
+                * platform/audio/ios/MediaSessionManagerIOS.mm:
+                (WebCore::MediaSessionManageriOS::applicationDidEnterBackground): Call beginInterruption
+                  when appropriate.
+
</ins><span class="cx"> 2015-10-02  Babak Shafiei  &lt;bshafiei@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Merge r190380.
</span><span class="lines">@@ -576,7 +626,7 @@
</span><span class="cx"> 
</span><span class="cx">             Reviewed by Dean Jackson.
</span><span class="cx"> 
</span><del>-            Updated Apple Video controls to add an invisible but focusable button that allows VoiceOver 
</del><ins>+            Updated Apple Video controls to add an invisible but focusable button that allows VoiceOver
</ins><span class="cx">             users (and when unblocked, keyboard users) to re-display the video controls.
</span><span class="cx"> 
</span><span class="cx">             Test: media/video-controls-show-on-kb-or-ax-event.html
</span><span class="lines">@@ -1481,7 +1531,7 @@
</span><span class="cx">             * dom/UserGestureIndicator.h:
</span><span class="cx"> 
</span><span class="cx">             * html/HTMLMediaElement.cpp:
</span><del>-            (WebCore::HTMLMediaElement::load): Use ScriptController::processingUserGestureForMedia instead of 
</del><ins>+            (WebCore::HTMLMediaElement::load): Use ScriptController::processingUserGestureForMedia instead of
</ins><span class="cx">               ScriptController::processingUserGesture
</span><span class="cx">             (WebCore::HTMLMediaElement::play): Ditto.
</span><span class="cx"> 
</span><span class="lines">@@ -1496,7 +1546,7 @@
</span><span class="cx"> 
</span><span class="cx">             Reviewed by Eric Carlson.
</span><span class="cx"> 
</span><del>-            Change class name AVPlayerLayerView to match change in AVKit SPI. 
</del><ins>+            Change class name AVPlayerLayerView to match change in AVKit SPI.
</ins><span class="cx">             This prevents conflicts with 3rd party apps.
</span><span class="cx"> 
</span><span class="cx">             * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
</span><span class="lines">@@ -1700,10 +1750,10 @@
</span><span class="cx"> 
</span><span class="cx">             * platform/audio/PlatformMediaSession.h:
</span><span class="cx">             * platform/audio/PlatformMediaSession.cpp:
</span><del>-            (WebCore::PlatformMediaSession::doInterruption): This code was moved from 
</del><ins>+            (WebCore::PlatformMediaSession::doInterruption): This code was moved from
</ins><span class="cx">             beginInterruption().
</span><span class="cx"> 
</span><del>-            (WebCore::PlatformMediaSession::shouldDoInterruption): Move the condition 
</del><ins>+            (WebCore::PlatformMediaSession::shouldDoInterruption): Move the condition
</ins><span class="cx">             which allows the media session interruption to a separate function.
</span><span class="cx"> 
</span><span class="cx">             (WebCore::PlatformMediaSession::beginInterruption): Call the functions
</span><span class="lines">@@ -1725,9 +1775,9 @@
</span><span class="cx">             * platform/audio/ios/MediaSessionManagerIOS.h:
</span><span class="cx">             * platform/audio/ios/MediaSessionManagerIOS.mm:
</span><span class="cx">             (-[WebMediaSessionHelper initWithCallback:]):
</span><del>-            (-[WebMediaSessionHelper applicationDidEnterBackground:]): Listen to 
</del><ins>+            (-[WebMediaSessionHelper applicationDidEnterBackground:]): Listen to
</ins><span class="cx">             UIApplicationDidEnterBackgroundNotification and make a call on the web
</span><del>-            thread to PlatformMediaSessionManager::applicationDidEnterBackground() 
</del><ins>+            thread to PlatformMediaSessionManager::applicationDidEnterBackground()
</ins><span class="cx">             and pass the isSuspendedUnderLock flag which is queried on the UIProcess.
</span><span class="cx"> 
</span><span class="cx"> 2015-07-31  Lucas Forschler  &lt;lforschler@apple.com&gt;
</span><span class="lines">@@ -2119,7 +2169,7 @@
</span><span class="cx"> 
</span><span class="cx">             To allow iOS Accessibility to perform by-page scrolling in overflow areas, we move
</span><span class="cx">             that scrolling code into AccessibilityObject and then iterate all the possible ScrollableAreas,
</span><del>-            rather than just finding the parents that are ScrollViews. 
</del><ins>+            rather than just finding the parents that are ScrollViews.
</ins><span class="cx"> 
</span><span class="cx">             Test: platform/ios-simulator/accessibility/scroll-in-overflow-div.html
</span><span class="cx"> 
</span></span></pre></div>
<a id="branchessafari601146branchSourceWebCoreModuleswebaudioAudioContexth"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1.46-branch/Source/WebCore/Modules/webaudio/AudioContext.h (190791 => 190792)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1.46-branch/Source/WebCore/Modules/webaudio/AudioContext.h        2015-10-09 14:21:40 UTC (rev 190791)
+++ branches/safari-601.1.46-branch/Source/WebCore/Modules/webaudio/AudioContext.h        2015-10-09 14:21:50 UTC (rev 190792)
</span><span class="lines">@@ -322,7 +322,7 @@
</span><span class="cx">     virtual void suspendPlayback() override;
</span><span class="cx">     virtual bool canReceiveRemoteControlCommands() const override { return false; }
</span><span class="cx">     virtual void didReceiveRemoteControlCommand(PlatformMediaSession::RemoteControlCommandType) override { }
</span><del>-    virtual bool overrideBackgroundPlaybackRestriction() const override { return false; }
</del><ins>+    bool shouldOverrideBackgroundPlaybackRestriction(PlatformMediaSession::InterruptionType) const override { return false; }
</ins><span class="cx"> 
</span><span class="cx">     // EventTarget
</span><span class="cx">     virtual void refEventTarget() override { ref(); }
</span></span></pre></div>
<a id="branchessafari601146branchSourceWebCorehtmlHTMLMediaElementcpp"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1.46-branch/Source/WebCore/html/HTMLMediaElement.cpp (190791 => 190792)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1.46-branch/Source/WebCore/html/HTMLMediaElement.cpp        2015-10-09 14:21:40 UTC (rev 190791)
+++ branches/safari-601.1.46-branch/Source/WebCore/html/HTMLMediaElement.cpp        2015-10-09 14:21:50 UTC (rev 190792)
</span><span class="lines">@@ -6327,14 +6327,14 @@
</span><span class="cx"> 
</span><span class="cx"> void HTMLMediaElement::suspendPlayback()
</span><span class="cx"> {
</span><del>-    LOG(Media, &quot;HTMLMediaElement::pausePlayback(%p) - paused = %s&quot;, this, boolString(paused()));
</del><ins>+    LOG(Media, &quot;HTMLMediaElement::suspendPlayback(%p) - paused = %s&quot;, this, boolString(paused()));
</ins><span class="cx">     if (!paused())
</span><span class="cx">         pause();
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void HTMLMediaElement::mayResumePlayback(bool shouldResume)
</span><span class="cx"> {
</span><del>-    LOG(Media, &quot;HTMLMediaElement::resumePlayback(%p) - paused = %s&quot;, this, boolString(paused()));
</del><ins>+    LOG(Media, &quot;HTMLMediaElement::mayResumePlayback(%p) - paused = %s&quot;, this, boolString(paused()));
</ins><span class="cx">     if (paused() &amp;&amp; shouldResume)
</span><span class="cx">         play();
</span><span class="cx"> }
</span><span class="lines">@@ -6376,8 +6376,11 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool HTMLMediaElement::overrideBackgroundPlaybackRestriction() const
</del><ins>+bool HTMLMediaElement::shouldOverrideBackgroundPlaybackRestriction(PlatformMediaSession::InterruptionType type) const
</ins><span class="cx"> {
</span><ins>+    if (type != PlatformMediaSession::EnteringBackground)
+        return false;
+
</ins><span class="cx"> #if ENABLE(WIRELESS_PLAYBACK_TARGET)
</span><span class="cx">     if (m_player &amp;&amp; m_player-&gt;isCurrentPlaybackTargetWireless())
</span><span class="cx">         return true;
</span></span></pre></div>
<a id="branchessafari601146branchSourceWebCorehtmlHTMLMediaElementh"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1.46-branch/Source/WebCore/html/HTMLMediaElement.h (190791 => 190792)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1.46-branch/Source/WebCore/html/HTMLMediaElement.h        2015-10-09 14:21:40 UTC (rev 190791)
+++ branches/safari-601.1.46-branch/Source/WebCore/html/HTMLMediaElement.h        2015-10-09 14:21:50 UTC (rev 190792)
</span><span class="lines">@@ -725,7 +725,7 @@
</span><span class="cx">     virtual double mediaSessionCurrentTime() const override { return currentTime(); }
</span><span class="cx">     virtual bool canReceiveRemoteControlCommands() const override { return true; }
</span><span class="cx">     virtual void didReceiveRemoteControlCommand(PlatformMediaSession::RemoteControlCommandType) override;
</span><del>-    virtual bool overrideBackgroundPlaybackRestriction() const override;
</del><ins>+    bool shouldOverrideBackgroundPlaybackRestriction(PlatformMediaSession::InterruptionType) const override;
</ins><span class="cx"> 
</span><span class="cx">     virtual void pageMutedStateDidChange() override;
</span><span class="cx"> 
</span></span></pre></div>
<a id="branchessafari601146branchSourceWebCoreplatformaudioPlatformMediaSessioncpp"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1.46-branch/Source/WebCore/platform/audio/PlatformMediaSession.cpp (190791 => 190792)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1.46-branch/Source/WebCore/platform/audio/PlatformMediaSession.cpp        2015-10-09 14:21:40 UTC (rev 190791)
+++ branches/safari-601.1.46-branch/Source/WebCore/platform/audio/PlatformMediaSession.cpp        2015-10-09 14:21:50 UTC (rev 190792)
</span><span class="lines">@@ -39,17 +39,31 @@
</span><span class="cx"> #if !LOG_DISABLED
</span><span class="cx"> static const char* stateName(PlatformMediaSession::State state)
</span><span class="cx"> {
</span><del>-#define CASE(state) case PlatformMediaSession::state: return #state
</del><ins>+#define STATE_CASE(state) case PlatformMediaSession::state: return #state
</ins><span class="cx">     switch (state) {
</span><del>-    CASE(Idle);
-    CASE(Playing);
-    CASE(Paused);
-    CASE(Interrupted);
</del><ins>+    STATE_CASE(Idle);
+    STATE_CASE(Playing);
+    STATE_CASE(Paused);
+    STATE_CASE(Interrupted);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     ASSERT_NOT_REACHED();
</span><span class="cx">     return &quot;&quot;;
</span><span class="cx"> }
</span><ins>+
+static const char* interruptionName(PlatformMediaSession::InterruptionType type)
+{
+#define INTERRUPTION_CASE(type) case PlatformMediaSession::type: return #type
+    switch (type) {
+    INTERRUPTION_CASE(SystemSleep);
+    INTERRUPTION_CASE(EnteringBackground);
+    INTERRUPTION_CASE(SystemInterruption);
+    INTERRUPTION_CASE(SuspendedUnderLock);
+    }
+    
+    ASSERT_NOT_REACHED();
+    return &quot;&quot;;
+}
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> std::unique_ptr&lt;PlatformMediaSession&gt; PlatformMediaSession::create(PlatformMediaSessionClient&amp; client)
</span><span class="lines">@@ -79,47 +93,21 @@
</span><span class="cx">     m_state = state;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void PlatformMediaSession::doInterruption()
-{
-    m_stateToRestore = state();
-    m_notifyingClient = true;
-    setState(Interrupted);
-    client().suspendPlayback();
-    m_notifyingClient = false;
-}
-
-bool PlatformMediaSession::shouldDoInterruption(InterruptionType type)
-{
-    return type != EnteringBackground || !client().overrideBackgroundPlaybackRestriction();
-}
-
</del><span class="cx"> void PlatformMediaSession::beginInterruption(InterruptionType type)
</span><span class="cx"> {
</span><del>-    LOG(Media, &quot;PlatformMediaSession::beginInterruption(%p), state = %s, interruption count = %i&quot;, this, stateName(m_state), m_interruptionCount);
</del><ins>+    LOG(Media, &quot;PlatformMediaSession::beginInterruption(%p), state = %s, interruption type = %s, interruption count = %i&quot;, this, stateName(m_state), interruptionName(type), m_interruptionCount);
</ins><span class="cx"> 
</span><del>-    if (++m_interruptionCount &gt; 1 || !shouldDoInterruption(type))
</del><ins>+    if (++m_interruptionCount &gt; 1)
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    doInterruption();
-}
-
-void PlatformMediaSession::forceInterruption(InterruptionType type)
-{
-    LOG(Media, &quot;PlatformMediaSession::forceInterruption(%p), state = %s, interruption count = %i&quot;, this, stateName(m_state), m_interruptionCount);
-
-    // beginInterruption() must have been called before calling this function.
-    if (!m_interruptionCount) {
-        ASSERT_NOT_REACHED();
</del><ins>+    if (client().shouldOverrideBackgroundPlaybackRestriction(type))
</ins><span class="cx">         return;
</span><del>-    }
</del><span class="cx"> 
</span><del>-    // The purpose of this function is to override the decision which was made by
-    // beginInterruption(). If it was decided to interrupt the media session there,
-    // then nothing should be done here.
-    if (shouldDoInterruption(type))
-        return;
-
-    doInterruption();
</del><ins>+    m_stateToRestore = state();
+    m_notifyingClient = true;
+    setState(Interrupted);
+    client().suspendPlayback();
+    m_notifyingClient = false;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void PlatformMediaSession::endInterruption(EndInterruptionFlags flags)
</span></span></pre></div>
<a id="branchessafari601146branchSourceWebCoreplatformaudioPlatformMediaSessionh"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1.46-branch/Source/WebCore/platform/audio/PlatformMediaSession.h (190791 => 190792)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1.46-branch/Source/WebCore/platform/audio/PlatformMediaSession.h        2015-10-09 14:21:40 UTC (rev 190791)
+++ branches/safari-601.1.46-branch/Source/WebCore/platform/audio/PlatformMediaSession.h        2015-10-09 14:21:50 UTC (rev 190792)
</span><span class="lines">@@ -74,16 +74,14 @@
</span><span class="cx">         SystemSleep,
</span><span class="cx">         EnteringBackground,
</span><span class="cx">         SystemInterruption,
</span><ins>+        SuspendedUnderLock,
</ins><span class="cx">     };
</span><span class="cx">     enum EndInterruptionFlags {
</span><span class="cx">         NoFlags = 0,
</span><span class="cx">         MayResumePlaying = 1 &lt;&lt; 0,
</span><span class="cx">     };
</span><span class="cx"> 
</span><del>-    void doInterruption();
-    bool shouldDoInterruption(InterruptionType);
</del><span class="cx">     void beginInterruption(InterruptionType);
</span><del>-    void forceInterruption(InterruptionType);
</del><span class="cx">     void endInterruption(EndInterruptionFlags);
</span><span class="cx"> 
</span><span class="cx">     void applicationWillEnterForeground() const;
</span><span class="lines">@@ -179,7 +177,7 @@
</span><span class="cx">     virtual void setShouldBufferData(bool) { }
</span><span class="cx">     virtual bool elementIsHidden() const { return false; }
</span><span class="cx"> 
</span><del>-    virtual bool overrideBackgroundPlaybackRestriction() const = 0;
</del><ins>+    virtual bool shouldOverrideBackgroundPlaybackRestriction(PlatformMediaSession::InterruptionType) const = 0;
</ins><span class="cx"> 
</span><span class="cx">     virtual void wirelessRoutesAvailableDidChange() { }
</span><span class="cx">     virtual void setWirelessPlaybackTarget(Ref&lt;MediaPlaybackTarget&gt;&amp;&amp;) { }
</span></span></pre></div>
<a id="branchessafari601146branchSourceWebCoreplatformaudioPlatformMediaSessionManagercpp"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1.46-branch/Source/WebCore/platform/audio/PlatformMediaSessionManager.cpp (190791 => 190792)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1.46-branch/Source/WebCore/platform/audio/PlatformMediaSessionManager.cpp        2015-10-09 14:21:40 UTC (rev 190791)
+++ branches/safari-601.1.46-branch/Source/WebCore/platform/audio/PlatformMediaSessionManager.cpp        2015-10-09 14:21:50 UTC (rev 190792)
</span><span class="lines">@@ -289,20 +289,6 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void PlatformMediaSessionManager::applicationDidEnterBackground(bool isSuspendedUnderLock) const
-{
-    LOG(Media, &quot;PlatformMediaSessionManager::applicationDidEnterBackground&quot;);
-
-    if (!isSuspendedUnderLock)
-        return;
-
-    Vector&lt;PlatformMediaSession*&gt; sessions = m_sessions;
-    for (auto* session : sessions) {
-        if (m_restrictions[session-&gt;mediaType()] &amp; BackgroundProcessPlaybackRestricted)
-            session-&gt;forceInterruption(PlatformMediaSession::EnteringBackground);
-    }
-}
-
</del><span class="cx"> void PlatformMediaSessionManager::applicationWillEnterForeground() const
</span><span class="cx"> {
</span><span class="cx">     LOG(Media, &quot;PlatformMediaSessionManager::applicationWillEnterForeground&quot;);
</span><span class="lines">@@ -324,8 +310,8 @@
</span><span class="cx">     if (!m_isApplicationInBackground || !(m_restrictions[session.mediaType()] &amp; BackgroundProcessPlaybackRestricted))
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    if (session.state() != PlatformMediaSession::Interrupted &amp;&amp; session.shouldDoInterruption(PlatformMediaSession::EnteringBackground))
-        session.doInterruption();
</del><ins>+    if (session.state() != PlatformMediaSession::Interrupted)
+        session.beginInterruption(PlatformMediaSession::EnteringBackground);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #if !PLATFORM(COCOA)
</span></span></pre></div>
<a id="branchessafari601146branchSourceWebCoreplatformaudioPlatformMediaSessionManagerh"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1.46-branch/Source/WebCore/platform/audio/PlatformMediaSessionManager.h (190791 => 190792)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1.46-branch/Source/WebCore/platform/audio/PlatformMediaSessionManager.h        2015-10-09 14:21:40 UTC (rev 190791)
+++ branches/safari-601.1.46-branch/Source/WebCore/platform/audio/PlatformMediaSessionManager.h        2015-10-09 14:21:50 UTC (rev 190792)
</span><span class="lines">@@ -56,7 +56,6 @@
</span><span class="cx"> 
</span><span class="cx">     WEBCORE_EXPORT void applicationWillEnterForeground() const;
</span><span class="cx">     WEBCORE_EXPORT void applicationWillEnterBackground() const;
</span><del>-    WEBCORE_EXPORT void applicationDidEnterBackground(bool isSuspendedUnderLock) const;
</del><span class="cx"> 
</span><span class="cx">     void stopAllMediaPlaybackForDocument(const Document*);
</span><span class="cx">     WEBCORE_EXPORT void stopAllMediaPlaybackForProcess();
</span></span></pre></div>
<a id="branchessafari601146branchSourceWebCoreplatformaudioiosMediaSessionManagerIOSh"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1.46-branch/Source/WebCore/platform/audio/ios/MediaSessionManagerIOS.h (190791 => 190792)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1.46-branch/Source/WebCore/platform/audio/ios/MediaSessionManagerIOS.h        2015-10-09 14:21:40 UTC (rev 190791)
+++ branches/safari-601.1.46-branch/Source/WebCore/platform/audio/ios/MediaSessionManagerIOS.h        2015-10-09 14:21:50 UTC (rev 190792)
</span><span class="lines">@@ -48,6 +48,7 @@
</span><span class="cx"> 
</span><span class="cx">     void externalOutputDeviceAvailableDidChange();
</span><span class="cx">     virtual bool hasWirelessTargetsAvailable() override;
</span><ins>+    void applicationDidEnterBackground(bool isSuspendedUnderLock);
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     friend class PlatformMediaSessionManager;
</span></span></pre></div>
<a id="branchessafari601146branchSourceWebCoreplatformaudioiosMediaSessionManagerIOSmm"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1.46-branch/Source/WebCore/platform/audio/ios/MediaSessionManagerIOS.mm (190791 => 190792)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1.46-branch/Source/WebCore/platform/audio/ios/MediaSessionManagerIOS.mm        2015-10-09 14:21:40 UTC (rev 190791)
+++ branches/safari-601.1.46-branch/Source/WebCore/platform/audio/ios/MediaSessionManagerIOS.mm        2015-10-09 14:21:50 UTC (rev 190792)
</span><span class="lines">@@ -248,6 +248,21 @@
</span><span class="cx">         session-&gt;externalOutputDeviceAvailableDidChange(haveTargets);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void MediaSessionManageriOS::applicationDidEnterBackground(bool isSuspendedUnderLock)
+{
+    LOG(Media, &quot;MediaSessionManageriOS::applicationDidEnterBackground&quot;);
+
+    if (!isSuspendedUnderLock)
+        return;
+
+    Vector&lt;PlatformMediaSession*&gt; sessions = this-&gt;sessions();
+    for (auto* session : sessions) {
+        if (restrictions(session-&gt;mediaType()) &amp; BackgroundProcessPlaybackRestricted)
+            session-&gt;beginInterruption(PlatformMediaSession::SuspendedUnderLock);
+    }
+}
+
+
</ins><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><span class="cx"> @implementation WebMediaSessionHelper
</span></span></pre></div>
<a id="branchessafari601146branchSourceWebCoretestingInternalscpp"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1.46-branch/Source/WebCore/testing/Internals.cpp (190791 => 190792)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1.46-branch/Source/WebCore/testing/Internals.cpp        2015-10-09 14:21:40 UTC (rev 190791)
+++ branches/safari-601.1.46-branch/Source/WebCore/testing/Internals.cpp        2015-10-09 14:21:50 UTC (rev 190792)
</span><span class="lines">@@ -2614,8 +2614,21 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(VIDEO)
</span><del>-void Internals::beginMediaSessionInterruption()
</del><ins>+void Internals::beginMediaSessionInterruption(const String&amp; interruptionString, ExceptionCode&amp; ec)
</ins><span class="cx"> {
</span><ins>+    PlatformMediaSession::InterruptionType interruption = PlatformMediaSession::SystemInterruption;
+
+    if (equalIgnoringCase(interruptionString, &quot;System&quot;))
+        interruption = PlatformMediaSession::SystemInterruption;
+    else if (equalIgnoringCase(interruptionString, &quot;SystemSleep&quot;))
+        interruption = PlatformMediaSession::SystemSleep;
+    else if (equalIgnoringCase(interruptionString, &quot;EnteringBackground&quot;))
+        interruption = PlatformMediaSession::EnteringBackground;
+    else {
+        ec = INVALID_ACCESS_ERR;
+        return;
+    }
+
</ins><span class="cx">     PlatformMediaSessionManager::sharedManager().beginInterruption(PlatformMediaSession::SystemInterruption);
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="branchessafari601146branchSourceWebCoretestingInternalsh"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1.46-branch/Source/WebCore/testing/Internals.h (190791 => 190792)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1.46-branch/Source/WebCore/testing/Internals.h        2015-10-09 14:21:40 UTC (rev 190791)
+++ branches/safari-601.1.46-branch/Source/WebCore/testing/Internals.h        2015-10-09 14:21:50 UTC (rev 190792)
</span><span class="lines">@@ -382,7 +382,7 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(VIDEO)
</span><del>-    void beginMediaSessionInterruption();
</del><ins>+    void beginMediaSessionInterruption(const String&amp;, ExceptionCode&amp;);
</ins><span class="cx">     void endMediaSessionInterruption(const String&amp;);
</span><span class="cx">     void applicationWillEnterForeground() const;
</span><span class="cx">     void applicationWillEnterBackground() const;
</span></span></pre></div>
<a id="branchessafari601146branchSourceWebCoretestingInternalsidl"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1.46-branch/Source/WebCore/testing/Internals.idl (190791 => 190792)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1.46-branch/Source/WebCore/testing/Internals.idl        2015-10-09 14:21:40 UTC (rev 190791)
+++ branches/safari-601.1.46-branch/Source/WebCore/testing/Internals.idl        2015-10-09 14:21:50 UTC (rev 190792)
</span><span class="lines">@@ -349,7 +349,7 @@
</span><span class="cx">     [Conditional=MEDIA_SOURCE] void initializeMockMediaSource();
</span><span class="cx">     [Conditional=MEDIA_SOURCE] DOMString[] bufferedSamplesForTrackID(SourceBuffer buffer, DOMString trackID);
</span><span class="cx"> 
</span><del>-    [Conditional=VIDEO] void beginMediaSessionInterruption();
</del><ins>+    [Conditional=VIDEO, RaisesException] void beginMediaSessionInterruption(DOMString interruptionType);
</ins><span class="cx">     [Conditional=VIDEO] void endMediaSessionInterruption(DOMString flags);
</span><span class="cx">     [Conditional=VIDEO] void applicationWillEnterForeground();
</span><span class="cx">     [Conditional=VIDEO] void applicationWillEnterBackground();
</span></span></pre>
</div>
</div>

</body>
</html>