refactor: simplify content script injection (#18532)

This commit is contained in:
Jeremy Apthorp 2019-06-04 16:07:34 -07:00 committed by GitHub
parent f80601da16
commit ed5fb4a720
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 63 additions and 407 deletions

View file

@ -807,6 +807,14 @@ void App::BrowserChildProcessKilled(
void App::RenderProcessReady(content::RenderProcessHost* host) {
ChildProcessLaunched(content::PROCESS_TYPE_RENDERER,
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 =
AtomBrowserClient::Get()->GetWebContentsFromProcessID(host->GetID());
if (web_contents)
WebContents::FromOrCreate(v8::Isolate::GetCurrent(), web_contents);
}
void App::RenderProcessDisconnected(base::ProcessId host_pid) {