mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
refactor: add SessionPreferences::CreateForBrowserContext() (#38713)
Copy the NativeWindowRelay::CreateForWebContents() idiom to simplify SessionPreferences's constructor and lifecycle. Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: Charles Kerr <charles@charleskerr.com>
This commit is contained in:
@@ -345,7 +345,7 @@ Session::Session(v8::Isolate* isolate, ElectronBrowserContext* browser_context)
|
||||
// Observe DownloadManager to get download notifications.
|
||||
browser_context->GetDownloadManager()->AddObserver(this);
|
||||
|
||||
new SessionPreferences(browser_context);
|
||||
SessionPreferences::CreateForBrowserContext(browser_context);
|
||||
|
||||
protocol_.Reset(isolate, Protocol::Create(isolate, browser_context).ToV8());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user