forked from uazo/cromite
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDisable-media-router-and-remoting-by-default.patch
100 lines (91 loc) · 4.41 KB
/
Disable-media-router-and-remoting-by-default.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
From: Daniel Micay <[email protected]>
Date: Thu, 4 Jul 2019 19:08:52 -0400
Subject: Disable media router and remoting by default
Original License: MIT - https://spdx.org/licenses/MIT.html
License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
---
chrome/browser/media/router/media_router_feature.cc | 6 +++++-
chrome/browser/profiles/profile_impl.cc | 2 +-
content/child/runtime_features.cc | 2 ++
.../renderer/modules/remoteplayback/remote_playback.cc | 2 +-
.../renderer/platform/runtime_enabled_features.json5 | 10 +++-------
5 files changed, 12 insertions(+), 10 deletions(-)
diff --git a/chrome/browser/media/router/media_router_feature.cc b/chrome/browser/media/router/media_router_feature.cc
--- a/chrome/browser/media/router/media_router_feature.cc
+++ b/chrome/browser/media/router/media_router_feature.cc
@@ -106,6 +106,7 @@ void ClearMediaRouterStoredPrefsForTesting() {
}
bool MediaRouterEnabled(content::BrowserContext* context) {
+ if ((true)) return false;
#if !BUILDFLAG(IS_ANDROID)
if (!base::FeatureList::IsEnabled(kMediaRouter))
return false;
@@ -147,7 +148,7 @@ void RegisterProfilePrefs(PrefRegistrySimple* registry) {
registry->RegisterStringPref(prefs::kMediaRouterReceiverIdHashToken, "",
PrefRegistry::PUBLIC);
registry->RegisterBooleanPref(
- media_router::prefs::kMediaRouterMediaRemotingEnabled, true);
+ media_router::prefs::kMediaRouterMediaRemotingEnabled, false); // disabled in Bromite
registry->RegisterBooleanPref(
media_router::prefs::kMediaRouterShowCastSessionsStartedByOtherDevices,
true);
@@ -218,4 +219,7 @@ std::optional<base::TimeDelta> GetCastMirroringPlayoutDelay() {
#endif // !BUILDFLAG(IS_ANDROID)
+#if !BUILDFLAG(IS_ANDROID)
+SET_CROMITE_FEATURE_DISABLED(kMediaRouter);
+#endif
} // namespace media_router
diff --git a/chrome/browser/profiles/profile_impl.cc b/chrome/browser/profiles/profile_impl.cc
--- a/chrome/browser/profiles/profile_impl.cc
+++ b/chrome/browser/profiles/profile_impl.cc
@@ -425,7 +425,7 @@ void ProfileImpl::RegisterProfilePrefs(
#endif
registry->RegisterBooleanPref(prefs::kForceEphemeralProfiles, false);
- registry->RegisterBooleanPref(prefs::kEnableMediaRouter, true);
+ registry->RegisterBooleanPref(prefs::kEnableMediaRouter, false);
#if !BUILDFLAG(IS_ANDROID)
registry->RegisterBooleanPref(prefs::kShowCastIconInToolbar, false);
#endif // !BUILDFLAG(IS_ANDROID)
diff --git a/content/child/runtime_features.cc b/content/child/runtime_features.cc
--- a/content/child/runtime_features.cc
+++ b/content/child/runtime_features.cc
@@ -586,6 +586,8 @@ void SetCustomizedRuntimeFeaturesFromCombinedArgs(
WebRuntimeFeatures::EnableBackForwardCache(
content::IsBackForwardCacheEnabled());
+ WebRuntimeFeatures::EnableRemotePlayback(false);
+
if (base::FeatureList::IsEnabled(network::features::kPrivateStateTokens)) {
WebRuntimeFeatures::EnablePrivateStateTokens(true);
WebRuntimeFeatures::EnablePrivateStateTokensAlwaysAllowIssuance(true);
diff --git a/third_party/blink/renderer/modules/remoteplayback/remote_playback.cc b/third_party/blink/renderer/modules/remoteplayback/remote_playback.cc
--- a/third_party/blink/renderer/modules/remoteplayback/remote_playback.cc
+++ b/third_party/blink/renderer/modules/remoteplayback/remote_playback.cc
@@ -99,7 +99,7 @@ KURL GetAvailabilityUrl(const WebURL& source,
}
bool IsBackgroundAvailabilityMonitoringDisabled() {
- return MemoryPressureListenerRegistry::IsLowEndDevice();
+ return true;
}
void RemotingStarting(HTMLMediaElement& media_element) {
diff --git a/third_party/blink/renderer/platform/runtime_enabled_features.json5 b/third_party/blink/renderer/platform/runtime_enabled_features.json5
--- a/third_party/blink/renderer/platform/runtime_enabled_features.json5
+++ b/third_party/blink/renderer/platform/runtime_enabled_features.json5
@@ -3086,14 +3086,10 @@
base_feature: "none",
},
{
- name: "RemotePlaybackBackend",
+ name: "RemotePlaybackBackend", // disabled
settable_from_internals: true,
- status: {
- "Android": "stable",
- "Win": "stable",
- "Mac": "stable",
- "Linux": "stable",
- "default": "experimental"},
+ // Tracking bug for the implementation: https://crbug.com/728609
+ status: "experimental", // by default
},
{
name: "RemoveDanglingMarkupInTarget",
--