electron/shell/renderer/preload_realm_context.h
Sam Maddock a07de0099c
feat: service worker preload scripts for improved extensions support … (#45408)
feat: service worker preload scripts for improved extensions support (#44411)

* feat: preload scripts for service workers

* feat: service worker IPC

* test: service worker preload scripts and ipc
2025-02-05 14:18:24 -05:00

34 lines
1 KiB
C++

// Copyright (c) 2025 Salesforce, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#ifndef ELECTRON_SHELL_RENDERER_PRELOAD_REALM_CONTEXT_H_
#define ELECTRON_SHELL_RENDERER_PRELOAD_REALM_CONTEXT_H_
#include "v8/include/v8-forward.h"
namespace electron {
class ServiceWorkerData;
}
namespace electron::preload_realm {
// Get initiator context given the preload context.
v8::MaybeLocal<v8::Context> GetInitiatorContext(v8::Local<v8::Context> context);
// Get the preload context given the initiator context.
v8::MaybeLocal<v8::Context> GetPreloadRealmContext(
v8::Local<v8::Context> context);
// Get service worker data given the preload realm context.
electron::ServiceWorkerData* GetServiceWorkerData(
v8::Local<v8::Context> context);
// Create
void OnCreatePreloadableV8Context(
v8::Local<v8::Context> initiator_context,
electron::ServiceWorkerData* service_worker_data);
} // namespace electron::preload_realm
#endif // ELECTRON_SHELL_RENDERER_PRELOAD_REALM_CONTEXT_H_