Commit 35d1c33c authored by Ryan Sleevi's avatar Ryan Sleevi Committed by Commit Bot

Remove dead deprecation-tracking code

For features that were potentially blocked by Feature Policy,
a codepath existed to record usage that would be deprecated. That
usage was deprecated in M64, and retired in
https://crrev.com/581528, so there's no need to keep the dead code
path around.

Bug: 689802
Change-Id: I235d37446f0d3065acadff0a8af7887fc13bc276
Reviewed-on: https://chromium-review.googlesource.com/c/1427455Reviewed-by: default avatarDaniel Cheng <dcheng@chromium.org>
Commit-Queue: Ryan Sleevi <rsleevi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#625303}
parent de82da60
......@@ -1521,11 +1521,6 @@ enum WebFeature {
kReportUriMultipleEndpoints = 2052,
kReportUriSingleEndpoint = 2053,
kV8ConstructorNonUndefinedPrimitiveReturn = 2054,
kEncryptedMediaDisallowedByFeaturePolicyInCrossOriginIframe = 2055,
kGeolocationDisallowedByFeaturePolicyInCrossOriginIframe = 2056,
kGetUserMediaMicDisallowedByFeaturePolicyInCrossOriginIframe = 2057,
kGetUserMediaCameraDisallowedByFeaturePolicyInCrossOriginIframe = 2058,
kRequestMIDIAccessDisallowedByFeaturePolicyInCrossOriginIframe = 2059,
kMediaSourceKeyframeTimeGreaterThanDependant = 2060,
kMediaSourceMuxedSequenceMode = 2061,
kPrepareModuleScript = 2062,
......
......@@ -173,18 +173,6 @@ String ReplacedWillBeRemoved(const char* feature,
feature, MilestoneString(milestone), replacement, details);
}
String DeprecatedWillBeDisabledByFeaturePolicyInCrossOriginIframe(
const char* function,
const char* allow_string,
Milestone milestone) {
return String::Format(
"%s usage in cross-origin iframes is deprecated and will be disabled in "
"%s. To continue to use this feature, it must be enabled by the "
"embedding document using Feature Policy, e.g. "
"<iframe allow=\"%s\" ...>. See https://goo.gl/EuHzyv for more details.",
function, MilestoneString(milestone), allow_string);
}
DeprecationInfo GetDeprecationInfo(WebFeature feature) {
switch (feature) {
// Quota
......@@ -479,39 +467,6 @@ DeprecationInfo GetDeprecationInfo(WebFeature feature) {
ReplacedWillBeRemoved(":unresolved pseudo selector", ":not(:defined)",
kM73, "4642138092470272")};
case WebFeature::
kEncryptedMediaDisallowedByFeaturePolicyInCrossOriginIframe:
return {"EncryptedMediaDisallowedByFeaturePolicyInCrossOriginIframe",
kM64,
DeprecatedWillBeDisabledByFeaturePolicyInCrossOriginIframe(
"requestMediaKeySystemAccess", "encrypted-media", kM64)};
case WebFeature::kGeolocationDisallowedByFeaturePolicyInCrossOriginIframe:
return {"GeolocationDisallowedByFeaturePolicyInCrossOriginIframe", kM64,
DeprecatedWillBeDisabledByFeaturePolicyInCrossOriginIframe(
"getCurrentPosition and watchPosition", "geolocation", kM64)};
case WebFeature::
kGetUserMediaMicDisallowedByFeaturePolicyInCrossOriginIframe:
return {"GetUserMediaMicDisallowedByFeaturePolicyInCrossOriginIframe",
kM64,
DeprecatedWillBeDisabledByFeaturePolicyInCrossOriginIframe(
"getUserMedia (microphone)", "microphone", kM64)};
case WebFeature::
kGetUserMediaCameraDisallowedByFeaturePolicyInCrossOriginIframe:
return {"GetUserMediaCameraDisallowedByFeaturePolicyInCrossOriginIframe",
kM64,
DeprecatedWillBeDisabledByFeaturePolicyInCrossOriginIframe(
"getUserMedia (camera)", "camera", kM64)};
case WebFeature::
kRequestMIDIAccessDisallowedByFeaturePolicyInCrossOriginIframe:
return {"RequestMIDIAccessDisallowedByFeaturePolicyInCrossOriginIframe",
kM64,
DeprecatedWillBeDisabledByFeaturePolicyInCrossOriginIframe(
"requestMIDIAccess", "midi", kM64)};
case WebFeature::kPresentationRequestStartInsecureOrigin:
case WebFeature::kPresentationReceiverInsecureOrigin:
return {
......@@ -748,58 +703,6 @@ void Deprecation::CountDeprecationCrossOriginIframe(const Document& document,
CountDeprecationCrossOriginIframe(frame, feature);
}
void Deprecation::CountDeprecationFeaturePolicy(
const Document& document,
mojom::FeaturePolicyFeature feature) {
LocalFrame* frame = document.GetFrame();
if (!frame)
return;
// If the feature is allowed, don't log a warning.
if (document.IsFeatureEnabled(feature))
return;
// If the feature is disabled, log a warning but only if the request is from a
// cross-origin iframe. Ideally we would check here if the feature is actually
// disabled due to the parent frame's policy (as opposed to the current frame
// disabling the feature on itself) but that can't happen right now anyway
// (until the general syntax is shipped) and this is also a good enough
// approximation for deprecation messages.
switch (feature) {
case mojom::FeaturePolicyFeature::kEncryptedMedia:
CountDeprecationCrossOriginIframe(
frame,
WebFeature::
kEncryptedMediaDisallowedByFeaturePolicyInCrossOriginIframe);
break;
case mojom::FeaturePolicyFeature::kGeolocation:
CountDeprecationCrossOriginIframe(
frame,
WebFeature::kGeolocationDisallowedByFeaturePolicyInCrossOriginIframe);
break;
case mojom::FeaturePolicyFeature::kMicrophone:
CountDeprecationCrossOriginIframe(
frame,
WebFeature::
kGetUserMediaMicDisallowedByFeaturePolicyInCrossOriginIframe);
break;
case mojom::FeaturePolicyFeature::kCamera:
CountDeprecationCrossOriginIframe(
frame,
WebFeature::
kGetUserMediaCameraDisallowedByFeaturePolicyInCrossOriginIframe);
break;
case mojom::FeaturePolicyFeature::kMidiFeature:
CountDeprecationCrossOriginIframe(
frame,
WebFeature::
kRequestMIDIAccessDisallowedByFeaturePolicyInCrossOriginIframe);
break;
default:
NOTREACHED();
}
}
void Deprecation::GenerateReport(const LocalFrame* frame, WebFeature feature) {
DeprecationInfo info = GetDeprecationInfo(feature);
......
......@@ -49,9 +49,6 @@ class CORE_EXPORT Deprecation {
static void CountDeprecationCrossOriginIframe(const LocalFrame*, WebFeature);
static void CountDeprecationCrossOriginIframe(const Document&, WebFeature);
static void CountDeprecationFeaturePolicy(const Document&,
mojom::FeaturePolicyFeature);
static String DeprecationMessage(WebFeature);
// Note: this is only public for tests.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment