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

@ -6,6 +6,7 @@
#include "content/public/renderer/render_thread.h"
#include "extensions/renderer/dispatcher.h"
#include "shell/common/world_ids.h"
#include "shell/renderer/extensions/electron_extensions_dispatcher_delegate.h"
namespace electron {
@ -24,11 +25,7 @@ bool ElectronExtensionsRendererClient::IsIncognitoProcess() const {
}
int ElectronExtensionsRendererClient::GetLowestIsolatedWorldId() const {
// app_shell doesn't need to reserve world IDs for anything other than
// extensions, so we always return 1. Note that 0 is reserved for the global
// world.
// TODO(samuelmaddock): skip electron worlds
return 10;
return WorldIDs::ISOLATED_WORLD_ID_EXTENSIONS;
}
extensions::Dispatcher* ElectronExtensionsRendererClient::GetDispatcher() {