Skip to content

Commit

Permalink
Remove client hints from frame fetch when flag is enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
Ahrotahn committed Nov 22, 2024
1 parent fa1a8c4 commit 12b956b
Showing 1 changed file with 19 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,22 @@

UserAgentMetadata metadata = GetUserAgentMetadata();
ua_data->SetBrandVersionList(metadata.brand_version_list);
--- a/third_party/blink/renderer/core/loader/frame_fetch_context.cc
+++ b/third_party/blink/renderer/core/loader/frame_fetch_context.cc
@@ -48,6 +48,7 @@
#include "third_party/blink/public/common/associated_interfaces/associated_interface_provider.h"
#include "third_party/blink/public/common/client_hints/client_hints.h"
#include "third_party/blink/public/common/device_memory/approximated_device_memory.h"
+#include "third_party/blink/public/common/features.h"
#include "third_party/blink/public/mojom/fetch/fetch_api_request.mojom-blink.h"
#include "third_party/blink/public/mojom/loader/request_context_frame_type.mojom-blink.h"
#include "third_party/blink/public/mojom/permissions_policy/permissions_policy.mojom-blink.h"
@@ -509,6 +510,8 @@ void FrameFetchContext::ModifyRequestFor
void FrameFetchContext::AddClientHintsIfNecessary(
const std::optional<float> resource_width,
ResourceRequest& request) {
+ if (base::FeatureList::IsEnabled(blink::features::kRemoveClientHints))
+ return;
if (GetResourceFetcherProperties().IsDetached()) {
return;
}

0 comments on commit 12b956b

Please sign in to comment.