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:

committed by
Chromium LUCI CQ

parent
e36255a545
commit
255de7f208
chrome/browser/media/webrtc
components/page_load_metrics/browser/observers/use_counter
third_party/blink
common
public
renderer
modules
mediastream
platform
tools/metrics/histograms
@@ -165,17 +165,6 @@ void MediaCaptureDevicesDispatcher::ProcessMediaAccessRequest(
|
|||||||
}
|
}
|
||||||
#endif
|
#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_) {
|
for (const auto& handler : media_access_handlers_) {
|
||||||
if (handler->SupportsStreamType(web_contents, request.video_type,
|
if (handler->SupportsStreamType(web_contents, request.video_type,
|
||||||
extension) ||
|
extension) ||
|
||||||
|
@@ -5,7 +5,6 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#include "base/strings/stringprintf.h"
|
#include "base/strings/stringprintf.h"
|
||||||
#include "base/test/scoped_feature_list.h"
|
|
||||||
#include "build/build_config.h"
|
#include "build/build_config.h"
|
||||||
#include "build/chromeos_buildflags.h"
|
#include "build/chromeos_buildflags.h"
|
||||||
#include "chrome/browser/media/webrtc/webrtc_browsertest_base.h"
|
#include "chrome/browser/media/webrtc/webrtc_browsertest_base.h"
|
||||||
@@ -98,12 +97,7 @@ class WebRtcScreenCaptureBrowserTestWithPicker
|
|||||||
: public WebRtcScreenCaptureBrowserTest,
|
: public WebRtcScreenCaptureBrowserTest,
|
||||||
public testing::WithParamInterface<TestConfigForPicker> {
|
public testing::WithParamInterface<TestConfigForPicker> {
|
||||||
public:
|
public:
|
||||||
WebRtcScreenCaptureBrowserTestWithPicker() : test_config_(GetParam()) {
|
WebRtcScreenCaptureBrowserTestWithPicker() : test_config_(GetParam()) {}
|
||||||
if (test_config_.should_prefer_current_tab_) {
|
|
||||||
scoped_feature_list_.InitAndEnableFeature(
|
|
||||||
blink::features::kRTCGetCurrentBrowsingContextMedia);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void SetUpCommandLine(base::CommandLine* command_line) override {
|
void SetUpCommandLine(base::CommandLine* command_line) override {
|
||||||
command_line->AppendSwitch(
|
command_line->AppendSwitch(
|
||||||
@@ -128,7 +122,6 @@ class WebRtcScreenCaptureBrowserTestWithPicker
|
|||||||
}
|
}
|
||||||
|
|
||||||
const TestConfigForPicker test_config_;
|
const TestConfigForPicker test_config_;
|
||||||
base::test::ScopedFeatureList scoped_feature_list_;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// TODO(1170479): Real desktop capture is flaky on below platforms.
|
// TODO(1170479): Real desktop capture is flaky on below platforms.
|
||||||
@@ -228,12 +221,7 @@ class WebRtcScreenCaptureBrowserTestWithFakeUI
|
|||||||
: public WebRtcScreenCaptureBrowserTest,
|
: public WebRtcScreenCaptureBrowserTest,
|
||||||
public testing::WithParamInterface<TestConfigForFakeUI> {
|
public testing::WithParamInterface<TestConfigForFakeUI> {
|
||||||
public:
|
public:
|
||||||
WebRtcScreenCaptureBrowserTestWithFakeUI() : test_config_(GetParam()) {
|
WebRtcScreenCaptureBrowserTestWithFakeUI() : test_config_(GetParam()) {}
|
||||||
if (test_config_.should_prefer_current_tab_) {
|
|
||||||
scoped_feature_list_.InitAndEnableFeature(
|
|
||||||
blink::features::kRTCGetCurrentBrowsingContextMedia);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void SetUpCommandLine(base::CommandLine* command_line) override {
|
void SetUpCommandLine(base::CommandLine* command_line) override {
|
||||||
command_line->AppendSwitch(
|
command_line->AppendSwitch(
|
||||||
@@ -252,7 +240,6 @@ class WebRtcScreenCaptureBrowserTestWithFakeUI
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
const TestConfigForFakeUI test_config_;
|
const TestConfigForFakeUI test_config_;
|
||||||
base::test::ScopedFeatureList scoped_feature_list_;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
IN_PROC_BROWSER_TEST_P(WebRtcScreenCaptureBrowserTestWithFakeUI,
|
IN_PROC_BROWSER_TEST_P(WebRtcScreenCaptureBrowserTestWithFakeUI,
|
||||||
@@ -338,12 +325,7 @@ class WebRtcScreenCapturePermissionPolicyBrowserTest
|
|||||||
public:
|
public:
|
||||||
WebRtcScreenCapturePermissionPolicyBrowserTest()
|
WebRtcScreenCapturePermissionPolicyBrowserTest()
|
||||||
: tested_variant_(GetParam().first),
|
: tested_variant_(GetParam().first),
|
||||||
allowlisted_by_policy_(GetParam().second) {
|
allowlisted_by_policy_(GetParam().second) {}
|
||||||
if (tested_variant_ == GetDisplayMediaVariant::kPreferCurrentTab) {
|
|
||||||
scoped_feature_list_.InitAndEnableFeature(
|
|
||||||
blink::features::kRTCGetCurrentBrowsingContextMedia);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
~WebRtcScreenCapturePermissionPolicyBrowserTest() override = default;
|
~WebRtcScreenCapturePermissionPolicyBrowserTest() override = default;
|
||||||
|
|
||||||
@@ -363,7 +345,6 @@ class WebRtcScreenCapturePermissionPolicyBrowserTest
|
|||||||
const bool allowlisted_by_policy_;
|
const bool allowlisted_by_policy_;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
base::test::ScopedFeatureList scoped_feature_list_;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
INSTANTIATE_TEST_SUITE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
|
@@ -193,7 +193,6 @@ UseCounterPageLoadMetricsObserver::GetAllowedUkmFeatures() {
|
|||||||
WebFeature::kWebPImage,
|
WebFeature::kWebPImage,
|
||||||
WebFeature::kAVIFImage,
|
WebFeature::kAVIFImage,
|
||||||
WebFeature::kGetDisplayMedia,
|
WebFeature::kGetDisplayMedia,
|
||||||
WebFeature::kGetCurrentBrowsingContextMedia,
|
|
||||||
WebFeature::kLaxAllowingUnsafeCookies,
|
WebFeature::kLaxAllowingUnsafeCookies,
|
||||||
WebFeature::kOpenWebDatabaseThirdPartyContext,
|
WebFeature::kOpenWebDatabaseThirdPartyContext,
|
||||||
WebFeature::kOversrollBehaviorOnViewportBreaks,
|
WebFeature::kOversrollBehaviorOnViewportBreaks,
|
||||||
|
5
third_party/blink/common/features.cc
vendored
5
third_party/blink/common/features.cc
vendored
@@ -245,11 +245,6 @@ const base::Feature kPurgeRendererMemoryWhenBackgrounded {
|
|||||||
#endif
|
#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
|
// Changes the default RTCPeerConnection constructor behavior to use Unified
|
||||||
// Plan as the SDP semantics. When the feature is enabled, Unified Plan is used
|
// 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
|
// unless the default is overridden (by passing {sdpSemantics:'plan-b'} as the
|
||||||
|
2
third_party/blink/public/common/features.h
vendored
2
third_party/blink/public/common/features.h
vendored
@@ -82,8 +82,6 @@ BLINK_COMMON_EXPORT extern const base::Feature
|
|||||||
kPreviewsResourceLoadingHintsSpecificResourceTypes;
|
kPreviewsResourceLoadingHintsSpecificResourceTypes;
|
||||||
BLINK_COMMON_EXPORT extern const base::Feature
|
BLINK_COMMON_EXPORT extern const base::Feature
|
||||||
kPurgeRendererMemoryWhenBackgrounded;
|
kPurgeRendererMemoryWhenBackgrounded;
|
||||||
BLINK_COMMON_EXPORT extern const base::Feature
|
|
||||||
kRTCGetCurrentBrowsingContextMedia;
|
|
||||||
BLINK_COMMON_EXPORT extern const base::Feature kRTCUnifiedPlanByDefault;
|
BLINK_COMMON_EXPORT extern const base::Feature kRTCUnifiedPlanByDefault;
|
||||||
BLINK_COMMON_EXPORT extern const base::Feature
|
BLINK_COMMON_EXPORT extern const base::Feature
|
||||||
kRTCDisallowPlanBOutsideDeprecationTrial;
|
kRTCDisallowPlanBOutsideDeprecationTrial;
|
||||||
|
@@ -3022,7 +3022,7 @@ enum WebFeature {
|
|||||||
kOBSOLETE_CSSPseudoHostCompoundList = 3716,
|
kOBSOLETE_CSSPseudoHostCompoundList = 3716,
|
||||||
kOBSOLETE_CSSPseudoHostContextCompoundList = 3717,
|
kOBSOLETE_CSSPseudoHostContextCompoundList = 3717,
|
||||||
kOBSOLETE_CSSPseudoHostDynamicSpecificity = 3718,
|
kOBSOLETE_CSSPseudoHostDynamicSpecificity = 3718,
|
||||||
kGetCurrentBrowsingContextMedia = 3719,
|
kOBSOLETE_GetCurrentBrowsingContextMedia = 3719,
|
||||||
kMouseEventRelativePositionForInlineElement = 3720,
|
kMouseEventRelativePositionForInlineElement = 3720,
|
||||||
kV8SharedArrayBufferConstructedWithoutIsolation = 3721,
|
kV8SharedArrayBufferConstructedWithoutIsolation = 3721,
|
||||||
kV8HTMLVideoElement_GetVideoPlaybackQuality_Method = 3722,
|
kV8HTMLVideoElement_GetVideoPlaybackQuality_Method = 3722,
|
||||||
|
@@ -218,7 +218,6 @@ class WebRuntimeFeatures {
|
|||||||
BLINK_PLATFORM_EXPORT static void EnableAutoplayIgnoresWebAudio(bool);
|
BLINK_PLATFORM_EXPORT static void EnableAutoplayIgnoresWebAudio(bool);
|
||||||
BLINK_PLATFORM_EXPORT static void EnableMediaControlsExpandGesture(bool);
|
BLINK_PLATFORM_EXPORT static void EnableMediaControlsExpandGesture(bool);
|
||||||
BLINK_PLATFORM_EXPORT static void EnableGetDisplayMedia(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 EnableAllowSyncXHRInPageDismissal(bool);
|
||||||
BLINK_PLATFORM_EXPORT static void
|
BLINK_PLATFORM_EXPORT static void
|
||||||
EnableSignedExchangePrefetchCacheForNavigations(bool);
|
EnableSignedExchangePrefetchCacheForNavigations(bool);
|
||||||
|
@@ -8,5 +8,5 @@ dictionary MediaStreamConstraints {
|
|||||||
(boolean or MediaTrackConstraints) video = false;
|
(boolean or MediaTrackConstraints) video = false;
|
||||||
(boolean or MediaTrackConstraints) audio = false;
|
(boolean or MediaTrackConstraints) audio = false;
|
||||||
// https://wicg.github.io/prefer-current-tab/#prefer-current-tab
|
// 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);
|
RuntimeEnabledFeatures::SetGetDisplayMediaEnabled(enable);
|
||||||
}
|
}
|
||||||
|
|
||||||
void WebRuntimeFeatures::EnableGetCurrentBrowsingContextMedia(bool enable) {
|
|
||||||
RuntimeEnabledFeatures::SetGetCurrentBrowsingContextMediaEnabled(enable);
|
|
||||||
}
|
|
||||||
|
|
||||||
void WebRuntimeFeatures::EnableAllowSyncXHRInPageDismissal(bool enable) {
|
void WebRuntimeFeatures::EnableAllowSyncXHRInPageDismissal(bool enable) {
|
||||||
RuntimeEnabledFeatures::SetAllowSyncXHRInPageDismissalEnabled(enable);
|
RuntimeEnabledFeatures::SetAllowSyncXHRInPageDismissalEnabled(enable);
|
||||||
}
|
}
|
||||||
|
@@ -1101,12 +1101,6 @@
|
|||||||
name: "GamepadButtonAxisEvents",
|
name: "GamepadButtonAxisEvents",
|
||||||
status: "experimental",
|
status: "experimental",
|
||||||
},
|
},
|
||||||
{
|
|
||||||
name: "GetCurrentBrowsingContextMedia",
|
|
||||||
origin_trial_feature_name: "GetCurrentBrowsingContextMedia",
|
|
||||||
depends_on: ["GetDisplayMedia"],
|
|
||||||
status: {"Android": "", "default": "experimental"},
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
name: "GetDisplayMedia",
|
name: "GetDisplayMedia",
|
||||||
status: {
|
status: {
|
||||||
|
@@ -33806,7 +33806,7 @@ Called by update_use_counter_feature_enum.py.-->
|
|||||||
<int value="3716" label="OBSOLETE_CSSPseudoHostCompoundList"/>
|
<int value="3716" label="OBSOLETE_CSSPseudoHostCompoundList"/>
|
||||||
<int value="3717" label="OBSOLETE_CSSPseudoHostContextCompoundList"/>
|
<int value="3717" label="OBSOLETE_CSSPseudoHostContextCompoundList"/>
|
||||||
<int value="3718" label="OBSOLETE_CSSPseudoHostDynamicSpecificity"/>
|
<int value="3718" label="OBSOLETE_CSSPseudoHostDynamicSpecificity"/>
|
||||||
<int value="3719" label="GetCurrentBrowsingContextMedia"/>
|
<int value="3719" label="OBSOLETE_GetCurrentBrowsingContextMedia"/>
|
||||||
<int value="3720" label="MouseEventRelativePositionForInlineElement"/>
|
<int value="3720" label="MouseEventRelativePositionForInlineElement"/>
|
||||||
<int value="3721" label="V8SharedArrayBufferConstructedWithoutIsolation"/>
|
<int value="3721" label="V8SharedArrayBufferConstructedWithoutIsolation"/>
|
||||||
<int value="3722" label="V8HTMLVideoElement_GetVideoPlaybackQuality_Method"/>
|
<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"
|
name="Media.Ui.GetCurrentBrowsingContextMedia.ExplicitSelection.UserInteraction"
|
||||||
enum="GetCurrentBrowsingContextMediaExplicitSelectionUserInteraction"
|
enum="GetCurrentBrowsingContextMediaExplicitSelectionUserInteraction"
|
||||||
expires_after="2022-01-01">
|
expires_after="2022-01-01">
|
||||||
|
<obsolete>
|
||||||
|
Removed in July 2021.
|
||||||
|
</obsolete>
|
||||||
<owner>eladalon@chromium.org</owner>
|
<owner>eladalon@chromium.org</owner>
|
||||||
<owner>guidou@chromium.org</owner>
|
<owner>guidou@chromium.org</owner>
|
||||||
<owner>agpalak@chromium.org</owner>
|
<owner>agpalak@chromium.org</owner>
|
||||||
|
Reference in New Issue
Block a user