Skip to content

Commit

Permalink
Partition the EventSource pool per first-party on Desktop
Browse files Browse the repository at this point in the history
- Sets the limit to 250 EventSources per first party.
- Browser tests
- Disable in Android for now

fixes brave/brave-browser#28077
  • Loading branch information
arthuredelstein committed Jan 31, 2023
1 parent b2e63de commit 992cbd0
Show file tree
Hide file tree
Showing 11 changed files with 603 additions and 0 deletions.
1 change: 1 addition & 0 deletions android/android_browser_tests.gni
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ android_test_exception_sources = [
"//brave/browser/brave_shields/brave_shields_web_contents_observer_browsertest.cc",
"//brave/browser/brave_shields/cookie_expiry_browsertest.cc",
"//brave/browser/brave_shields/domain_block_page_browsertest.cc",
"//brave/browser/brave_shields/eventsource_pool_limit_browsertest.cc",
"//brave/browser/brave_shields/websockets_pool_limit_browsertest.cc",
"//brave/browser/brave_wallet/brave_wallet_ethereum_chain_browsertest.cc",
"//brave/browser/brave_wallet/brave_wallet_event_emitter_browsertest.cc",
Expand Down
10 changes: 10 additions & 0 deletions browser/about_flags.cc
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,11 @@ constexpr char kBraveChangeActiveTabOnScrollEventName[] =
constexpr char kBraveChangeActiveTabOnScrollEventDescription[] =
"Change the active tab when scroll events occur on tab strip.";
#endif // BUILDFLAG(IS_LINUX)

constexpr char kRestrictEventSourcePoolName[] = "Restrict Event Source Pool";
constexpr char kRestrictEventSourcePoolDescription[] =
"Limits simultaneous active WebSockets connections per eTLD+1";

} // namespace

} // namespace flag_descriptions
Expand Down Expand Up @@ -809,6 +814,11 @@ constexpr char kBraveChangeActiveTabOnScrollEventDescription[] =
flag_descriptions::kBraveSyncHistoryDiagnosticsDescription, \
kOsAll, FEATURE_VALUE_TYPE( \
brave_sync::features::kBraveSyncHistoryDiagnostics)}, \
{"restrict-event-source-pool", \
flag_descriptions::kRestrictEventSourcePoolName, \
flag_descriptions::kRestrictEventSourcePoolDescription, \
kOsAll, FEATURE_VALUE_TYPE( \
blink::features::kRestrictEventSourcePool)}, \
BRAVE_IPFS_FEATURE_ENTRIES \
BRAVE_NATIVE_WALLET_FEATURE_ENTRIES \
BRAVE_NEWS_FEATURE_ENTRIES \
Expand Down
Loading

0 comments on commit 992cbd0

Please sign in to comment.