world_ids.h 924 B

12345678910111213141516171819202122232425262728293031
  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/public/platform/web_isolated_world_ids.h"
  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 set in
  14. // lib/renderer/content-script-injector.ts, and are greater than or equal to
  15. // this number, up to ISOLATED_WORLD_ID_EXTENSIONS_END.
  16. ISOLATED_WORLD_ID_EXTENSIONS = 1 << 20,
  17. // Last valid isolated world ID.
  18. ISOLATED_WORLD_ID_EXTENSIONS_END =
  19. blink::IsolatedWorldId::kEmbedderWorldIdLimit - 1
  20. };
  21. } // namespace electron
  22. #endif // SHELL_COMMON_WORLD_IDS_H_