refactor: allocate api::Session on cpp heap (#48141)
This commit is contained in:
parent
0917ed5f6f
commit
3ccb1bc0a8
32 changed files with 632 additions and 293 deletions
|
@ -698,14 +698,15 @@ gin_helper::Handle<SimpleURLLoaderWrapper> SimpleURLLoaderWrapper::Create(
|
|||
ElectronBrowserContext* browser_context = nullptr;
|
||||
if (electron::IsBrowserProcess()) {
|
||||
std::string partition;
|
||||
gin_helper::Handle<Session> session;
|
||||
Session* session = nullptr;
|
||||
if (!opts.Get("session", &session)) {
|
||||
if (opts.Get("partition", &partition))
|
||||
session = Session::FromPartition(args->isolate(), partition);
|
||||
else // default session
|
||||
session = Session::FromPartition(args->isolate(), "");
|
||||
}
|
||||
browser_context = session->browser_context();
|
||||
if (session)
|
||||
browser_context = session->browser_context();
|
||||
}
|
||||
|
||||
auto ret = gin_helper::CreateHandle(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue