refactor: be more precise when creating api::WebContents (#23128)
This commit is contained in:
parent
1c57e078aa
commit
dc7fa1d9f1
7 changed files with 51 additions and 15 deletions
|
@ -877,17 +877,6 @@ void App::BrowserChildProcessCrashedOrKilled(
|
|||
void App::RenderProcessReady(content::RenderProcessHost* host) {
|
||||
ChildProcessLaunched(content::PROCESS_TYPE_RENDERER, host->GetID(),
|
||||
host->GetProcess().Handle());
|
||||
|
||||
// TODO(jeremy): this isn't really the right place to be creating
|
||||
// `WebContents` instances, but this was implicitly happening before in
|
||||
// `RenderProcessPreferences`, so this is at least more explicit...
|
||||
content::WebContents* web_contents =
|
||||
ElectronBrowserClient::Get()->GetWebContentsFromProcessID(host->GetID());
|
||||
if (web_contents) {
|
||||
v8::Isolate* isolate = JavascriptEnvironment::GetIsolate();
|
||||
v8::HandleScope scope(isolate);
|
||||
WebContents::FromOrCreate(isolate, web_contents);
|
||||
}
|
||||
}
|
||||
|
||||
void App::RenderProcessExited(content::RenderProcessHost* host) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue