Unreviewed, rolling out r245946.
authorryanhaddad@apple.com <ryanhaddad@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 31 May 2019 15:20:48 +0000 (15:20 +0000)
committerryanhaddad@apple.com <ryanhaddad@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 31 May 2019 15:20:48 +0000 (15:20 +0000)
Breaks the watchOS build.

Reverted changeset:

"Add an option to mute audio capture automatically when page
is not visible"
https://bugs.webkit.org/show_bug.cgi?id=198307
https://trac.webkit.org/changeset/245946

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@245964 268f45cc-cd09-0410-ab3c-d52691b4dbfc

26 files changed:
LayoutTests/ChangeLog
LayoutTests/platform/ios/mediastream/audio-muted-in-background-tab-expected.txt [deleted file]
LayoutTests/platform/ios/mediastream/audio-muted-in-background-tab.html [deleted file]
Source/WebCore/ChangeLog
Source/WebCore/SourcesCocoa.txt
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/dom/Document.cpp
Source/WebCore/page/RuntimeEnabledFeatures.h
Source/WebCore/platform/mediastream/RealtimeMediaSourceCenter.cpp
Source/WebCore/platform/mediastream/RealtimeMediaSourceCenter.h
Source/WebCore/platform/mediastream/RealtimeMediaSourceFactory.h
Source/WebCore/platform/mediastream/ios/CoreAudioCaptureSourceIOS.mm
Source/WebCore/platform/mediastream/mac/CoreAudioCaptureSource.h
Source/WebCore/platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp
Source/WebCore/platform/mediastream/mac/RealtimeMediaSourceCenterMac.mm [deleted file]
Source/WebCore/platform/mock/MockRealtimeMediaSourceCenter.cpp
Source/WebCore/testing/Internals.cpp
Source/WebCore/testing/Internals.h
Source/WebCore/testing/Internals.idl
Source/WebKit/ChangeLog
Source/WebKit/Scripts/PreferencesTemplates/WebPreferencesStoreDefaultsMap.cpp.erb
Source/WebKit/Shared/WebPreferences.yaml
Source/WebKit/UIProcess/API/Cocoa/WKPreferences.mm
Source/WebKit/UIProcess/API/Cocoa/WKPreferencesPrivate.h
Source/WebKit/WebProcess/cocoa/UserMediaCaptureManager.cpp
Source/WebKit/WebProcess/cocoa/UserMediaCaptureManager.h

index 859b4f3..37329cc 100644 (file)
@@ -1,3 +1,16 @@
+2019-05-31  Ryan Haddad  <ryanhaddad@apple.com>
+
+        Unreviewed, rolling out r245946.
+
+        Breaks the watchOS build.
+
+        Reverted changeset:
+
+        "Add an option to mute audio capture automatically when page
+        is not visible"
+        https://bugs.webkit.org/show_bug.cgi?id=198307
+        https://trac.webkit.org/changeset/245946
+
 2019-05-31  Per Arne Vollan  <pvollan@apple.com>
 
         [Win10] Some tests are failing only on specific machines
diff --git a/LayoutTests/platform/ios/mediastream/audio-muted-in-background-tab-expected.txt b/LayoutTests/platform/ios/mediastream/audio-muted-in-background-tab-expected.txt
deleted file mode 100644 (file)
index 408e29c..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-
-PASS Setup stream 
-PASS Hide page, video and audio should be muted 
-PASS Show page, video and audio should be unmuted 
-PASS Hide and mute page, video and audio should be muted 
-PASS Show page, video and audio should remain muted 
-
diff --git a/LayoutTests/platform/ios/mediastream/audio-muted-in-background-tab.html b/LayoutTests/platform/ios/mediastream/audio-muted-in-background-tab.html
deleted file mode 100644 (file)
index 80e49ed..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-
-<!doctype html>
-<html>
-    <head>
-        <meta charset="utf-8">
-        <title>Don't unmute audio when a tab becomes visible unless it was muted when the tab was hidden</title>
-        <script src="../../../resources/testharness.js"></script>
-        <script src="../../../resources/testharnessreport.js"></script>
-    </head>
-    <body>
-        <script>
-            let audioTrack;
-            let videoTrack;
-
-            promise_test((t) => {
-                if (window.testRunner)
-                    testRunner.setUserMediaPermission(true);
-                if (!window.internals)
-                    return Promise.reject("this test needs internals API");
-
-                internals.setShouldInterruptAudioOnPageVisibilityChange(true);
-
-                return navigator.mediaDevices.getUserMedia({ audio: true, video: true }).then((stream) => {
-                    audioTrack = stream.getAudioTracks()[0];
-                    videoTrack = stream.getVideoTracks()[0];
-
-                    assert_false(audioTrack.muted, "audio track is active");
-                    assert_false(videoTrack.muted, "video track is active");
-                })
-
-                .then(() => {
-                    test(() => {
-                        if (window.internals)
-                            window.internals.setPageVisibility(false);
-                        assert_true(audioTrack.muted, "audio track is muted");
-                        assert_true(videoTrack.muted, "video track is muted");
-                    }, "Hide page, video and audio should be muted");
-                })
-
-                .then(() => {
-                    test(() => {
-                        if (window.internals)
-                            window.internals.setPageVisibility(true);
-                        assert_false(audioTrack.muted, "audio track is active");
-                        assert_false(videoTrack.muted, "video track is active");
-                    }, "Show page, video and audio should be unmuted");
-                })
-
-                .then(() => {
-                    test(() => {
-                        if (window.internals) {
-                            window.internals.setPageVisibility(false);
-                            window.internals.setPageMuted("capturedevices");
-                        }
-                        assert_true(audioTrack.muted, "audio track is muted");
-                        assert_true(videoTrack.muted, "video track is muted");
-                    }, "Hide and mute page, video and audio should be muted");
-                })
-
-                .then(() => {
-                    test(() => {
-                        if (window.internals)
-                            window.internals.setPageVisibility(true);
-                        assert_true(audioTrack.muted, "audio track is muted");
-                        assert_true(videoTrack.muted, "video track is muted");
-                    }, "Show page, video and audio should remain muted");
-                })
-            }, "Setup stream");
-
-        </script>
-    </body>
-</html>
index c30b29c..ea6a960 100644 (file)
@@ -1,3 +1,16 @@
+2019-05-31  Ryan Haddad  <ryanhaddad@apple.com>
+
+        Unreviewed, rolling out r245946.
+
+        Breaks the watchOS build.
+
+        Reverted changeset:
+
+        "Add an option to mute audio capture automatically when page
+        is not visible"
+        https://bugs.webkit.org/show_bug.cgi?id=198307
+        https://trac.webkit.org/changeset/245946
+
 2019-05-31  Zalan Bujtas  <zalan@apple.com>
 
         [LFC[IFC] Do not reuse the same Line object.
index bd29e5b..c081198 100644 (file)
@@ -542,7 +542,6 @@ platform/mediastream/mac/DisplayCaptureSourceCocoa.cpp
 platform/mediastream/mac/RealtimeIncomingAudioSourceCocoa.cpp
 platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm
 platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp
-platform/mediastream/mac/RealtimeMediaSourceCenterMac.mm
 platform/mediastream/mac/RealtimeOutgoingAudioSourceCocoa.cpp
 platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.cpp
 platform/mediastream/mac/ScreenDisplayCaptureSourceMac.mm
index 8334a9f..3c91f43 100644 (file)
                4162A44F101145AE00DFF3ED /* DedicatedWorkerGlobalScope.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = DedicatedWorkerGlobalScope.idl; sourceTree = "<group>"; };
                4162A4551011464700DFF3ED /* JSDedicatedWorkerGlobalScope.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDedicatedWorkerGlobalScope.cpp; sourceTree = "<group>"; };
                4162A4561011464700DFF3ED /* JSDedicatedWorkerGlobalScope.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSDedicatedWorkerGlobalScope.h; sourceTree = "<group>"; };
-               416CE4A4229DF12E00A8A686 /* RealtimeMediaSourceCenterMac.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = RealtimeMediaSourceCenterMac.mm; sourceTree = "<group>"; };
                416D759F20C6441300D02D2C /* NetworkLoadInformation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NetworkLoadInformation.h; sourceTree = "<group>"; };
                416E0B37209BC3C2004A95D9 /* FetchIdentifier.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FetchIdentifier.h; sourceTree = "<group>"; };
                416E29A5102FA962007FC14E /* WorkerReportingProxy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WorkerReportingProxy.h; sourceTree = "<group>"; };
                                5CDD833A1E4324BB00621E83 /* RealtimeIncomingVideoSourceCocoa.h */,
                                5CDD83391E4324BB00621E83 /* RealtimeIncomingVideoSourceCocoa.mm */,
                                4A0FFAA31AAF5EF60062803B /* RealtimeMediaSourceCenterMac.cpp */,
-                               416CE4A4229DF12E00A8A686 /* RealtimeMediaSourceCenterMac.mm */,
                                41103AA71E39790A00769F14 /* RealtimeOutgoingAudioSourceCocoa.cpp */,
                                41103AA81E39790A00769F14 /* RealtimeOutgoingAudioSourceCocoa.h */,
                                5CDD833B1E4324BB00621B83 /* RealtimeOutgoingVideoSourceCocoa.cpp */,
                115CFA9A208BC140001E6991 /* inlineformatting */ = {
                        isa = PBXGroup;
                        children = (
+                               6F0CD694229ED32700C5994E /* InlineLine.h */,
+                               6F0CD692229ED31900C5994E /* InlineLine.cpp */,
                                6FE7DDDD20EC6E8B008B5B4E /* text */,
                                6F7CA3C9208C2B2E002F29AB /* InlineFormattingContext.cpp */,
                                6F7CA3C8208C2B2E002F29AB /* InlineFormattingContext.h */,
                                1123AFDD209ABBBA00736ACC /* InlineInvalidation.cpp */,
                                1123AFDC209ABBBA00736ACC /* InlineInvalidation.h */,
                                6FE7CFA02177EEF1005B1573 /* InlineItem.h */,
-                               6F0CD692229ED31900C5994E /* InlineLine.cpp */,
-                               6F0CD694229ED32700C5994E /* InlineLine.h */,
                                6FB47E612277425A00C7BCB0 /* InlineLineBox.h */,
                                6FE198132178397B00446F08 /* InlineLineBreaker.cpp */,
                                6FE198152178397C00446F08 /* InlineLineBreaker.h */,
                                714C7C661FDAD2A100F2BEE1 /* AnimationPlaybackEvent.h in Headers */,
                                714C7C671FDAD2A900F2BEE1 /* AnimationPlaybackEventInit.h in Headers */,
                                71025ECD1F99F0CE004A250C /* AnimationTimeline.h in Headers */,
+                               6F0CD695229ED32700C5994E /* InlineLine.h in Headers */,
                                0F580FAF149800D400FB5BD8 /* AnimationUtilities.h in Headers */,
                                57152B5A21CB3E88000C37CA /* ApduCommand.h in Headers */,
                                57152B5C21CC1902000C37CA /* ApduResponse.h in Headers */,
                                11310CF820BA4A6A0065A8D0 /* InlineInvalidation.h in Headers */,
                                6FE7CFA22177EEF2005B1573 /* InlineItem.h in Headers */,
                                BCE789161120D6080060ECE5 /* InlineIterator.h in Headers */,
-                               6F0CD695229ED32700C5994E /* InlineLine.h in Headers */,
                                6FB47E632277425A00C7BCB0 /* InlineLineBox.h in Headers */,
                                6FE198172178397C00446F08 /* InlineLineBreaker.h in Headers */,
                                AA4C3A770B2B1679002334A2 /* InlineStyleSheetOwner.h in Headers */,
index a998242..2c4d0b6 100644 (file)
@@ -7648,7 +7648,7 @@ void Document::notifyMediaCaptureOfVisibilityChanged()
     if (!page())
         return;
 
-    RealtimeMediaSourceCenter::singleton().setCapturePageState(hidden(), page()->isMediaCaptureMuted());
+    RealtimeMediaSourceCenter::singleton().setVideoCapturePageState(hidden(), page()->isMediaCaptureMuted());
 #endif
 }
 
index 9734f0a..a40c762 100644 (file)
@@ -357,9 +357,6 @@ public:
     bool pageAtRuleSupportEnabled() const { return m_pageAtRuleSupportEnabled; }
     void setPageAtRuleSupportEnabled(bool isEnabled) { m_pageAtRuleSupportEnabled = isEnabled; }
 
-    bool interruptAudioOnPageVisibilityChangeEnabled() const { return m_interruptAudioOnPageVisibilityChangeEnabled; }
-    void setInterruptAudioOnPageVisibilityChangeEnabled(bool enabled) { m_interruptAudioOnPageVisibilityChangeEnabled = enabled; }
-
     WEBCORE_EXPORT static RuntimeEnabledFeatures& sharedFeatures();
 
 private:
@@ -543,7 +540,6 @@ private:
     bool m_isITPFirstPartyWebsiteDataRemovalEnabled { false };
 
     bool m_referrerPolicyAttributeEnabled { false };
-    bool m_interruptAudioOnPageVisibilityChangeEnabled { false };
 
     friend class WTF::NeverDestroyed<RuntimeEnabledFeatures>;
 };
index b53f1f7..3706fad 100644 (file)
@@ -38,7 +38,6 @@
 #include "CaptureDeviceManager.h"
 #include "Logging.h"
 #include "MediaStreamPrivate.h"
-#include "RuntimeEnabledFeatures.h"
 #include <wtf/SHA1.h>
 
 namespace WebCore {
@@ -263,10 +262,8 @@ void RealtimeMediaSourceCenter::validateRequestConstraints(ValidConstraintsHandl
     validHandler(WTFMove(audioDevices), WTFMove(videoDevices), WTFMove(deviceIdentifierHashSalt));
 }
 
-void RealtimeMediaSourceCenter::setCapturePageState(bool interrupted, bool pageMuted)
+void RealtimeMediaSourceCenter::setVideoCapturePageState(bool interrupted, bool pageMuted)
 {
-    if (RuntimeEnabledFeatures::sharedFeatures().interruptAudioOnPageVisibilityChangeEnabled())
-        audioCaptureFactory().setAudioCapturePageState(interrupted, pageMuted);
     videoCaptureFactory().setVideoCapturePageState(interrupted, pageMuted);
 }
 
@@ -320,13 +317,6 @@ DisplayCaptureFactory& RealtimeMediaSourceCenter::displayCaptureFactory()
     return m_displayCaptureFactoryOverride ? *m_displayCaptureFactoryOverride : defaultDisplayCaptureFactory();
 }
 
-#if !PLATFORM(COCOA)
-bool RealtimeMediaSourceCenter::shouldInterruptAudioOnPageVisibilityChange()
-{
-    return false;
-}
-#endif
-
 } // namespace WebCore
 
 #endif // ENABLE(MEDIA_STREAM)
index 3738768..3bb2594 100644 (file)
@@ -86,12 +86,10 @@ public:
 
     WEBCORE_EXPORT void setDevicesChangedObserver(std::function<void()>&&);
 
-    void setCapturePageState(bool interrupted, bool pageMuted);
+    void setVideoCapturePageState(bool, bool);
 
     void captureDevicesChanged();
 
-    WEBCORE_EXPORT static bool shouldInterruptAudioOnPageVisibilityChange();
-
 private:
     RealtimeMediaSourceCenter();
     friend class NeverDestroyed<RealtimeMediaSourceCenter>;
@@ -115,8 +113,6 @@ private:
     AudioCaptureFactory* m_audioCaptureFactoryOverride { nullptr };
     VideoCaptureFactory* m_videoCaptureFactoryOverride { nullptr };
     DisplayCaptureFactory* m_displayCaptureFactoryOverride { nullptr };
-
-    bool m_shouldInterruptAudioOnPageVisibilityChange { false };
 };
 
 } // namespace WebCore
index a3d52f0..4897c64 100644 (file)
@@ -57,11 +57,6 @@ public:
     virtual ~AudioCaptureFactory() = default;
     virtual CaptureSourceOrError createAudioCaptureSource(const CaptureDevice&, String&&, const MediaConstraints*) = 0;
     virtual CaptureDeviceManager& audioCaptureDeviceManager() = 0;
-    virtual void setAudioCapturePageState(bool interrupted, bool pageMuted)
-    {
-        UNUSED_PARAM(interrupted);
-        UNUSED_PARAM(pageMuted);
-    }
 
 protected:
     AudioCaptureFactory() = default;
@@ -76,11 +71,7 @@ public:
     virtual ~VideoCaptureFactory() = default;
     virtual CaptureSourceOrError createVideoCaptureSource(const CaptureDevice&, String&&, const MediaConstraints*) = 0;
     virtual CaptureDeviceManager& videoCaptureDeviceManager() = 0;
-    virtual void setVideoCapturePageState(bool interrupted, bool pageMuted)
-    {
-        UNUSED_PARAM(interrupted);
-        UNUSED_PARAM(pageMuted);
-    }
+    virtual void setVideoCapturePageState(bool, bool) { }
 
 protected:
     VideoCaptureFactory() = default;
@@ -91,6 +82,7 @@ public:
     virtual ~DisplayCaptureFactory() = default;
     virtual CaptureSourceOrError createDisplayCaptureSource(const CaptureDevice&, const MediaConstraints*) = 0;
     virtual CaptureDeviceManager& displayCaptureDeviceManager() = 0;
+    virtual void setDisplayCapturePageState(bool , bool) { }
 
 protected:
     DisplayCaptureFactory() = default;
index 4c82648..6fb3dad 100644 (file)
@@ -126,12 +126,6 @@ CoreAudioCaptureSourceFactory& CoreAudioCaptureSourceFactory::singleton()
     return factory.get();
 }
 
-void CoreAudioCaptureSourceFactory::setAudioCapturePageState(bool interrupted, bool pageMuted)
-{
-    if (auto* activeSource = this->activeSource())
-        activeSource->setInterrupted(interrupted, pageMuted);
-}
-
 }
 
 #endif // ENABLE(MEDIA_STREAM) && PLATFORM(IOS_FAMILY)
index adbefe7..1ab816c 100644 (file)
@@ -142,9 +142,6 @@ private:
     }
 
     CaptureDeviceManager& audioCaptureDeviceManager() final;
-#if PLATFORM(IOS_FAMILY)
-    void setAudioCapturePageState(bool interrupted, bool pageMuted) final;
-#endif
 };
 
 } // namespace WebCore
index a328cd3..a6a0dab 100644 (file)
@@ -38,7 +38,6 @@
 #include "DisplayCaptureManagerCocoa.h"
 #include "Logging.h"
 #include "MediaStreamPrivate.h"
-#include "RuntimeEnabledFeatures.h"
 #include "ScreenDisplayCaptureSourceMac.h"
 #include "WindowDisplayCaptureSourceMac.h"
 #include <wtf/MainThread.h>
diff --git a/Source/WebCore/platform/mediastream/mac/RealtimeMediaSourceCenterMac.mm b/Source/WebCore/platform/mediastream/mac/RealtimeMediaSourceCenterMac.mm
deleted file mode 100644 (file)
index 0aa220a..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (C) 2017 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. AND ITS CONTRIBUTORS ``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 ITS 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.
- */
-
-#include "config.h"
-#include "RealtimeMediaSourceCenter.h"
-
-#if ENABLE(MEDIA_STREAM)
-
-namespace WebCore {
-
-bool RealtimeMediaSourceCenter::shouldInterruptAudioOnPageVisibilityChange()
-{
-#if PLATFORM(IOS)
-    NSArray *modes = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"UIBackgroundModes"];
-    if (!modes)
-        return true;
-    
-    int modesCount = [modes count];
-    for (int i = 0; i < modesCount; i++) {
-        if ([[modes objectAtIndex:i] isEqual: @"audio"])
-            return false;
-    }
-    return true;
-#else
-    return false;
-#endif
-}
-
-} // namespace WebCore
-
-#endif // ENABLE(MEDIA_STREAM)
index 6d83b50..69fad4b 100644 (file)
@@ -96,7 +96,7 @@ public:
 
 private:
 #if PLATFORM(IOS_FAMILY)
-    void setVideoCapturePageState(bool interrupted, bool pageMuted) final
+    void setVideoCapturePageState(bool interrupted, bool pageMuted)
     {
         if (activeSource())
             activeSource()->setInterrupted(interrupted, pageMuted);
@@ -139,13 +139,6 @@ public:
         return MockRealtimeAudioSource::create(String { device.persistentId() }, String { device.label() }, WTFMove(hashSalt), constraints);
     }
 private:
-#if PLATFORM(IOS_FAMILY)
-    void setAudioCapturePageState(bool interrupted, bool pageMuted) final
-    {
-        if (activeSource())
-            activeSource()->setInterrupted(interrupted, pageMuted);
-    }
-#endif
     CaptureDeviceManager& audioCaptureDeviceManager() final { return MockRealtimeMediaSourceCenter::singleton().audioCaptureDeviceManager(); }
 };
 
index c596a58..2730dfe 100644 (file)
@@ -532,10 +532,6 @@ void Internals::resetToConsistentState(Page& page)
     page.setFullscreenControlsHidden(false);
 
     MediaEngineConfigurationFactory::disableMock();
-
-#if ENABLE(MEDIA_STREAM)
-    RuntimeEnabledFeatures::sharedFeatures().setInterruptAudioOnPageVisibilityChangeEnabled(false);
-#endif
 }
 
 Internals::Internals(Document& document)
@@ -1506,10 +1502,6 @@ void Internals::applyRotationForOutgoingVideoSources(RTCPeerConnection& connecti
 #endif
 
 #if ENABLE(MEDIA_STREAM)
-void Internals::setShouldInterruptAudioOnPageVisibilityChange(bool shouldInterrupt)
-{
-    RuntimeEnabledFeatures::sharedFeatures().setInterruptAudioOnPageVisibilityChangeEnabled(shouldInterrupt);
-}
 
 void Internals::setMockMediaCaptureDevicesEnabled(bool enabled)
 {
index 675c80a..46d426a 100644 (file)
@@ -516,7 +516,6 @@ public:
 #endif
 
 #if ENABLE(MEDIA_STREAM)
-    void setShouldInterruptAudioOnPageVisibilityChange(bool);
     void setMockMediaCaptureDevicesEnabled(bool);
     void setMediaCaptureRequiresSecureConnection(bool);
     void setCustomPrivateRecorderCreator();
index 0af3375..3a59b4d 100644 (file)
@@ -672,7 +672,6 @@ enum CompositingPolicy {
     [Conditional=WEB_RTC] void setH264HardwareEncoderAllowed(boolean allowed);
     [Conditional=WEB_RTC] void applyRotationForOutgoingVideoSources(RTCPeerConnection connection);
 
-    [Conditional=MEDIA_STREAM] void setShouldInterruptAudioOnPageVisibilityChange(boolean shouldInterrupt);
     [Conditional=MEDIA_STREAM] void setCameraMediaStreamTrackOrientation(MediaStreamTrack track, short orientation);
     [Conditional=MEDIA_STREAM] void observeMediaStreamTrack(MediaStreamTrack track);
     [Conditional=MEDIA_STREAM] Promise<ImageData> grabNextMediaStreamTrackFrame();
index 3a3a066..c9498ad 100644 (file)
@@ -1,3 +1,16 @@
+2019-05-31  Ryan Haddad  <ryanhaddad@apple.com>
+
+        Unreviewed, rolling out r245946.
+
+        Breaks the watchOS build.
+
+        Reverted changeset:
+
+        "Add an option to mute audio capture automatically when page
+        is not visible"
+        https://bugs.webkit.org/show_bug.cgi?id=198307
+        https://trac.webkit.org/changeset/245946
+
 2019-05-31  Carlos Garcia Campos  <cgarcia@igalia.com>
 
         [GTK] WPERenderer: ensure we complete the last frame when leaving AC mode
index 17bae37..7825e12 100644 (file)
@@ -36,7 +36,6 @@
 // FIXME: These should added via options in WebPreferences.yaml, rather than hardcoded.
 #include <WebCore/DeprecatedGlobalSettings.h>
 #include <WebCore/LibWebRTCProvider.h>
-#include <WebCore/RealtimeMediaSourceCenter.h>
 #include <WebCore/SecurityOrigin.h>
 #include <WebCore/Settings.h>
 #include <WebCore/TextEncodingRegistry.h>
index 72798c1..e59efb8 100644 (file)
@@ -545,12 +545,6 @@ PeerConnectionEnabled:
   webcoreBinding: RuntimeEnabledFeatures
   condition: ENABLE(WEB_RTC)
 
-InterruptAudioOnPageVisibilityChangeEnabled:
-  type: bool
-  defaultValue: WebCore::RealtimeMediaSourceCenter::shouldInterruptAudioOnPageVisibilityChange()
-  webcoreBinding: RuntimeEnabledFeatures
-  condition: ENABLE(MEDIA_STREAM)
-
 WebRTCUnifiedPlanEnabled:
   type: bool
   defaultValue: true
index df0b002..65384ec 100644 (file)
@@ -649,16 +649,6 @@ static _WKStorageBlockingPolicy toAPI(WebCore::SecurityOrigin::StorageBlockingPo
     _preferences->setInactiveMediaCaptureSteamRepromptIntervalInMinutes(interval);
 }
 
-- (BOOL)_interruptAudioOnPageVisibilityChangeEnabled
-{
-    return _preferences->interruptAudioOnPageVisibilityChangeEnabled();
-}
-
-- (void)_setInterruptAudioOnPageVisibilityChangeEnabled:(BOOL)enabled
-{
-    _preferences->setInterruptAudioOnPageVisibilityChangeEnabled(enabled);
-}
-
 - (BOOL)_enumeratingAllNetworkInterfacesEnabled
 {
     return _preferences->enumeratingAllNetworkInterfacesEnabled();
index ef18193..077a393 100644 (file)
@@ -120,7 +120,6 @@ typedef NS_ENUM(NSInteger, _WKEditableLinkBehavior) {
 @property (nonatomic, setter=_setICECandidateFilteringEnabled:) BOOL _iceCandidateFilteringEnabled WK_API_AVAILABLE(macos(10.13.4), ios(11.3));
 @property (nonatomic, setter=_setWebRTCLegacyAPIEnabled:) BOOL _webRTCLegacyAPIEnabled WK_API_AVAILABLE(macos(10.13), ios(11.0));
 @property (nonatomic, setter=_setInactiveMediaCaptureSteamRepromptIntervalInMinutes:) double _inactiveMediaCaptureSteamRepromptIntervalInMinutes WK_API_AVAILABLE(macos(10.13.4), ios(11.3));
-@property (nonatomic, setter=_setInterruptAudioOnPageVisibilityChangeEnabled:) BOOL _interruptAudioOnPageVisibilityChangeEnabled WK_API_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA));
 
 @property (nonatomic, setter=_setJavaScriptCanAccessClipboard:) BOOL _javaScriptCanAccessClipboard WK_API_AVAILABLE(macos(10.13), ios(11.0));
 @property (nonatomic, setter=_setDOMPasteAllowed:) BOOL _domPasteAllowed WK_API_AVAILABLE(macos(10.13), ios(11.0));
index e70f7d0..d19436d 100644 (file)
@@ -366,20 +366,6 @@ void UserMediaCaptureManager::applyConstraintsFailed(uint64_t id, String&& faile
         source->applyConstraintsFailed(WTFMove(failedConstraint), WTFMove(message));
 }
 
-#if PLATFORM(IOS)
-void UserMediaCaptureManager::setAudioCapturePageState(bool interrupted, bool pageMuted)
-{
-    if (auto* activeSource = static_cast<AudioCaptureFactory*>(this)->activeSource())
-        activeSource->setInterrupted(interrupted, pageMuted);
-}
-
-void UserMediaCaptureManager::setVideoCapturePageState(bool interrupted, bool pageMuted)
-{
-    if (auto* activeSource = static_cast<VideoCaptureFactory*>(this)->activeSource())
-        activeSource->setInterrupted(interrupted, pageMuted);
-}
-#endif
-
 }
 
 #endif
index baed0cd..b11ae74 100644 (file)
@@ -79,11 +79,6 @@ private:
     WebCore::CaptureDeviceManager& videoCaptureDeviceManager() final { return m_noOpCaptureDeviceManager; }
     WebCore::CaptureDeviceManager& displayCaptureDeviceManager() final { return m_noOpCaptureDeviceManager; }
 
-#if PLATFORM(IOS_FAMILY)
-    void setAudioCapturePageState(bool interrupted, bool pageMuted) final;
-    void setVideoCapturePageState(bool interrupted, bool pageMuted) final;
-#endif
-
     // IPC::MessageReceiver
     void didReceiveMessage(IPC::Connection&, IPC::Decoder&) final;