mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
fix(extensions): set lowest isolated world id (#22355)
* 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. Co-authored-by: Samuel Maddock <samuel.maddock@gmail.com>
This commit is contained in:
31
shell/common/world_ids.h
Normal file
31
shell/common/world_ids.h
Normal file
@@ -0,0 +1,31 @@
|
||||
// Copyright (c) 2020 Samuel Maddock
|
||||
// Use of this source code is governed by the MIT license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#ifndef SHELL_COMMON_WORLD_IDS_H_
|
||||
#define SHELL_COMMON_WORLD_IDS_H_
|
||||
|
||||
#include "third_party/blink/public/platform/web_isolated_world_ids.h"
|
||||
|
||||
namespace electron {
|
||||
|
||||
enum WorldIDs : int32_t {
|
||||
MAIN_WORLD_ID = 0,
|
||||
|
||||
// Use a high number far away from 0 to not collide with any other world
|
||||
// IDs created internally by Chrome.
|
||||
ISOLATED_WORLD_ID = 999,
|
||||
|
||||
// Numbers for isolated worlds for extensions are set in
|
||||
// lib/renderer/content-script-injector.ts, and are greater than or equal to
|
||||
// this number, up to ISOLATED_WORLD_ID_EXTENSIONS_END.
|
||||
ISOLATED_WORLD_ID_EXTENSIONS = 1 << 20,
|
||||
|
||||
// Last valid isolated world ID.
|
||||
ISOLATED_WORLD_ID_EXTENSIONS_END =
|
||||
blink::IsolatedWorldId::kEmbedderWorldIdLimit - 1
|
||||
};
|
||||
|
||||
} // namespace electron
|
||||
|
||||
#endif // SHELL_COMMON_WORLD_IDS_H_
|
||||
Reference in New Issue
Block a user