![trop[bot]](/assets/img/avatar_default.png)
* chore: bump chromium in DEPS to 140.0.7296.0
Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
* chore: update patches
Co-authored-by: Keeley Hammond <khammond@slack-corp.com>
* 6702959: Remove OwnedByWidgetPassKey usage from content analysis dialog tests | https://chromium-review.googlesource.com/c/chromium/src/+/6702959
Co-authored-by: Keeley Hammond <khammond@slack-corp.com>
* 6722750: Remove un-used `stream_id` argument for `AidaCodeComplete` | https://chromium-review.googlesource.com/c/chromium/src/+/6722750
Co-authored-by: Keeley Hammond <khammond@slack-corp.com>
* 6696478: Reland Reland [video pip] Add fade in/out animation to controls visibility changes | https://chromium-review.googlesource.com/c/chromium/src/+/6696478
Co-authored-by: Keeley Hammond <vertedinde@electronjs.org>
* chore: update libc++-filenames
Co-authored-by: Keeley Hammond <vertedinde@electronjs.org>
* build: explicitly include cstdlib in Boyer-Moore patch
Co-authored-by: Keeley Hammond <vertedinde@electronjs.org>
* chore: bump chromium in DEPS to 140.0.7297.0
Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
* chore: update patches
Co-authored-by: Keeley Hammond <khammond@slack-corp.com>
* 6729537: [FPF] Pipe flag state from the browser to the renderer | https://chromium-review.googlesource.com/c/chromium/src/+/6729537
Co-authored-by: Keeley Hammond <khammond@slack-corp.com>
* 6727996: [Win] Detect pre-IPC crashes in sandboxed utility processes | https://chromium-review.googlesource.com/c/chromium/src/+/6727996
Co-authored-by: Keeley Hammond <khammond@slack-corp.com>
* 6707182: Move wtf/cross_thread_copier*.* to "blink" namespace | https://chromium-review.googlesource.com/c/chromium/src/+/6707182
Co-authored-by: Keeley Hammond <khammond@slack-corp.com>
* 6730796: extensions: Extract safe browsing/telemetry methods to new client class | https://chromium-review.googlesource.com/c/chromium/src/+/6730796
Co-authored-by: Keeley Hammond <khammond@slack-corp.com>
* chore: bump chromium in DEPS to 140.0.7299.0
Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
* chore: update patches
Co-authored-by: patchup[bot] <73610968+patchup[bot]@users.noreply.github.com>
* chore: update main patches
Co-authored-by: Keeley Hammond <khammond@slack-corp.com>
* build: reset the minimum macOS SDK to 15 to match upstream
This reverts commit 499e987c77
.
Co-authored-by: Keeley Hammond <khammond@slack-corp.com>
* 6730215: Remove IPC_MESSAGE_LOG_ENABLED ifdef blocks. | https://chromium-review.googlesource.com/c/chromium/src/+/6730215
Co-authored-by: Keeley Hammond <khammond@slack-corp.com>
* 6690442: Delete ppapi/buildflags/buildflags.h | https://chromium-review.googlesource.com/c/chromium/src/+/6690442
Co-authored-by: Keeley Hammond <khammond@slack-corp.com>
* 6667681: Use more binaries from clang toolchain in mac build | https://chromium-review.googlesource.com/c/chromium/src/+/6667681
Co-authored-by: Keeley Hammond <khammond@slack-corp.com>
* chore: bump chromium in DEPS to 140.0.7301.0
Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
* chore: update patches
Co-authored-by: Keeley Hammond <khammond@slack-corp.com>
* 6656309: extensions: Port proxy API to desktop Android | https://chromium-review.googlesource.com/c/chromium/src/+/6656309
Co-authored-by: Keeley Hammond <khammond@slack-corp.com>
* 6758510: Reland 'Move GN enable_plugins variable out of //ppapi' | https://chromium-review.googlesource.com/c/chromium/src/+/6758510
Co-authored-by: Keeley Hammond <khammond@slack-corp.com>
* 6701466: [Extensions] Remove NaCl arch info from Update Client URLs | https://chromium-review.googlesource.com/c/chromium/src/+/6701466
Co-authored-by: Keeley Hammond <khammond@slack-corp.com>
* 6735979: [FSA] Replace `request_writable` with a new enum `FileSystemAccessPermissionMode`. | https://chromium-review.googlesource.com/c/chromium/src/+/6735979
Co-authored-by: Keeley Hammond <khammond@slack-corp.com>
* 6712080: Reland "Turn on gender translation PAK generation everywhere" | https://chromium-review.googlesource.com/c/chromium/src/+/6712080
Co-authored-by: Keeley Hammond <khammond@slack-corp.com>
* 6730796: extensions: Extract safe browsing/telemetry methods to new client class | https://chromium-review.googlesource.com/c/chromium/src/+/6730796
Co-authored-by: Keeley Hammond <khammond@slack-corp.com>
* build: restore minimum macOS SDK to 10, restore patch
This reverts commit a04c579b994d5f4a782b793a69f34ff7a260e74f.
Co-authored-by: Keeley Hammond <khammond@slack-corp.com>
* fixup! 6701466: [Extensions] Remove NaCl arch info from Update Client URLs | https://chromium-review.googlesource.com/c/chromium/src/+/6701466
Co-authored-by: Keeley Hammond <khammond@slack-corp.com>
* chore: correct node patches
Co-authored-by: Keeley Hammond <vertedinde@electronjs.org>
* fixup! 6667681: Use more binaries from clang toolchain in mac build | https://chromium-review.googlesource.com/c/chromium/src/+/6667681
Co-authored-by: Keeley Hammond <vertedinde@electronjs.org>
---------
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: Keeley Hammond <khammond@slack-corp.com>
Co-authored-by: Keeley Hammond <vertedinde@electronjs.org>
Co-authored-by: patchup[bot] <73610968+patchup[bot]@users.noreply.github.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 6eb48c506834b50e9bd49a42bbb8f9f32093abfb..64c10021f5d0e58d9fcb740d5a56651d989503df 100644
|
|
--- a/content/public/renderer/content_renderer_client.h
|
|
+++ b/content/public/renderer/content_renderer_client.h
|
|
@@ -408,6 +408,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 398dc743a570997edc86133c53db29c33e74d273..42751a5bd371206f34dbc5acf06c6400a121071f 100644
|
|
--- a/content/renderer/renderer_blink_platform_impl.cc
|
|
+++ b/content/renderer/renderer_blink_platform_impl.cc
|
|
@@ -903,6 +903,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 c2c2b533e42cfcc8c3ecdde1ab6ed9bc2a353b5e..b2238f512b30e64399a901a3c9f430e5be54c27c 100644
|
|
--- a/content/renderer/renderer_blink_platform_impl.h
|
|
+++ b/content/renderer/renderer_blink_platform_impl.h
|
|
@@ -200,6 +200,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 dfc5c935005bf8fb59d4bf5dd6dcb31468128cd6..4b8c2223d4d7eebe88c54d232ac8f8e290f14dd6 100644
|
|
--- a/third_party/blink/public/platform/platform.h
|
|
+++ b/third_party/blink/public/platform/platform.h
|
|
@@ -675,6 +675,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 0ecbc9efc6b58ca605ec9b2d917b24b823b2c1e8..8587f9b9bf62b48271ce5a43f4402ba193672f5e 100644
|
|
--- a/third_party/blink/renderer/core/workers/worker_thread.cc
|
|
+++ b/third_party/blink/renderer/core/workers/worker_thread.cc
|
|
@@ -823,6 +823,12 @@ void WorkerThread::PrepareForShutdownOnWorkerThread() {
|
|
}
|
|
pause_handle_.reset();
|
|
|
|
+ {
|
|
+ v8::HandleScope handle_scope(GetIsolate());
|
|
+ Platform::Current()->WorkerContextWillDestroy(
|
|
+ GlobalScope()->ScriptController()->GetContext());
|
|
+ }
|
|
+
|
|
if (WorkerThreadDebugger* debugger = WorkerThreadDebugger::From(GetIsolate()))
|
|
debugger->WorkerThreadDestroyed(this);
|
|
|