Commit 36da4779 authored by Dominic Farolino's avatar Dominic Farolino Committed by Commit Bot

Clean up no-op core/fetch Priority Hints leftovers

This CL cleans up some unused code that would otherwise be used if we
were exposing `importance` as a readonly attribute on the Request
interface, but we are not right now. This also replaces a
RuntimeEnabledFeatures check for Priority Hints with a DCHECK since we
already check the flag earlier than the location this CL touches.

R=kinuko@chromium.org, kouhei@chromium.org, yhirano@chromium.org, yoav@yoav.ws

Bug: 821464
Change-Id: Ic1d2fe3ddabf4eeec46b5298cc4a914001cd2d32
Reviewed-on: https://chromium-review.googlesource.com/1092243Reviewed-by: default avatarYoav Weiss <yoav@yoav.ws>
Reviewed-by: default avatarKouhei Ueno <kouhei@chromium.org>
Reviewed-by: default avatarYutaka Hirano <yhirano@chromium.org>
Reviewed-by: default avatarKinuko Yasuda <kinuko@chromium.org>
Commit-Queue: Dominic Farolino <domfarolino@gmail.com>
Cr-Commit-Position: refs/heads/master@{#565926}
parent 38825770
......@@ -265,16 +265,16 @@ Request* Request::CreateRequestWithRequestOrString(
request->SetMode(network::mojom::FetchRequestMode::kCORS);
}
if (RuntimeEnabledFeatures::PriorityHintsEnabled()) {
// This is not yet standardized, but we can assume the following:
// "If |init|'s importance member is present, set |request|'s importance
// mode to it." For more information see Priority Hints at
// https://crbug.com/821464
if (init.Importance() == "low") {
request->SetImportance(mojom::FetchImportanceMode::kImportanceLow);
} else if (init.Importance() == "high") {
request->SetImportance(mojom::FetchImportanceMode::kImportanceHigh);
}
// This is not yet standardized, but we can assume the following:
// "If |init|'s importance member is present, set |request|'s importance
// mode to it." For more information see Priority Hints at
// https://crbug.com/821464
DCHECK(init.Importance().IsNull() ||
RuntimeEnabledFeatures::PriorityHintsEnabled());
if (init.Importance() == "low") {
request->SetImportance(mojom::FetchImportanceMode::kImportanceLow);
} else if (init.Importance() == "high") {
request->SetImportance(mojom::FetchImportanceMode::kImportanceHigh);
}
// "Let |credentials| be |init|'s credentials member if it is present, and
......
......@@ -69,7 +69,6 @@ class CORE_EXPORT Request final : public Body {
String cache() const;
String redirect() const;
String integrity() const;
String importance() const;
bool keepalive() const;
bool isHistoryNavigation() const;
AbortSignal* signal() const { return signal_; }
......
......@@ -13,7 +13,6 @@ enum RequestCredentials { "omit", "same-origin", "include" };
enum RequestRedirect { "follow", "error", "manual" };
enum RequestCache { "default", "no-store", "reload", "no-cache", "force-cache",
"only-if-cached" };
enum RequestImportance { "low", "auto", "high" };
// https://w3c.github.io/webappsec-referrer-policy/#referrer-policies
......
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