59dd17f2cf
* chore: bump chromium in DEPS to 102.0.4975.0 * chore: bump chromium in DEPS to 102.0.4977.0 * chore: update patches * Remove parameter of OnGpuProcessCrashed() https://chromium-review.googlesource.com/c/chromium/src/+/3543396 * hid: Add exclusionFilters option to requestDevice https://chromium-review.googlesource.com/c/chromium/src/+/3478175 * chore: bump chromium in DEPS to 102.0.4979.0 * chore: bump chromium in DEPS to 102.0.4981.0 * chore: update patches * Deny notification/push permission for documents in non-standard StoragePartitions https://chromium-review.googlesource.com/c/chromium/src/+/3257305 * Improve FrameTreeNode tracking in URLLoaderNetworkContext https://chromium-review.googlesource.com/c/chromium/src/+/3341866 * fixup! Remove parameter of OnGpuProcessCrashed() * chore: fix lint * Reland "Use gfx::Insets[F]::TLBR() and gfx::Insets[F]::VH() in the rest of Chrome" https://chromium-review.googlesource.com/c/chromium/src/+/3554236 * chore: bump chromium in DEPS to 102.0.4983.0 * Ensure EyeDropperView does not access a destroyed window https://chromium-review.googlesource.com/c/chromium/src/+/3561542 * ci: don't delete dawn .git directory 83901: Adds a generated file with the dawn git hash encoded at build time. | https://dawn-review.googlesource.com/c/dawn/+/83901 * ci: update Windows toolchain 3550827: New toolchain for Windows 10 20348 SDK | https://chromium-review.googlesource.com/c/chromium/src/+/3550827 * chore: bump chromium in DEPS to 102.0.4985.0 * chore: update patches * chore: bump chromium in DEPS to 102.0.4987.0 * chore: update patches * 3563432: codehealth: remove uses of DictionaryValue in cbui/webui https://chromium-review.googlesource.com/c/chromium/src/+/3563432 * chore: update patches after rebase * Use gfx::Insets[F]::TLBR() and gfx::Insets[F]::VH() in the rest of Chrome https://chromium-review.googlesource.com/c/chromium/src/+/3554236 * 3565724: Preserve "proper method names" as-is in error.stack. https://chromium-review.googlesource.com/c/v8/v8/+/3565724 * chore: bump chromium in DEPS to 102.0.4989.0 * chore: update patches * fixup ci: don't delete dawn .git directory for Windows * 3560843: Remove multi-parameter version of gfx::Rect[F]::Inset() https://chromium-review.googlesource.com/c/chromium/src/+/3560843 * 3572711: Remove unused IDS_PDF_TOOLTIP_ROTATE_CW resource. https://chromium-review.googlesource.com/c/chromium/src/+/3572711 * 3572926: Reland "[Sysroot] Switch to Debian Bullseye stable" https://chromium-review.googlesource.com/c/chromium/src/+/3572926 * build: fixup sysroots with electron specific dependencies * fixup Remove multi-parameter version of gfx::Rect[F]::Inset() * fixup 3565724: Preserve "proper method names" as-is in error.stack. * fixup Remove multi-parameter version of gfx::Rect[F]::Inset() * test: add spec for navigator.hid.requestDevice({ exclusionFilters: [...] } * fixup 3565724: Preserve "proper method names" as-is in error.stack. * ci: use python3 to get the windows toolchain profile 3525960: Explicitly run everything with python3 | https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3525960 * chore: add diagnostic logging * fix: try calling process.crash() * chore: remove logging Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com> Co-authored-by: deepak1556 <hop2deep@gmail.com> Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org> Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com> Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
85 lines
4.4 KiB
Diff
85 lines
4.4 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Cheng Zhao <zcbenz@gmail.com>
|
|
Date: Thu, 20 Sep 2018 17:47:12 -0700
|
|
Subject: worker_context_will_destroy.patch
|
|
|
|
This adds a hook for worker context destruction, which we use in Electron to
|
|
shutdown node integration in the worker if relevant.
|
|
|
|
An attempt to upstream this was made, but rejected:
|
|
https://chromium-review.googlesource.com/c/chromium/src/+/1954347
|
|
|
|
diff --git a/content/public/renderer/content_renderer_client.h b/content/public/renderer/content_renderer_client.h
|
|
index eb8968c2a86102d0d3a21f07c394f1c360083c6c..025ef3f70a5ae34faf8c6013fbfba171c7f501ac 100644
|
|
--- a/content/public/renderer/content_renderer_client.h
|
|
+++ b/content/public/renderer/content_renderer_client.h
|
|
@@ -356,6 +356,11 @@ class CONTENT_EXPORT ContentRendererClient {
|
|
virtual void DidInitializeWorkerContextOnWorkerThread(
|
|
v8::Local<v8::Context> context) {}
|
|
|
|
+ // Notifies that a worker context will be destroyed. This function is called
|
|
+ // from the worker thread.
|
|
+ virtual void WillDestroyWorkerContextOnWorkerThread(
|
|
+ v8::Local<v8::Context> context) {}
|
|
+
|
|
// Overwrites the given URL to use an HTML5 embed if possible.
|
|
// An empty URL is returned if the URL is not overriden.
|
|
virtual GURL OverrideFlashEmbedWithHTML(const GURL& url);
|
|
diff --git a/content/renderer/renderer_blink_platform_impl.cc b/content/renderer/renderer_blink_platform_impl.cc
|
|
index dbde0706007b8f202fcca5fc05562979617b0183..2adea2c2edabf3c401e9dcd228f1d57c08066059 100644
|
|
--- a/content/renderer/renderer_blink_platform_impl.cc
|
|
+++ b/content/renderer/renderer_blink_platform_impl.cc
|
|
@@ -949,6 +949,12 @@ void RendererBlinkPlatformImpl::WillStopWorkerThread() {
|
|
WorkerThreadRegistry::Instance()->WillStopCurrentWorkerThread();
|
|
}
|
|
|
|
+void RendererBlinkPlatformImpl::WorkerContextWillDestroy(
|
|
+ const v8::Local<v8::Context>& worker) {
|
|
+ GetContentClient()->renderer()->WillDestroyWorkerContextOnWorkerThread(
|
|
+ worker);
|
|
+}
|
|
+
|
|
void RendererBlinkPlatformImpl::WorkerContextCreated(
|
|
const v8::Local<v8::Context>& worker) {
|
|
GetContentClient()->renderer()->DidInitializeWorkerContextOnWorkerThread(
|
|
diff --git a/content/renderer/renderer_blink_platform_impl.h b/content/renderer/renderer_blink_platform_impl.h
|
|
index e7d0d3e7c08c2f6e83726e7fa2557847d148a0ed..c6e0a728150db2b5af41e12304c88d57e51faa43 100644
|
|
--- a/content/renderer/renderer_blink_platform_impl.h
|
|
+++ b/content/renderer/renderer_blink_platform_impl.h
|
|
@@ -208,6 +208,7 @@ class CONTENT_EXPORT RendererBlinkPlatformImpl : public BlinkPlatformImpl {
|
|
void DidStartWorkerThread() override;
|
|
void WillStopWorkerThread() override;
|
|
void WorkerContextCreated(const v8::Local<v8::Context>& worker) override;
|
|
+ void WorkerContextWillDestroy(const v8::Local<v8::Context>& worker) override;
|
|
bool AllowScriptExtensionForServiceWorker(
|
|
const blink::WebSecurityOrigin& script_origin) override;
|
|
blink::ProtocolHandlerSecurityLevel GetProtocolHandlerSecurityLevel()
|
|
diff --git a/third_party/blink/public/platform/platform.h b/third_party/blink/public/platform/platform.h
|
|
index 0825226fae036b1e5503b66dabe4bd92ad6ee9bb..3cbb1ed9ef65cb9044a76b0a1686f6ab019c87b5 100644
|
|
--- a/third_party/blink/public/platform/platform.h
|
|
+++ b/third_party/blink/public/platform/platform.h
|
|
@@ -714,6 +714,7 @@ class BLINK_PLATFORM_EXPORT Platform {
|
|
virtual void DidStartWorkerThread() {}
|
|
virtual void WillStopWorkerThread() {}
|
|
virtual void WorkerContextCreated(const v8::Local<v8::Context>& worker) {}
|
|
+ virtual void WorkerContextWillDestroy(const v8::Local<v8::Context>& worker) {}
|
|
virtual bool AllowScriptExtensionForServiceWorker(
|
|
const WebSecurityOrigin& script_origin) {
|
|
return false;
|
|
diff --git a/third_party/blink/renderer/core/workers/worker_thread.cc b/third_party/blink/renderer/core/workers/worker_thread.cc
|
|
index 68c38d2045c7c23650bd56717081bb001a4e690e..e0e08d4bdf9521ed5c1940d31665d1b675119f0d 100644
|
|
--- a/third_party/blink/renderer/core/workers/worker_thread.cc
|
|
+++ b/third_party/blink/renderer/core/workers/worker_thread.cc
|
|
@@ -732,6 +732,12 @@ void WorkerThread::PrepareForShutdownOnWorkerThread() {
|
|
nested_runner_->QuitNow();
|
|
}
|
|
|
|
+ {
|
|
+ v8::HandleScope handle_scope(GetIsolate());
|
|
+ Platform::Current()->WorkerContextWillDestroy(
|
|
+ GlobalScope()->ScriptController()->GetContext());
|
|
+ }
|
|
+
|
|
if (WorkerThreadDebugger* debugger = WorkerThreadDebugger::From(GetIsolate()))
|
|
debugger->WorkerThreadDestroyed(this);
|
|
|