Reland "extensions: Add WillPrepareForEvaluation to setup MojoJS"

https://chromium-review.googlesource.com/c/chromium/src/+/6630056
This commit is contained in:
John Kleinschmidt
2025-06-12 13:07:07 -04:00
committed by Charles Kerr
parent 9cfb73d7ac
commit 77c4f967a6
4 changed files with 14 additions and 6 deletions

View File

@@ -170,14 +170,14 @@ void ElectronSandboxedRendererClient::EmitProcessEvent(
InvokeEmitProcessEvent(context, event_name);
}
void ElectronSandboxedRendererClient::WillEvaluateServiceWorkerOnWorkerThread(
void ElectronSandboxedRendererClient::WillPrepareForEvaluationOnWorkerThread(
blink::WebServiceWorkerContextProxy* context_proxy,
v8::Local<v8::Context> v8_context,
int64_t service_worker_version_id,
const GURL& service_worker_scope,
const GURL& script_url,
const blink::ServiceWorkerToken& service_worker_token) {
RendererClientBase::WillEvaluateServiceWorkerOnWorkerThread(
RendererClientBase::WillPrepareForEvaluationOnWorkerThread(
context_proxy, v8_context, service_worker_version_id,
service_worker_scope, script_url, service_worker_token);

View File

@@ -42,7 +42,7 @@ class ElectronSandboxedRendererClient : public RendererClientBase {
void RenderFrameCreated(content::RenderFrame*) override;
void RunScriptsAtDocumentStart(content::RenderFrame* render_frame) override;
void RunScriptsAtDocumentEnd(content::RenderFrame* render_frame) override;
void WillEvaluateServiceWorkerOnWorkerThread(
void WillPrepareForEvaluationOnWorkerThread(
blink::WebServiceWorkerContextProxy* context_proxy,
v8::Local<v8::Context> v8_context,
int64_t service_worker_version_id,

View File

@@ -485,7 +485,7 @@ void RendererClientBase::DidInitializeServiceWorkerContextOnWorkerThread(
#endif
}
void RendererClientBase::WillEvaluateServiceWorkerOnWorkerThread(
void RendererClientBase::WillPrepareForEvaluationOnWorkerThread(
blink::WebServiceWorkerContextProxy* context_proxy,
v8::Local<v8::Context> v8_context,
int64_t service_worker_version_id,
@@ -494,12 +494,19 @@ void RendererClientBase::WillEvaluateServiceWorkerOnWorkerThread(
const blink::ServiceWorkerToken& service_worker_token) {
#if BUILDFLAG(ENABLE_ELECTRON_EXTENSIONS)
extensions_renderer_client_->dispatcher()
->WillEvaluateServiceWorkerOnWorkerThread(
->WillPrepareForEvaluationOnWorkerThread(
context_proxy, v8_context, service_worker_version_id,
service_worker_scope, script_url, service_worker_token);
#endif
}
void RendererClientBase::WillEvaluateServiceWorkerOnWorkerThread() {
#if BUILDFLAG(ENABLE_ELECTRON_EXTENSIONS)
extensions_renderer_client_->dispatcher()
->WillEvaluateServiceWorkerOnWorkerThread();
#endif
}
void RendererClientBase::DidStartServiceWorkerContextOnWorkerThread(
int64_t service_worker_version_id,
const GURL& service_worker_scope,

View File

@@ -117,13 +117,14 @@ class RendererClientBase : public content::ContentRendererClient
blink::WebServiceWorkerContextProxy* context_proxy,
const GURL& service_worker_scope,
const GURL& script_url) override;
void WillEvaluateServiceWorkerOnWorkerThread(
void WillPrepareForEvaluationOnWorkerThread(
blink::WebServiceWorkerContextProxy* context_proxy,
v8::Local<v8::Context> v8_context,
int64_t service_worker_version_id,
const GURL& service_worker_scope,
const GURL& script_url,
const blink::ServiceWorkerToken& service_worker_token) override;
void WillEvaluateServiceWorkerOnWorkerThread() override;
void DidStartServiceWorkerContextOnWorkerThread(
int64_t service_worker_version_id,
const GURL& service_worker_scope,