preload_realm_context.h 1.0 KB

12345678910111213141516171819202122232425262728293031323334
  1. // Copyright (c) 2025 Salesforce, Inc.
  2. // Use of this source code is governed by the MIT license that can be
  3. // found in the LICENSE file.
  4. #ifndef ELECTRON_SHELL_RENDERER_PRELOAD_REALM_CONTEXT_H_
  5. #define ELECTRON_SHELL_RENDERER_PRELOAD_REALM_CONTEXT_H_
  6. #include "v8/include/v8-forward.h"
  7. namespace electron {
  8. class ServiceWorkerData;
  9. }
  10. namespace electron::preload_realm {
  11. // Get initiator context given the preload context.
  12. v8::MaybeLocal<v8::Context> GetInitiatorContext(v8::Local<v8::Context> context);
  13. // Get the preload context given the initiator context.
  14. v8::MaybeLocal<v8::Context> GetPreloadRealmContext(
  15. v8::Local<v8::Context> context);
  16. // Get service worker data given the preload realm context.
  17. electron::ServiceWorkerData* GetServiceWorkerData(
  18. v8::Local<v8::Context> context);
  19. // Create
  20. void OnCreatePreloadableV8Context(
  21. v8::Local<v8::Context> initiator_context,
  22. electron::ServiceWorkerData* service_worker_data);
  23. } // namespace electron::preload_realm
  24. #endif // ELECTRON_SHELL_RENDERER_PRELOAD_REALM_CONTEXT_H_