0

Ship preferCurrentTab by default

Intent-to-ship:
https://groups.google.com/a/chromium.org/g/blink-dev/c/YoefXLTQsw0

Bug: 1136942
Change-Id: Ie29db985ca46bdb91ec0e610bac8c2163ce09a5d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3052499
Commit-Queue: Elad Alon <eladalon@chromium.org>
Reviewed-by: Jeremy Roman <jbroman@chromium.org>
Reviewed-by: Robert Kaplow <rkaplow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#908224}
This commit is contained in:
Elad Alon
2021-08-03 23:51:14 +00:00
committed by Chromium LUCI CQ
parent e36255a545
commit 255de7f208
12 changed files with 9 additions and 55 deletions
chrome/browser/media/webrtc
components/page_load_metrics/browser/observers/use_counter
third_party/blink
tools/metrics/histograms

@ -165,17 +165,6 @@ void MediaCaptureDevicesDispatcher::ProcessMediaAccessRequest(
}
#endif
if (request.video_type ==
blink::mojom::MediaStreamType::DISPLAY_VIDEO_CAPTURE_THIS_TAB) {
if (!base::FeatureList::IsEnabled(
blink::features::kRTCGetCurrentBrowsingContextMedia)) {
std::move(callback).Run(
blink::MediaStreamDevices(),
blink::mojom::MediaStreamRequestResult::NOT_SUPPORTED, nullptr);
return;
}
}
for (const auto& handler : media_access_handlers_) {
if (handler->SupportsStreamType(web_contents, request.video_type,
extension) ||

@ -5,7 +5,6 @@
#include <string>
#include "base/strings/stringprintf.h"
#include "base/test/scoped_feature_list.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "chrome/browser/media/webrtc/webrtc_browsertest_base.h"
@ -98,12 +97,7 @@ class WebRtcScreenCaptureBrowserTestWithPicker
: public WebRtcScreenCaptureBrowserTest,
public testing::WithParamInterface<TestConfigForPicker> {
public:
WebRtcScreenCaptureBrowserTestWithPicker() : test_config_(GetParam()) {
if (test_config_.should_prefer_current_tab_) {
scoped_feature_list_.InitAndEnableFeature(
blink::features::kRTCGetCurrentBrowsingContextMedia);
}
}
WebRtcScreenCaptureBrowserTestWithPicker() : test_config_(GetParam()) {}
void SetUpCommandLine(base::CommandLine* command_line) override {
command_line->AppendSwitch(
@ -128,7 +122,6 @@ class WebRtcScreenCaptureBrowserTestWithPicker
}
const TestConfigForPicker test_config_;
base::test::ScopedFeatureList scoped_feature_list_;
};
// TODO(1170479): Real desktop capture is flaky on below platforms.
@ -228,12 +221,7 @@ class WebRtcScreenCaptureBrowserTestWithFakeUI
: public WebRtcScreenCaptureBrowserTest,
public testing::WithParamInterface<TestConfigForFakeUI> {
public:
WebRtcScreenCaptureBrowserTestWithFakeUI() : test_config_(GetParam()) {
if (test_config_.should_prefer_current_tab_) {
scoped_feature_list_.InitAndEnableFeature(
blink::features::kRTCGetCurrentBrowsingContextMedia);
}
}
WebRtcScreenCaptureBrowserTestWithFakeUI() : test_config_(GetParam()) {}
void SetUpCommandLine(base::CommandLine* command_line) override {
command_line->AppendSwitch(
@ -252,7 +240,6 @@ class WebRtcScreenCaptureBrowserTestWithFakeUI
protected:
const TestConfigForFakeUI test_config_;
base::test::ScopedFeatureList scoped_feature_list_;
};
IN_PROC_BROWSER_TEST_P(WebRtcScreenCaptureBrowserTestWithFakeUI,
@ -338,12 +325,7 @@ class WebRtcScreenCapturePermissionPolicyBrowserTest
public:
WebRtcScreenCapturePermissionPolicyBrowserTest()
: tested_variant_(GetParam().first),
allowlisted_by_policy_(GetParam().second) {
if (tested_variant_ == GetDisplayMediaVariant::kPreferCurrentTab) {
scoped_feature_list_.InitAndEnableFeature(
blink::features::kRTCGetCurrentBrowsingContextMedia);
}
}
allowlisted_by_policy_(GetParam().second) {}
~WebRtcScreenCapturePermissionPolicyBrowserTest() override = default;
@ -363,7 +345,6 @@ class WebRtcScreenCapturePermissionPolicyBrowserTest
const bool allowlisted_by_policy_;
private:
base::test::ScopedFeatureList scoped_feature_list_;
};
INSTANTIATE_TEST_SUITE_P(

@ -193,7 +193,6 @@ UseCounterPageLoadMetricsObserver::GetAllowedUkmFeatures() {
WebFeature::kWebPImage,
WebFeature::kAVIFImage,
WebFeature::kGetDisplayMedia,
WebFeature::kGetCurrentBrowsingContextMedia,
WebFeature::kLaxAllowingUnsafeCookies,
WebFeature::kOpenWebDatabaseThirdPartyContext,
WebFeature::kOversrollBehaviorOnViewportBreaks,

@ -245,11 +245,6 @@ const base::Feature kPurgeRendererMemoryWhenBackgrounded {
#endif
};
// Kill switch for getCurrentBrowsingContextMedia(), which allows capturing of
// web content from the tab from which it is called. (crbug.com/1136940)
const base::Feature kRTCGetCurrentBrowsingContextMedia{
"RTCGetCurrentBrowsingContextMedia", base::FEATURE_ENABLED_BY_DEFAULT};
// Changes the default RTCPeerConnection constructor behavior to use Unified
// Plan as the SDP semantics. When the feature is enabled, Unified Plan is used
// unless the default is overridden (by passing {sdpSemantics:'plan-b'} as the

@ -82,8 +82,6 @@ BLINK_COMMON_EXPORT extern const base::Feature
kPreviewsResourceLoadingHintsSpecificResourceTypes;
BLINK_COMMON_EXPORT extern const base::Feature
kPurgeRendererMemoryWhenBackgrounded;
BLINK_COMMON_EXPORT extern const base::Feature
kRTCGetCurrentBrowsingContextMedia;
BLINK_COMMON_EXPORT extern const base::Feature kRTCUnifiedPlanByDefault;
BLINK_COMMON_EXPORT extern const base::Feature
kRTCDisallowPlanBOutsideDeprecationTrial;

@ -3022,7 +3022,7 @@ enum WebFeature {
kOBSOLETE_CSSPseudoHostCompoundList = 3716,
kOBSOLETE_CSSPseudoHostContextCompoundList = 3717,
kOBSOLETE_CSSPseudoHostDynamicSpecificity = 3718,
kGetCurrentBrowsingContextMedia = 3719,
kOBSOLETE_GetCurrentBrowsingContextMedia = 3719,
kMouseEventRelativePositionForInlineElement = 3720,
kV8SharedArrayBufferConstructedWithoutIsolation = 3721,
kV8HTMLVideoElement_GetVideoPlaybackQuality_Method = 3722,

@ -218,7 +218,6 @@ class WebRuntimeFeatures {
BLINK_PLATFORM_EXPORT static void EnableAutoplayIgnoresWebAudio(bool);
BLINK_PLATFORM_EXPORT static void EnableMediaControlsExpandGesture(bool);
BLINK_PLATFORM_EXPORT static void EnableGetDisplayMedia(bool);
BLINK_PLATFORM_EXPORT static void EnableGetCurrentBrowsingContextMedia(bool);
BLINK_PLATFORM_EXPORT static void EnableAllowSyncXHRInPageDismissal(bool);
BLINK_PLATFORM_EXPORT static void
EnableSignedExchangePrefetchCacheForNavigations(bool);

@ -8,5 +8,5 @@ dictionary MediaStreamConstraints {
(boolean or MediaTrackConstraints) video = false;
(boolean or MediaTrackConstraints) audio = false;
// https://wicg.github.io/prefer-current-tab/#prefer-current-tab
[RuntimeEnabled = GetCurrentBrowsingContextMedia] boolean preferCurrentTab = false;
boolean preferCurrentTab = false;
};

@ -600,10 +600,6 @@ void WebRuntimeFeatures::EnableGetDisplayMedia(bool enable) {
RuntimeEnabledFeatures::SetGetDisplayMediaEnabled(enable);
}
void WebRuntimeFeatures::EnableGetCurrentBrowsingContextMedia(bool enable) {
RuntimeEnabledFeatures::SetGetCurrentBrowsingContextMediaEnabled(enable);
}
void WebRuntimeFeatures::EnableAllowSyncXHRInPageDismissal(bool enable) {
RuntimeEnabledFeatures::SetAllowSyncXHRInPageDismissalEnabled(enable);
}

@ -1101,12 +1101,6 @@
name: "GamepadButtonAxisEvents",
status: "experimental",
},
{
name: "GetCurrentBrowsingContextMedia",
origin_trial_feature_name: "GetCurrentBrowsingContextMedia",
depends_on: ["GetDisplayMedia"],
status: {"Android": "", "default": "experimental"},
},
{
name: "GetDisplayMedia",
status: {

@ -33806,7 +33806,7 @@ Called by update_use_counter_feature_enum.py.-->
<int value="3716" label="OBSOLETE_CSSPseudoHostCompoundList"/>
<int value="3717" label="OBSOLETE_CSSPseudoHostContextCompoundList"/>
<int value="3718" label="OBSOLETE_CSSPseudoHostDynamicSpecificity"/>
<int value="3719" label="GetCurrentBrowsingContextMedia"/>
<int value="3719" label="OBSOLETE_GetCurrentBrowsingContextMedia"/>
<int value="3720" label="MouseEventRelativePositionForInlineElement"/>
<int value="3721" label="V8SharedArrayBufferConstructedWithoutIsolation"/>
<int value="3722" label="V8HTMLVideoElement_GetVideoPlaybackQuality_Method"/>

@ -3968,6 +3968,9 @@ reviews. Googlers can read more about this at go/gwsq-gerrit.
name="Media.Ui.GetCurrentBrowsingContextMedia.ExplicitSelection.UserInteraction"
enum="GetCurrentBrowsingContextMediaExplicitSelectionUserInteraction"
expires_after="2022-01-01">
<obsolete>
Removed in July 2021.
</obsolete>
<owner>eladalon@chromium.org</owner>
<owner>guidou@chromium.org</owner>
<owner>agpalak@chromium.org</owner>