<!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>[175273] trunk/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/175273">175273</a></dd>
<dt>Author</dt> <dd>adachan@apple.com</dd>
<dt>Date</dt> <dd>2014-10-28 15:00:39 -0700 (Tue, 28 Oct 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Introduce a new abstract class called AudioProducer and keep a set of AudioProducers
rather than the active MediaSessions in Document
https://bugs.webkit.org/show_bug.cgi?id=138107

Reviewed by Eric Carlson.

No new tests, no behavior change.

* WebCore.xcodeproj/project.pbxproj:
Add AudioProducer.h to the project.
* dom/Document.cpp:
(WebCore::Document::addAudioProducer):
(WebCore::Document::removeAudioProducer):
(WebCore::Document::updateIsPlayingAudio):
Go through the set of AudioProducers and see if any is playing audio.
Now that this method no longer refers to MediaSessions directly, this code
does not need to be guarded by #if ENABLE(VIDEO).
(WebCore::Document::registerMediaSession): Deleted.
(WebCore::Document::unregisterMediaSession): Deleted.
* dom/Document.h:
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::registerWithDocument):
(WebCore::HTMLMediaElement::unregisterWithDocument):
(WebCore::HTMLMediaElement::isPlayingAudio):
Return whether this element is playing audio.
* html/HTMLMediaElement.h:
* page/AudioProducer.h: Added.
(WebCore::AudioProducer::~AudioProducer):
* page/Page.cpp:
(WebCore::Page::updateIsPlayingAudio):
This is no longer guarded with #if ENABLE(VIDEO) since the Document methods it calls
are no longer guarded.
* page/Page.h:</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="#trunkSourceWebCoredomDocumentcpp">trunk/Source/WebCore/dom/Document.cpp</a></li>
<li><a href="#trunkSourceWebCoredomDocumenth">trunk/Source/WebCore/dom/Document.h</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLMediaElementcpp">trunk/Source/WebCore/html/HTMLMediaElement.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLMediaElementh">trunk/Source/WebCore/html/HTMLMediaElement.h</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>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebCorepageAudioProducerh">trunk/Source/WebCore/page/AudioProducer.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (175272 => 175273)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-10-28 21:42:27 UTC (rev 175272)
+++ trunk/Source/WebCore/ChangeLog        2014-10-28 22:00:39 UTC (rev 175273)
</span><span class="lines">@@ -1,3 +1,39 @@
</span><ins>+2014-10-27  Ada Chan  &lt;adachan@apple.com&gt;
+
+        Introduce a new abstract class called AudioProducer and keep a set of AudioProducers
+        rather than the active MediaSessions in Document
+        https://bugs.webkit.org/show_bug.cgi?id=138107
+
+        Reviewed by Eric Carlson.
+
+        No new tests, no behavior change.
+
+        * WebCore.xcodeproj/project.pbxproj:
+        Add AudioProducer.h to the project.
+        * dom/Document.cpp:
+        (WebCore::Document::addAudioProducer):
+        (WebCore::Document::removeAudioProducer):
+        (WebCore::Document::updateIsPlayingAudio):
+        Go through the set of AudioProducers and see if any is playing audio.
+        Now that this method no longer refers to MediaSessions directly, this code
+        does not need to be guarded by #if ENABLE(VIDEO).
+        (WebCore::Document::registerMediaSession): Deleted.
+        (WebCore::Document::unregisterMediaSession): Deleted.
+        * dom/Document.h:
+        * html/HTMLMediaElement.cpp:
+        (WebCore::HTMLMediaElement::registerWithDocument):
+        (WebCore::HTMLMediaElement::unregisterWithDocument):
+        (WebCore::HTMLMediaElement::isPlayingAudio):
+        Return whether this element is playing audio.
+        * html/HTMLMediaElement.h:
+        * page/AudioProducer.h: Added.
+        (WebCore::AudioProducer::~AudioProducer):
+        * page/Page.cpp:
+        (WebCore::Page::updateIsPlayingAudio):
+        This is no longer guarded with #if ENABLE(VIDEO) since the Document methods it calls
+        are no longer guarded.
+        * page/Page.h:
+
</ins><span class="cx"> 2014-10-28  Chris Dumez  &lt;cdumez@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Unreviewed comment fix from r175267.
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (175272 => 175273)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2014-10-28 21:42:27 UTC (rev 175272)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2014-10-28 22:00:39 UTC (rev 175273)
</span><span class="lines">@@ -2043,6 +2043,7 @@
</span><span class="cx">                 52CCA9E815E3F64C0053C77F /* DOMDOMNamedFlowCollection.h in Headers */ = {isa = PBXBuildFile; fileRef = 52CCA9E515E3F64C0053C77F /* DOMDOMNamedFlowCollection.h */; };
</span><span class="cx">                 52CCA9E915E3F64C0053C77F /* DOMDOMNamedFlowCollection.mm in Sources */ = {isa = PBXBuildFile; fileRef = 52CCA9E615E3F64C0053C77F /* DOMDOMNamedFlowCollection.mm */; };
</span><span class="cx">                 52CCA9EA15E3F64C0053C77F /* DOMDOMNamedFlowCollectionInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 52CCA9E715E3F64C0053C77F /* DOMDOMNamedFlowCollectionInternal.h */; };
</span><ins>+                52E2CAFC19FF0207001EEB4F /* AudioProducer.h in Headers */ = {isa = PBXBuildFile; fileRef = 52E2CAFB19FF0207001EEB4F /* AudioProducer.h */; settings = {ATTRIBUTES = (Private, ); }; };
</ins><span class="cx">                 52F10865162B6DA4009AC81E /* MixedContentChecker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 52F10862162B6D82009AC81E /* MixedContentChecker.cpp */; };
</span><span class="cx">                 52F10866162B6DA8009AC81E /* MixedContentChecker.h in Headers */ = {isa = PBXBuildFile; fileRef = 52F10863162B6D82009AC81E /* MixedContentChecker.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 52F52E1114A0134F00ACC397 /* NSScrollerImpDetails.mm in Sources */ = {isa = PBXBuildFile; fileRef = 52F52E1014A0134F00ACC397 /* NSScrollerImpDetails.mm */; };
</span><span class="lines">@@ -9182,6 +9183,7 @@
</span><span class="cx">                 52CCA9E515E3F64C0053C77F /* DOMDOMNamedFlowCollection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMDOMNamedFlowCollection.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 52CCA9E615E3F64C0053C77F /* DOMDOMNamedFlowCollection.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DOMDOMNamedFlowCollection.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 52CCA9E715E3F64C0053C77F /* DOMDOMNamedFlowCollectionInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMDOMNamedFlowCollectionInternal.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                52E2CAFB19FF0207001EEB4F /* AudioProducer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AudioProducer.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 52F10862162B6D82009AC81E /* MixedContentChecker.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MixedContentChecker.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 52F10863162B6D82009AC81E /* MixedContentChecker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MixedContentChecker.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 52F52E1014A0134F00ACC397 /* NSScrollerImpDetails.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = NSScrollerImpDetails.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -16575,6 +16577,7 @@
</span><span class="cx">                                 8538F0000AD71770006A81D1 /* AbstractView.idl */,
</span><span class="cx">                                 BCF48CE61370D114004E87D6 /* AdjustViewSizeOrNot.h */,
</span><span class="cx">                                 CEDA12D6152CA1CB00D9E08D /* AlternativeTextClient.h */,
</span><ins>+                                52E2CAFB19FF0207001EEB4F /* AudioProducer.h */,
</ins><span class="cx">                                 45830D4B1679B4F800ACF8C3 /* AutoscrollController.cpp */,
</span><span class="cx">                                 45830D4C1679B4F800ACF8C3 /* AutoscrollController.h */,
</span><span class="cx">                                 BC124EE40C2641CD009E2349 /* BarProp.cpp */,
</span><span class="lines">@@ -25869,6 +25872,7 @@
</span><span class="cx">                                 7EE6846F12D26E3800E79415 /* ResourceRequestCFNet.h in Headers */,
</span><span class="cx">                                 7EE6847012D26E3800E79415 /* ResourceResponse.h in Headers */,
</span><span class="cx">                                 514C767F0CE923A1007EF3CD /* ResourceResponseBase.h in Headers */,
</span><ins>+                                52E2CAFC19FF0207001EEB4F /* AudioProducer.h in Headers */,
</ins><span class="cx">                                 FD3160A512B026F700C1A359 /* Reverb.h in Headers */,
</span><span class="cx">                                 FD3160A712B026F700C1A359 /* ReverbAccumulationBuffer.h in Headers */,
</span><span class="cx">                                 FD3160A912B026F700C1A359 /* ReverbConvolver.h in Headers */,
</span></span></pre></div>
<a id="trunkSourceWebCoredomDocumentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Document.cpp (175272 => 175273)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Document.cpp        2014-10-28 21:42:27 UTC (rev 175272)
+++ trunk/Source/WebCore/dom/Document.cpp        2014-10-28 22:00:39 UTC (rev 175273)
</span><span class="lines">@@ -31,6 +31,7 @@
</span><span class="cx"> #include &quot;AXObjectCache.h&quot;
</span><span class="cx"> #include &quot;AnimationController.h&quot;
</span><span class="cx"> #include &quot;Attr.h&quot;
</span><ins>+#include &quot;AudioProducer.h&quot;
</ins><span class="cx"> #include &quot;CDATASection.h&quot;
</span><span class="cx"> #include &quot;CSSStyleDeclaration.h&quot;
</span><span class="cx"> #include &quot;CSSStyleSheet.h&quot;
</span><span class="lines">@@ -99,7 +100,6 @@
</span><span class="cx"> #include &quot;MediaCanStartListener.h&quot;
</span><span class="cx"> #include &quot;MediaQueryList.h&quot;
</span><span class="cx"> #include &quot;MediaQueryMatcher.h&quot;
</span><del>-#include &quot;MediaSession.h&quot;
</del><span class="cx"> #include &quot;MouseEventWithHitTestResults.h&quot;
</span><span class="cx"> #include &quot;NameNodeList.h&quot;
</span><span class="cx"> #include &quot;NestingLevelIncrementer.h&quot;
</span><span class="lines">@@ -3273,24 +3273,23 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-#if ENABLE(VIDEO)
-void Document::registerMediaSession(MediaSession&amp; mediaSession)
</del><ins>+void Document::addAudioProducer(AudioProducer* audioProducer)
</ins><span class="cx"> {
</span><del>-    m_mediaSessions.add(&amp;mediaSession);
</del><ins>+    m_audioProducers.add(audioProducer);
</ins><span class="cx">     updateIsPlayingAudio();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void Document::unregisterMediaSession(MediaSession&amp; mediaSession)
</del><ins>+void Document::removeAudioProducer(AudioProducer* audioProducer)
</ins><span class="cx"> {
</span><del>-    m_mediaSessions.remove(&amp;mediaSession);
</del><ins>+    m_audioProducers.remove(audioProducer);
</ins><span class="cx">     updateIsPlayingAudio();
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void Document::updateIsPlayingAudio()
</span><span class="cx"> {
</span><span class="cx">     bool isPlayingAudio = false;
</span><del>-    for (auto mediaSession : m_mediaSessions) {
-        if (mediaSession-&gt;hasMediaCharacteristics(MediaSession::MediaCharacteristicAudible) &amp;&amp; mediaSession-&gt;state() == MediaSession::Playing) {
</del><ins>+    for (auto audioProducer : m_audioProducers) {
+        if (audioProducer-&gt;isPlayingAudio()) {
</ins><span class="cx">             isPlayingAudio = true;
</span><span class="cx">             break;
</span><span class="cx">         }
</span><span class="lines">@@ -3304,7 +3303,6 @@
</span><span class="cx">     if (page())
</span><span class="cx">         page()-&gt;updateIsPlayingAudio();
</span><span class="cx"> }
</span><del>-#endif
</del><span class="cx"> 
</span><span class="cx"> void Document::styleResolverChanged(StyleResolverUpdateFlag updateFlag)
</span><span class="cx"> {
</span></span></pre></div>
<a id="trunkSourceWebCoredomDocumenth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Document.h (175272 => 175273)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Document.h        2014-10-28 21:42:27 UTC (rev 175272)
+++ trunk/Source/WebCore/dom/Document.h        2014-10-28 22:00:39 UTC (rev 175273)
</span><span class="lines">@@ -67,6 +67,7 @@
</span><span class="cx"> 
</span><span class="cx"> class AXObjectCache;
</span><span class="cx"> class Attr;
</span><ins>+class AudioProducer;
</ins><span class="cx"> class CDATASection;
</span><span class="cx"> class CSSStyleDeclaration;
</span><span class="cx"> class CSSStyleSheet;
</span><span class="lines">@@ -122,7 +123,6 @@
</span><span class="cx"> class MediaCanStartListener;
</span><span class="cx"> class MediaQueryList;
</span><span class="cx"> class MediaQueryMatcher;
</span><del>-class MediaSession;
</del><span class="cx"> class MouseEventWithHitTestResults;
</span><span class="cx"> class NamedFlowCollection;
</span><span class="cx"> class NodeFilter;
</span><span class="lines">@@ -1288,12 +1288,10 @@
</span><span class="cx">     bool hasStyleWithViewportUnits() const { return m_hasStyleWithViewportUnits; }
</span><span class="cx">     void updateViewportUnitsOnResize();
</span><span class="cx"> 
</span><del>-#if ENABLE(VIDEO)
-    void registerMediaSession(MediaSession&amp;);
-    void unregisterMediaSession(MediaSession&amp;);
</del><ins>+    void addAudioProducer(AudioProducer*);
+    void removeAudioProducer(AudioProducer*);
</ins><span class="cx">     bool isPlayingAudio() const { return m_isPlayingAudio; }
</span><span class="cx">     void updateIsPlayingAudio();
</span><del>-#endif
</del><span class="cx"> 
</span><span class="cx"> protected:
</span><span class="cx">     enum ConstructionFlags { Synthesized = 1, NonRenderedPlaceholder = 1 &lt;&lt; 1 };
</span><span class="lines">@@ -1725,7 +1723,7 @@
</span><span class="cx"> 
</span><span class="cx">     bool m_hasStyleWithViewportUnits;
</span><span class="cx"> 
</span><del>-    HashSet&lt;MediaSession*&gt; m_mediaSessions;
</del><ins>+    HashSet&lt;AudioProducer*&gt; m_audioProducers;
</ins><span class="cx">     bool m_isPlayingAudio;
</span><span class="cx"> };
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLMediaElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLMediaElement.cpp (175272 => 175273)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLMediaElement.cpp        2014-10-28 21:42:27 UTC (rev 175272)
+++ trunk/Source/WebCore/html/HTMLMediaElement.cpp        2014-10-28 22:00:39 UTC (rev 175273)
</span><span class="lines">@@ -443,7 +443,7 @@
</span><span class="cx">         document.registerForPageScaleFactorChangedCallbacks(this);
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-    document.registerMediaSession(*m_mediaSession);
</del><ins>+    document.addAudioProducer(this);
</ins><span class="cx">     addElementToDocumentMap(*this, document);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -468,7 +468,7 @@
</span><span class="cx">         document.unregisterForPageScaleFactorChangedCallbacks(this);
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-    document.unregisterMediaSession(*m_mediaSession);
</del><ins>+    document.removeAudioProducer(this);
</ins><span class="cx">     removeElementFromDocumentMap(*this, document);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -6022,6 +6022,11 @@
</span><span class="cx">     document().updateIsPlayingAudio();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+bool HTMLMediaElement::isPlayingAudio()
+{
+    return m_mediaSession-&gt;state() == MediaSession::Playing &amp;&amp; hasAudio();
+}
+
</ins><span class="cx"> bool HTMLMediaElement::doesHaveAttribute(const AtomicString&amp; attribute, AtomicString* value) const
</span><span class="cx"> {
</span><span class="cx">     QualifiedName attributeName(nullAtom, attribute, nullAtom);
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLMediaElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLMediaElement.h (175272 => 175273)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLMediaElement.h        2014-10-28 21:42:27 UTC (rev 175272)
+++ trunk/Source/WebCore/html/HTMLMediaElement.h        2014-10-28 22:00:39 UTC (rev 175273)
</span><span class="lines">@@ -29,6 +29,7 @@
</span><span class="cx"> #if ENABLE(VIDEO)
</span><span class="cx"> #include &quot;HTMLElement.h&quot;
</span><span class="cx"> #include &quot;ActiveDOMObject.h&quot;
</span><ins>+#include &quot;AudioProducer.h&quot;
</ins><span class="cx"> #include &quot;GenericEventQueue.h&quot;
</span><span class="cx"> #include &quot;HTMLMediaSession.h&quot;
</span><span class="cx"> #include &quot;MediaCanStartListener.h&quot;
</span><span class="lines">@@ -94,7 +95,7 @@
</span><span class="cx"> 
</span><span class="cx"> class HTMLMediaElement
</span><span class="cx">     : public HTMLElement
</span><del>-    , private MediaPlayerClient, public MediaPlayerSupportsTypeClient, private MediaCanStartListener, public ActiveDOMObject, public MediaControllerInterface , public MediaSessionClient
</del><ins>+    , private MediaPlayerClient, public MediaPlayerSupportsTypeClient, private MediaCanStartListener, public ActiveDOMObject, public MediaControllerInterface , public MediaSessionClient, private AudioProducer
</ins><span class="cx"> #if ENABLE(VIDEO_TRACK)
</span><span class="cx">     , private AudioTrackClient
</span><span class="cx">     , private TextTrackClient
</span><span class="lines">@@ -707,6 +708,9 @@
</span><span class="cx">     virtual bool hasMediaCharacteristics(MediaSession::MediaCharacteristics) const override;
</span><span class="cx">     virtual void mediaStateDidChange() override;
</span><span class="cx"> 
</span><ins>+    // AudioProducer overrides
+    virtual bool isPlayingAudio() override;
+
</ins><span class="cx">     void registerWithDocument(Document&amp;);
</span><span class="cx">     void unregisterWithDocument(Document&amp;);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorepageAudioProducerh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/page/AudioProducer.h (0 => 175273)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/AudioProducer.h                                (rev 0)
+++ trunk/Source/WebCore/page/AudioProducer.h        2014-10-28 22:00:39 UTC (rev 175273)
</span><span class="lines">@@ -0,0 +1,41 @@
</span><ins>+/*
+ * Copyright (C) 2014 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE 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 AudioProducer_h
+#define AudioProducer_h
+
+namespace WebCore {
+
+class AudioProducer {
+public:
+    virtual bool isPlayingAudio() = 0;
+
+protected:
+    virtual ~AudioProducer() { }
+};
+
+}
+
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebCorepagePagecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/Page.cpp (175272 => 175273)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/Page.cpp        2014-10-28 21:42:27 UTC (rev 175272)
+++ trunk/Source/WebCore/page/Page.cpp        2014-10-28 22:00:39 UTC (rev 175273)
</span><span class="lines">@@ -1193,7 +1193,6 @@
</span><span class="cx">     setSessionID(privateBrowsingEnabled ? SessionID::legacyPrivateSessionID() : SessionID::defaultSessionID());
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-#if ENABLE(VIDEO)
</del><span class="cx"> void Page::updateIsPlayingAudio()
</span><span class="cx"> {
</span><span class="cx">     bool isPlayingAudio = false;
</span><span class="lines">@@ -1211,7 +1210,6 @@
</span><span class="cx"> 
</span><span class="cx">     chrome().client().isPlayingAudioDidChange(m_isPlayingAudio);
</span><span class="cx"> }
</span><del>-#endif
</del><span class="cx"> 
</span><span class="cx"> #if !ASSERT_DISABLED
</span><span class="cx"> void Page::checkSubframeCountConsistency() const
</span></span></pre></div>
<a id="trunkSourceWebCorepagePageh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/Page.h (175272 => 175273)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/Page.h        2014-10-28 21:42:27 UTC (rev 175272)
+++ trunk/Source/WebCore/page/Page.h        2014-10-28 22:00:39 UTC (rev 175273)
</span><span class="lines">@@ -436,10 +436,8 @@
</span><span class="cx">     WEBCORE_EXPORT void enableLegacyPrivateBrowsing(bool privateBrowsingEnabled);
</span><span class="cx">     bool usesEphemeralSession() const { return m_sessionID.isEphemeral(); }
</span><span class="cx"> 
</span><del>-#if ENABLE(VIDEO)
</del><span class="cx">     bool isPlayingAudio() const { return m_isPlayingAudio; }
</span><span class="cx">     void updateIsPlayingAudio();
</span><del>-#endif
</del><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     WEBCORE_EXPORT void initGroup();
</span></span></pre>
</div>
</div>

</body>
</html>