fix(extensions): set lowest isolated world id (#22212)

* fix(extensions): set lowest isolated world id

* refactor: move world IDs into separate header file

Several files are including electron_render_frame_observer.h just for the world IDs.
This commit is contained in:
Samuel Maddock 2020-02-23 23:33:58 -05:00 committed by GitHub
parent 68c6d53156
commit 8cc0435d9c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 45 additions and 33 deletions

View file

@ -20,8 +20,8 @@
#include "shell/common/gin_helper/dictionary.h"
#include "shell/common/gin_helper/promise.h"
#include "shell/common/node_includes.h"
#include "shell/common/world_ids.h"
#include "shell/renderer/api/context_bridge/render_frame_context_bridge_store.h"
#include "shell/renderer/electron_render_frame_observer.h"
#include "third_party/blink/public/web/web_local_frame.h"
namespace electron {
@ -477,7 +477,7 @@ void ExposeAPIInMainWorld(const std::string& key,
}
v8::Local<v8::Context> isolated_context =
frame->WorldScriptContext(args->isolate(), World::ISOLATED_WORLD);
frame->WorldScriptContext(args->isolate(), WorldIDs::ISOLATED_WORLD_ID);
v8::Context::Scope main_context_scope(main_context);
{