refactor: reduce coupling in electron::api::Protocol (#46122)

* refactor: decouple api::Protocol from ElectronBrowserContext

now they do not know about each other

* refactor: make electron::api::ProtocolError private

* refactor: remove unused isolate arg in Protocol constructor

* refactor: use =default for trivial destructor
This commit is contained in:
Charles Kerr 2025-03-21 07:33:25 -05:00 committed by GitHub
parent 603057b198
commit 6723bfbe32
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 54 additions and 58 deletions

View file

@ -553,7 +553,9 @@ Session::Session(v8::Isolate* isolate, ElectronBrowserContext* browser_context)
SessionPreferences::CreateForBrowserContext(browser_context);
protocol_.Reset(isolate, Protocol::Create(isolate, browser_context).ToV8());
protocol_.Reset(
isolate,
Protocol::Create(isolate, browser_context->protocol_registry()).ToV8());
browser_context->SetUserData(
kElectronApiSessionKey,