<!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>[186791] 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/186791">186791</a></dd>
<dt>Author</dt> <dd>mrajca@apple.com</dd>
<dt>Date</dt> <dd>2015-07-13 15:51:15 -0700 (Mon, 13 Jul 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>Media Session: add plumbing for delivering start/end-of-interruption events
https://bugs.webkit.org/show_bug.cgi?id=146837

Reviewed by Tim Horton.

WebCore:
* Modules/mediasession/MediaSessionEvents.h: Renamed from MediaEventTypes.h and added new constants for
  interruption events.
* WebCore.xcodeproj/project.pbxproj: Renamed MediaEventTypes.h.
* page/Page.h: Added stub.
* page/Page.cpp: Added stub.

WebKit2: Added plumbing.
* UIProcess/API/C/WKPage.cpp:
(WKPageHandleMediaSessionInterruptionEvent):
* UIProcess/API/C/WKPagePrivate.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::handleMediaSessionInterruptionEvent):
* UIProcess/WebPageProxy.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::handleMediaSessionInterruptionEvent):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCorepagePagecpp">trunk/Source/WebCore/page/Page.cpp</a></li>
<li><a href="#trunkSourceWebCorepagePageh">trunk/Source/WebCore/page/Page.h</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICWKPagecpp">trunk/Source/WebKit2/UIProcess/API/C/WKPage.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICWKPagePrivateh">trunk/Source/WebKit2/UIProcess/API/C/WKPagePrivate.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebPageProxycpp">trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebPageProxyh">trunk/Source/WebKit2/UIProcess/WebPageProxy.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageWebPagecpp">trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageWebPageh">trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageWebPagemessagesin">trunk/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreModulesmediasessionMediaSessionEventsh">trunk/Source/WebCore/Modules/mediasession/MediaSessionEvents.h</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreModulesmediasessionMediaEventTypesh">trunk/Source/WebCore/Modules/mediasession/MediaEventTypes.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (186790 => 186791)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-07-13 22:38:39 UTC (rev 186790)
+++ trunk/Source/WebCore/ChangeLog        2015-07-13 22:51:15 UTC (rev 186791)
</span><span class="lines">@@ -1,3 +1,16 @@
</span><ins>+2015-07-13  Matt Rajca  &lt;mrajca@apple.com&gt;
+
+        Media Session: add plumbing for delivering start/end-of-interruption events
+        https://bugs.webkit.org/show_bug.cgi?id=146837
+
+        Reviewed by Tim Horton.
+
+        * Modules/mediasession/MediaSessionEvents.h: Renamed from MediaEventTypes.h and added new constants for
+          interruption events.
+        * WebCore.xcodeproj/project.pbxproj: Renamed MediaEventTypes.h.
+        * page/Page.h: Added stub.
+        * page/Page.cpp: Added stub.
+
</ins><span class="cx"> 2015-07-13  Simon Fraser  &lt;simon.fraser@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [iOS WK2] When choosing an initial viewport scale, take overflow on the &lt;body&gt; into account
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesmediasessionMediaEventTypesh"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/Modules/mediasession/MediaEventTypes.h (186790 => 186791)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediasession/MediaEventTypes.h        2015-07-13 22:38:39 UTC (rev 186790)
+++ trunk/Source/WebCore/Modules/mediasession/MediaEventTypes.h        2015-07-13 22:51:15 UTC (rev 186791)
</span><span class="lines">@@ -1,43 +0,0 @@
</span><del>-/*
- * Copyright (C) 2015 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef MediaEventTypes_h
-#define MediaEventTypes_h
-
-#if ENABLE(MEDIA_SESSION)
-
-namespace WebCore {
-
-enum MediaEventType {
-    PlayPause,
-    TrackNext,
-    TrackPrevious
-};
-
-}
-
-#endif
-
-#endif /* MediaEventTypes_h */
</del></span></pre></div>
<a id="trunkSourceWebCoreModulesmediasessionMediaSessionEventshfromrev186786trunkSourceWebCoreModulesmediasessionMediaEventTypesh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/Modules/mediasession/MediaSessionEvents.h (from rev 186786, trunk/Source/WebCore/Modules/mediasession/MediaEventTypes.h) (0 => 186791)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediasession/MediaSessionEvents.h                                (rev 0)
+++ trunk/Source/WebCore/Modules/mediasession/MediaSessionEvents.h        2015-07-13 22:51:15 UTC (rev 186791)
</span><span class="lines">@@ -0,0 +1,54 @@
</span><ins>+/*
+ * Copyright (C) 2015 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef MediaSessionEvents_h
+#define MediaSessionEvents_h
+
+#if ENABLE(MEDIA_SESSION)
+
+namespace WebCore {
+
+enum MediaEventType {
+    PlayPause,
+    TrackNext,
+    TrackPrevious
+};
+
+enum MediaSessionInterruptionEvent {
+    StartOfInterruption,
+    EndOfInterruption
+};
+
+enum MediaSessionInterruptingCategory {
+    Content,
+    Transient,
+    TransientSolo
+};
+
+}
+
+#endif
+
+#endif /* MediaSessionEvents_h */
</ins></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (186790 => 186791)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2015-07-13 22:38:39 UTC (rev 186790)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2015-07-13 22:51:15 UTC (rev 186791)
</span><span class="lines">@@ -5720,7 +5720,7 @@
</span><span class="cx">                 C968B2E81B1E778100EF1F81 /* HTMLMediaElementMediaSession.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C968B2E71B1E778100EF1F81 /* HTMLMediaElementMediaSession.cpp */; };
</span><span class="cx">                 C9D851F01B39DC780085062E /* MediaSessionMetadata.h in Headers */ = {isa = PBXBuildFile; fileRef = C9D851EE1B39DC780085062E /* MediaSessionMetadata.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 C9DADBCB1B1D3B97001F17D8 /* JSMediaSession.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C9DADBC91B1D3B25001F17D8 /* JSMediaSession.cpp */; };
</span><del>-                C9F87CFE1B28F40E00979B83 /* MediaEventTypes.h in Headers */ = {isa = PBXBuildFile; fileRef = C9F87CFD1B28E5F600979B83 /* MediaEventTypes.h */; settings = {ATTRIBUTES = (Private, ); }; };
</del><ins>+                C9F87CFE1B28F40E00979B83 /* MediaSessionEvents.h in Headers */ = {isa = PBXBuildFile; fileRef = C9F87CFD1B28E5F600979B83 /* MediaSessionEvents.h */; settings = {ATTRIBUTES = (Private, ); }; };
</ins><span class="cx">                 CA3BF67C10D99BAE00E6CE53 /* ScrollAnimator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CA3BF67B10D99BAE00E6CE53 /* ScrollAnimator.cpp */; };
</span><span class="cx">                 CA3BF67E10D99BAE00E6CE53 /* ScrollAnimator.h in Headers */ = {isa = PBXBuildFile; fileRef = CA3BF67D10D99BAE00E6CE53 /* ScrollAnimator.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 CAE9F90F146441F000C245B0 /* CSSAspectRatioValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CAE9F90D146441F000C245B0 /* CSSAspectRatioValue.cpp */; };
</span><span class="lines">@@ -13313,7 +13313,7 @@
</span><span class="cx">                 C9D851EE1B39DC780085062E /* MediaSessionMetadata.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaSessionMetadata.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 C9DADBC91B1D3B25001F17D8 /* JSMediaSession.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSMediaSession.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 C9DADBCA1B1D3B25001F17D8 /* JSMediaSession.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSMediaSession.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><del>-                C9F87CFD1B28E5F600979B83 /* MediaEventTypes.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MediaEventTypes.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</del><ins>+                C9F87CFD1B28E5F600979B83 /* MediaSessionEvents.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.h; path = MediaSessionEvents.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 CA3BF67B10D99BAE00E6CE53 /* ScrollAnimator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScrollAnimator.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 CA3BF67D10D99BAE00E6CE53 /* ScrollAnimator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollAnimator.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 CAE9F90D146441F000C245B0 /* CSSAspectRatioValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CSSAspectRatioValue.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -14659,13 +14659,13 @@
</span><span class="cx">                                 C968B2E71B1E778100EF1F81 /* HTMLMediaElementMediaSession.cpp */,
</span><span class="cx">                                 C968B2E61B1E72F700EF1F81 /* HTMLMediaElementMediaSession.h */,
</span><span class="cx">                                 C968B2E51B1E704500EF1F81 /* HTMLMediaElementMediaSession.idl */,
</span><del>-                                C9F87CFD1B28E5F600979B83 /* MediaEventTypes.h */,
</del><span class="cx">                                 C90843CD1B18E47D00B68564 /* MediaRemoteControls.cpp */,
</span><span class="cx">                                 C90843CE1B18E47D00B68564 /* MediaRemoteControls.h */,
</span><span class="cx">                                 C93458BB1B18D77E0088EE12 /* MediaRemoteControls.idl */,
</span><span class="cx">                                 C9027F3F1B1D0AD200BFBFEF /* MediaSession.cpp */,
</span><span class="cx">                                 C9027F401B1D0AD200BFBFEF /* MediaSession.h */,
</span><span class="cx">                                 C9027F3E1B1D0AB900BFBFEF /* MediaSession.idl */,
</span><ins>+                                C9F87CFD1B28E5F600979B83 /* MediaSessionEvents.h */,
</ins><span class="cx">                                 C90F65531B225396002163A1 /* MediaSessionManager.cpp */,
</span><span class="cx">                                 C90F65541B225396002163A1 /* MediaSessionManager.h */,
</span><span class="cx">                                 C9D851EE1B39DC780085062E /* MediaSessionMetadata.h */,
</span><span class="lines">@@ -25904,7 +25904,6 @@
</span><span class="cx">                                 FD6F252D13F5EF0E0065165F /* MediaElementAudioSourceNode.h in Headers */,
</span><span class="cx">                                 07FE99DD18807A7D00256648 /* MediaElementSession.h in Headers */,
</span><span class="cx">                                 E44613AD0CD6331000FADA75 /* MediaError.h in Headers */,
</span><del>-                                C9F87CFE1B28F40E00979B83 /* MediaEventTypes.h in Headers */,
</del><span class="cx">                                 4E1959220A39DABA00220FE5 /* MediaFeatureNames.h in Headers */,
</span><span class="cx">                                 07A6D1EC1491137700051D0C /* MediaFragmentURIParser.h in Headers */,
</span><span class="cx">                                 A8EA800E0A19516E00A8EF5F /* MediaList.h in Headers */,
</span><span class="lines">@@ -25932,6 +25931,7 @@
</span><span class="cx">                                 CEEFCD7A19DB31F7003876D7 /* MediaResourceLoader.h in Headers */,
</span><span class="cx">                                 CDBEAEAD19D92B6C00BEBA88 /* MediaSelectionGroupAVFObjC.h in Headers */,
</span><span class="cx">                                 C9027F421B1D0AD200BFBFEF /* MediaSession.h in Headers */,
</span><ins>+                                C9F87CFE1B28F40E00979B83 /* MediaSessionEvents.h in Headers */,
</ins><span class="cx">                                 C90F65561B2253BE002163A1 /* MediaSessionManager.h in Headers */,
</span><span class="cx">                                 07638A991884487200E15A1B /* MediaSessionManagerIOS.h in Headers */,
</span><span class="cx">                                 C9D851F01B39DC780085062E /* MediaSessionMetadata.h in Headers */,
</span></span></pre></div>
<a id="trunkSourceWebCorepagePagecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/Page.cpp (186790 => 186791)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/Page.cpp        2015-07-13 22:38:39 UTC (rev 186790)
+++ trunk/Source/WebCore/page/Page.cpp        2015-07-13 22:51:15 UTC (rev 186791)
</span><span class="lines">@@ -57,6 +57,7 @@
</span><span class="cx"> #include &quot;MediaCanStartListener.h&quot;
</span><span class="cx"> #include &quot;Navigator.h&quot;
</span><span class="cx"> #include &quot;NetworkStateNotifier.h&quot;
</span><ins>+#include &quot;NotImplemented.h&quot;
</ins><span class="cx"> #include &quot;PageCache.h&quot;
</span><span class="cx"> #include &quot;PageConfiguration.h&quot;
</span><span class="cx"> #include &quot;PageConsoleClient.h&quot;
</span><span class="lines">@@ -1224,6 +1225,11 @@
</span><span class="cx">         break;
</span><span class="cx">     }
</span><span class="cx"> }
</span><ins>+
+void Page::handleMediaSessionInterruptionEvent(MediaSessionInterruptionEvent event, MediaSessionInterruptingCategory category)
+{
+    notImplemented();
+}
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #if !ASSERT_DISABLED
</span></span></pre></div>
<a id="trunkSourceWebCorepagePageh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/Page.h (186790 => 186791)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/Page.h        2015-07-13 22:38:39 UTC (rev 186790)
+++ trunk/Source/WebCore/page/Page.h        2015-07-13 22:51:15 UTC (rev 186791)
</span><span class="lines">@@ -55,7 +55,7 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(MEDIA_SESSION)
</span><del>-#include &quot;MediaEventTypes.h&quot;
</del><ins>+#include &quot;MediaSessionEvents.h&quot;
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> namespace JSC {
</span><span class="lines">@@ -442,6 +442,7 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(MEDIA_SESSION)
</span><span class="cx">     WEBCORE_EXPORT void handleMediaEvent(MediaEventType);
</span><ins>+    WEBCORE_EXPORT void handleMediaSessionInterruptionEvent(MediaSessionInterruptionEvent, MediaSessionInterruptingCategory);
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(WIRELESS_PLAYBACK_TARGET)
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (186790 => 186791)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2015-07-13 22:38:39 UTC (rev 186790)
+++ trunk/Source/WebKit2/ChangeLog        2015-07-13 22:51:15 UTC (rev 186791)
</span><span class="lines">@@ -1,3 +1,21 @@
</span><ins>+2015-07-13  Matt Rajca  &lt;mrajca@apple.com&gt;
+
+        Media Session: add plumbing for delivering start/end-of-interruption events
+        https://bugs.webkit.org/show_bug.cgi?id=146837
+
+        Reviewed by Tim Horton.
+
+        * UIProcess/API/C/WKPage.cpp:
+        (WKPageHandleMediaSessionInterruptionEvent):
+        * UIProcess/API/C/WKPagePrivate.h:
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::WebPageProxy::handleMediaSessionInterruptionEvent):
+        * UIProcess/WebPageProxy.h:
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::handleMediaSessionInterruptionEvent):
+        * WebProcess/WebPage/WebPage.h:
+        * WebProcess/WebPage/WebPage.messages.in:
+
</ins><span class="cx"> 2015-07-13  Simon Fraser  &lt;simon.fraser@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [iOS WK2] When choosing an initial viewport scale, take overflow on the &lt;body&gt; into account
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICWKPagecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/C/WKPage.cpp (186790 => 186791)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/C/WKPage.cpp        2015-07-13 22:38:39 UTC (rev 186790)
+++ trunk/Source/WebKit2/UIProcess/API/C/WKPage.cpp        2015-07-13 22:51:15 UTC (rev 186791)
</span><span class="lines">@@ -81,7 +81,7 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(MEDIA_SESSION)
</span><span class="cx"> #include &quot;WebMediaSessionMetadata.h&quot;
</span><del>-#include &lt;WebCore/MediaEventTypes.h&gt;
</del><ins>+#include &lt;WebCore/MediaSessionEvents.h&gt;
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> using namespace WebCore;
</span><span class="lines">@@ -2189,6 +2189,56 @@
</span><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#if ENABLE(MEDIA_SESSION)
+// NOTE: The values in the WKMediaSessionInterruptingCategory enum must stay in sync with those in WebCore::MediaSessionInterruptingCategory.
+COMPILE_ASSERT(MediaSessionInterruptingCategory::Content == static_cast&lt;MediaSessionInterruptingCategory&gt;(kWKMediaSessionInterruptingCategoryContent), MediaSessionInterruptingCategoryEnumContent_Is_Wrong_Should_Be_kWKMediaSessionInterruptingCategoryContent);
+COMPILE_ASSERT(MediaSessionInterruptingCategory::Transient == static_cast&lt;MediaSessionInterruptingCategory&gt;(kWKMediaSessionInterruptingCategoryTransient), MediaSessionInterruptingCategoryEnumTransient_Is_Wrong_Should_Be_kWKMediaSessionInterruptingCategoryTransient);
+COMPILE_ASSERT(MediaSessionInterruptingCategory::TransientSolo == static_cast&lt;MediaSessionInterruptingCategory&gt;(kWKMediaSessionInterruptingCategoryTransientSolo), MediaSessionInterruptingCategoryEnumTransientSolo_Is_Wrong_Should_Be_kWKMediaSessionInterruptingCategoryTransientSolo);
+
+COMPILE_ASSERT(MediaSessionInterruptionEvent::StartOfInterruption == static_cast&lt;MediaSessionInterruptionEvent&gt;(kWKMediaSessionInterruptionEventStartOfInterruption), MediaSessionInterruptionEventEnumStartOfInterruption_Is_Wrong_Should_Be_kWKMediaSessionInterruptionEventStartOfInterruption);
+COMPILE_ASSERT(MediaSessionInterruptionEvent::EndOfInterruption == static_cast&lt;MediaSessionInterruptionEvent&gt;(kWKMediaSessionInterruptionEventEndOfInterruption), MediaSessionInterruptionEventEnumEndOfInterruption_Is_Wrong_Should_Be_kWKMediaSessionInterruptionEventEndOfInterruption);
+#endif
+
+void WKPageHandleMediaSessionInterruptionEvent(WKPageRef page, WKMediaSessionInterruptionEvent wkEvent, WKMediaSessionInterruptingCategory wkCategory)
+{
+#if ENABLE(MEDIA_SESSION)
+    MediaSessionInterruptingCategory category;
+
+    switch (wkCategory) {
+    case kWKMediaSessionInterruptingCategoryContent:
+        category = MediaSessionInterruptingCategory::Content;
+        break;
+    case kWKMediaSessionInterruptingCategoryTransient:
+        category = MediaSessionInterruptingCategory::Transient;
+        break;
+    case kWKMediaSessionInterruptingCategoryTransientSolo:
+        category = MediaSessionInterruptingCategory::TransientSolo;
+        break;
+    default:
+        ASSERT_NOT_REACHED();
+    }
+
+    MediaSessionInterruptionEvent event;
+
+    switch (wkEvent) {
+    case kWKMediaSessionInterruptionEventStartOfInterruption:
+        event = MediaSessionInterruptionEvent::StartOfInterruption;
+        break;
+    case kWKMediaSessionInterruptionEventEndOfInterruption:
+        event = MediaSessionInterruptionEvent::EndOfInterruption;
+        break;
+    default:
+        ASSERT_NOT_REACHED();
+    }
+
+    toImpl(page)-&gt;handleMediaSessionInterruptionEvent(event, category);
+#else
+    UNUSED_PARAM(page);
+    UNUSED_PARAM(wkEvent);
+    UNUSED_PARAM(wkCategory);
+#endif
+}
+
</ins><span class="cx"> void WKPagePostMessageToInjectedBundle(WKPageRef pageRef, WKStringRef messageNameRef, WKTypeRef messageBodyRef)
</span><span class="cx"> {
</span><span class="cx">     toImpl(pageRef)-&gt;postMessageToInjectedBundle(toImpl(messageNameRef)-&gt;string(), toImpl(messageBodyRef));
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICWKPagePrivateh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/C/WKPagePrivate.h (186790 => 186791)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/C/WKPagePrivate.h        2015-07-13 22:38:39 UTC (rev 186790)
+++ trunk/Source/WebKit2/UIProcess/API/C/WKPagePrivate.h        2015-07-13 22:51:15 UTC (rev 186791)
</span><span class="lines">@@ -118,8 +118,22 @@
</span><span class="cx"> };
</span><span class="cx"> typedef uint32_t WKMediaEventType;
</span><span class="cx"> 
</span><ins>+enum {
+    kWKMediaSessionInterruptingCategoryContent,
+    kWKMediaSessionInterruptingCategoryTransient,
+    kWKMediaSessionInterruptingCategoryTransientSolo
+};
+typedef uint32_t WKMediaSessionInterruptingCategory;
+
+enum {
+    kWKMediaSessionInterruptionEventStartOfInterruption,
+    kWKMediaSessionInterruptionEventEndOfInterruption
+};
+typedef uint32_t WKMediaSessionInterruptionEvent;
+
</ins><span class="cx"> WK_EXPORT bool WKPageHasMediaSessionWithActiveMediaElements(WKPageRef page);
</span><span class="cx"> WK_EXPORT void WKPageHandleMediaEvent(WKPageRef page, WKMediaEventType event);
</span><ins>+WK_EXPORT void WKPageHandleMediaSessionInterruptionEvent(WKPageRef page, WKMediaSessionInterruptionEvent event, WKMediaSessionInterruptingCategory category);
</ins><span class="cx"> 
</span><span class="cx"> WK_EXPORT void WKPageLoadURLWithShouldOpenExternalURLsPolicy(WKPageRef page, WKURLRef url, bool shouldOpenExternalURLs);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebPageProxycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp (186790 => 186791)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp        2015-07-13 22:38:39 UTC (rev 186790)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp        2015-07-13 22:51:15 UTC (rev 186791)
</span><span class="lines">@@ -3784,6 +3784,14 @@
</span><span class="cx">     
</span><span class="cx">     m_process-&gt;send(Messages::WebPage::HandleMediaEvent(eventType), m_pageID);
</span><span class="cx"> }
</span><ins>+
+void WebPageProxy::handleMediaSessionInterruptionEvent(MediaSessionInterruptionEvent event, MediaSessionInterruptingCategory category)
+{
+    if (!isValid())
+        return;
+
+    m_process-&gt;send(Messages::WebPage::HandleMediaSessionInterruptionEvent(event, category), m_pageID);
+}
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> void WebPageProxy::setMayStartMediaWhenInWindow(bool mayStartMedia)
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebPageProxyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.h (186790 => 186791)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebPageProxy.h        2015-07-13 22:38:39 UTC (rev 186790)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.h        2015-07-13 22:51:15 UTC (rev 186791)
</span><span class="lines">@@ -942,6 +942,7 @@
</span><span class="cx"> #if ENABLE(MEDIA_SESSION)
</span><span class="cx">     bool hasMediaSessionWithActiveMediaElements() const { return m_hasMediaSessionWithActiveMediaElements; }
</span><span class="cx">     void handleMediaEvent(WebCore::MediaEventType);
</span><ins>+    void handleMediaSessionInterruptionEvent(WebCore::MediaSessionInterruptionEvent, WebCore::MediaSessionInterruptingCategory);
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     // WebPopupMenuProxy::Client
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageWebPagecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (186790 => 186791)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp        2015-07-13 22:38:39 UTC (rev 186790)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp        2015-07-13 22:51:15 UTC (rev 186791)
</span><span class="lines">@@ -4043,6 +4043,11 @@
</span><span class="cx"> {
</span><span class="cx">     m_page-&gt;handleMediaEvent(static_cast&lt;MediaEventType&gt;(eventType));
</span><span class="cx"> }
</span><ins>+
+void WebPage::handleMediaSessionInterruptionEvent(uint32_t event, uint32_t category)
+{
+    m_page-&gt;handleMediaSessionInterruptionEvent(static_cast&lt;MediaSessionInterruptionEvent&gt;(event), static_cast&lt;MediaSessionInterruptingCategory&gt;(category));
+}
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> void WebPage::setMayStartMediaWhenInWindow(bool mayStartMedia)
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageWebPageh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h (186790 => 186791)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h        2015-07-13 22:38:39 UTC (rev 186790)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h        2015-07-13 22:51:15 UTC (rev 186791)
</span><span class="lines">@@ -743,6 +743,7 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(MEDIA_SESSION)
</span><span class="cx">     void handleMediaEvent(uint32_t /* WebCore::MediaEventType */);
</span><ins>+    void handleMediaSessionInterruptionEvent(uint32_t /* WebCore::MediaSessionInterruptionEvent */, uint32_t /* WebCore::MediaSessionInterruptingCategory */);
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     void updateMainFrameScrollOffsetPinning();
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageWebPagemessagesin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in (186790 => 186791)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in        2015-07-13 22:38:39 UTC (rev 186790)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in        2015-07-13 22:51:15 UTC (rev 186791)
</span><span class="lines">@@ -314,6 +314,7 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(MEDIA_SESSION)
</span><span class="cx">     HandleMediaEvent(uint32_t eventType)
</span><ins>+    HandleMediaSessionInterruptionEvent(uint32_t event, uint32_t interruptingCategory)
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     // FIXME: This a dummy message, to avoid breaking the build for platforms that don't require
</span></span></pre>
</div>
</div>

</body>
</html>