refactor: add SessionPreferences::CreateForBrowserContext() (#38656)
Copy the NativeWindowRelay::CreateForWebContents() idiom to simplify SessionPreferences's constructor and lifecycle.
This commit is contained in:
parent
12b85a77a8
commit
d95ae19edf
3 changed files with 12 additions and 4 deletions
|
@ -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());
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue