world_ids.h 883 B

123456789101112131415161718192021222324252627282930
  1. // Copyright (c) 2020 Samuel Maddock
  2. // Use of this source code is governed by the MIT license that can be
  3. // found in the LICENSE file.
  4. #ifndef SHELL_COMMON_WORLD_IDS_H_
  5. #define SHELL_COMMON_WORLD_IDS_H_
  6. #include "third_party/blink/renderer/platform/bindings/dom_wrapper_world.h" // nogncheck
  7. namespace electron {
  8. enum WorldIDs : int32_t {
  9. MAIN_WORLD_ID = 0,
  10. // Use a high number far away from 0 to not collide with any other world
  11. // IDs created internally by Chrome.
  12. ISOLATED_WORLD_ID = 999,
  13. // Numbers for isolated worlds for extensions are greater than or equal to
  14. // this number, up to ISOLATED_WORLD_ID_EXTENSIONS_END.
  15. ISOLATED_WORLD_ID_EXTENSIONS = 1 << 20,
  16. // Last valid isolated world ID.
  17. ISOLATED_WORLD_ID_EXTENSIONS_END =
  18. blink::IsolatedWorldId::kEmbedderWorldIdLimit - 1
  19. };
  20. } // namespace electron
  21. #endif // SHELL_COMMON_WORLD_IDS_H_