chore: simplify main world setup of contextIsolation (#16046)

This commit is contained in:
Cheng Zhao 2018-12-14 06:25:12 +09:00 committed by John Kleinschmidt
parent d6d245d0c3
commit 897c6e93cb
7 changed files with 34 additions and 49 deletions

View file

@ -96,9 +96,10 @@ void AtomRenderFrameObserver::DidCreateScriptContext(
renderer_client_->DidCreateScriptContext(context, render_frame_);
if (renderer_client_->isolated_world() && IsMainWorld(world_id) &&
render_frame_->IsMainFrame()) {
// Only the top window's main frame has isolated world.
render_frame_->IsMainFrame() && !render_frame_->GetWebFrame()->Opener()) {
CreateIsolatedWorldContext();
renderer_client_->SetupMainWorldOverrides(context);
renderer_client_->SetupMainWorldOverrides(context, render_frame_);
}
}