electron/patches/chromium/revert_remove_the_allowaggressivethrottlingwithwebsocket_feature.patch
electron-roller[bot] f6407b4949
chore: bump chromium to 140.0.7314.0 (main) (#47882)
* chore: bump chromium in DEPS to 140.0.7314.0

* 6769821: Delegate checking whether preconnect is enabled.

Refs https://chromium-review.googlesource.com/c/chromium/src/+/6769821

* 6632993: PDF Searchify IPH: Use embedder WebContents for GuestView PDF

Refs https://chromium-review.googlesource.com/c/chromium/src/+/6632993

* 6769214: [ios blink] Set IOSurface shared memory region on all GMB handles

Refs https://chromium-review.googlesource.com/c/chromium/src/+/6769214

* chore: update patches

* 6769572: [soft navs]: Move AsyncSameDocumentNavigationStarted to TaskAttributionTracker

Refs https://chromium-review.googlesource.com/c/chromium/src/+/6769572

* chore: node gen-libc++-filenames.js

* 6765740: [SxS] Implement support for split view in extensions API

Refs https://chromium-review.googlesource.com/c/chromium/src/+/6765740

* 6769821: Delegate checking whether preconnect is enabled.

Refs https://chromium-review.googlesource.com/c/chromium/src/+/6769821

---------

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
2025-07-28 15:31:54 -07:00

41 lines
2.2 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Samuel Attard <samuel.r.attard@gmail.com>
Date: Tue, 5 Sep 2023 13:22:31 -0700
Subject: Revert "Remove the AllowAggressiveThrottlingWithWebSocket feature."
This reverts commit 615c1810a187840ffeb04096087efff86edb37de.
diff --git a/third_party/blink/renderer/modules/websockets/websocket_channel_impl.cc b/third_party/blink/renderer/modules/websockets/websocket_channel_impl.cc
index b5dde9f0b46663db5c7cf072cc58e271f83995eb..88a503e23ea4fa787a91a2a7934dc1783264a700 100644
--- a/third_party/blink/renderer/modules/websockets/websocket_channel_impl.cc
+++ b/third_party/blink/renderer/modules/websockets/websocket_channel_impl.cc
@@ -101,6 +101,17 @@ enum WebSocketOpCode {
kOpCodeBinary = 0x2,
};
+// When enabled, a page can be aggressively throttled even if it uses a
+// WebSocket. Aggressive throttling does not affect the execution of WebSocket
+// event handlers, so there is little reason to disable it on pages using a
+// WebSocket.
+//
+// TODO(crbug.com/1121725): Cleanup this feature in June 2021, when it becomes
+// enabled by default on Stable.
+BASE_FEATURE(kAllowAggressiveThrottlingWithWebSocket,
+ "AllowAggressiveThrottlingWithWebSocket",
+ base::FEATURE_ENABLED_BY_DEFAULT);
+
} // namespace
WebSocketChannelImpl::MessageDataDeleter::MessageDataDeleter(
@@ -294,7 +305,10 @@ bool WebSocketChannelImpl::Connect(const KURL& url, const String& protocol) {
// even if the `WebSocketChannel` is closed.
feature_handle_for_scheduler_ = scheduler->RegisterFeature(
SchedulingPolicy::Feature::kWebSocket,
- SchedulingPolicy{SchedulingPolicy::DisableBackForwardCache()});
+ base::FeatureList::IsEnabled(kAllowAggressiveThrottlingWithWebSocket)
+ ? SchedulingPolicy{SchedulingPolicy::DisableBackForwardCache()}
+ : SchedulingPolicy{SchedulingPolicy::DisableAggressiveThrottling(),
+ SchedulingPolicy::DisableBackForwardCache()});
scheduler->RegisterStickyFeature(
SchedulingPolicy::Feature::kWebSocketSticky,
SchedulingPolicy{SchedulingPolicy::DisableBackForwardCache()});