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
This commit is contained in:
parent
bc22ee7897
commit
26da3c5d6e
67 changed files with 2103 additions and 298 deletions
34
shell/renderer/preload_realm_context.h
Normal file
34
shell/renderer/preload_realm_context.h
Normal file
|
@ -0,0 +1,34 @@
|
|||
// 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_
|
Loading…
Add table
Add a link
Reference in a new issue