Skip to content

Commit

Permalink
fix: session argument of app 'session-created' event (#25798)
Browse files Browse the repository at this point in the history
Co-authored-by: Milan Burda <miburda@microsoft.com>
  • Loading branch information
miniak and Milan Burda committed Oct 8, 2020
1 parent 244f405 commit 7ae4b2b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 4 additions & 0 deletions lib/browser/api/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,10 @@ for (const name of events) {
});
}

app.on('-session-created' as any, (event, session) => {
app.emit('session-created', session);
});

// Deprecate allowRendererProcessReuse but only if they set it to false, no need to log if
// they are setting it to true
deprecate.removeProperty(app, 'allowRendererProcessReuse', [false]);
3 changes: 1 addition & 2 deletions shell/browser/api/electron_api_session.cc
Original file line number Diff line number Diff line change
Expand Up @@ -950,8 +950,7 @@ gin::Handle<Session> Session::CreateFrom(
ElectronBrowserMainParts::Get()->RegisterDestructionCallback(
base::BindOnce([](Session* session) { delete session; }, handle.get()));

App::Get()->EmitCustomEvent("session-created",
handle.ToV8().As<v8::Object>());
App::Get()->Emit("-session-created", handle.ToV8().As<v8::Object>());

return handle;
}
Expand Down

0 comments on commit 7ae4b2b

Please sign in to comment.