mirror of
https://github.com/electron/electron.git
synced 2026-01-07 22:54:25 -05:00
* chore: bump chromium in DEPS to 143.0.7492.0 * chore: bump chromium in DEPS to 143.0.7493.0 * chore: update mas_avoid_private_macos_api_usage.patch.patch Move os_crypt/sync and os_crypt/async shared code to os_crypt/common | https://chromium-review.googlesource.com/c/chromium/src/+/7081087 * chore: update add_didinstallconditionalfeatures.patch no manual changes; patch applied with fuzz Reland "Remove BackForwardTransitions flag" | https://chromium-review.googlesource.com/c/chromium/src/+/7079411 * chore: update printing.patch Avoid a reachable NOTREACHED() in PrintingContextLinux | https://chromium-review.googlesource.com/c/chromium/src/+/7081117 * chore: update allow_in-process_windows_to_have_different_web_prefs.patch patch reapplied manually due to context shear Reland "Remove BackForwardTransitions flag" | https://chromium-review.googlesource.com/c/chromium/src/+/7079411 * chore: update chore_provide_iswebcontentscreationoverridden_with_full_params.patch patch reapplied manually due to context shear Cleanup: format some content files | https://chromium-review.googlesource.com/c/chromium/src/+/7083290 * chore: update feat_ensure_mas_builds_of_the_same_application_can_use_safestorage.patch patch manually reapplied for files moved upstream Move os_crypt/sync and os_crypt/async shared code to os_crypt/common | https://chromium-review.googlesource.com/c/chromium/src/+/7081087 * chore: update revert_cleanup_remove_feature_windelayspellcheckserviceinit.patch no manual changes; patch applied with fuzz [spelling+grammar restrictions] fix feature param name | https://chromium-review.googlesource.com/c/chromium/src/+/7081186 * chore: update patches * chore: fix broken includes in ElectronBrowserMainParts Move os_crypt/sync and os_crypt/async shared code to os_crypt/common | https://chromium-review.googlesource.com/c/chromium/src/+/7081087 * chore: bump chromium in DEPS to 143.0.7495.0 * chore: fixup patch indices * chore: bump chromium in DEPS to 143.0.7497.0 * chore: fixup patch indices * 7085081: Roll libc++ from d6739a332fe9 to bc00f6e9f739 (1 revision) https://chromium-review.googlesource.com/c/chromium/src/+/7085081 * 7081087: Move os_crypt/sync and os_crypt/async shared code to os_crypt/common https://chromium-review.googlesource.com/c/chromium/src/+/7081087 * test: fix failing spec --------- Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com> Co-authored-by: Charles Kerr <charles@charleskerr.com> Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
86 lines
4.4 KiB
Diff
86 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 fbf4212b0aa58467a404ce146c59e8a7d2e55461..e27271000fdcb9f155467923db74b5da4df3e989 100644
|
|
--- a/content/public/renderer/content_renderer_client.h
|
|
+++ b/content/public/renderer/content_renderer_client.h
|
|
@@ -428,6 +428,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 93bb9ba86074d5105cca072d08588ff6e58caa6f..c3c795042c611b3ceb99d25dc255fbbe46ee9fcc 100644
|
|
--- a/content/renderer/renderer_blink_platform_impl.cc
|
|
+++ b/content/renderer/renderer_blink_platform_impl.cc
|
|
@@ -902,6 +902,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 451dd8f53764d02906cdfdd42d4a09f676857280..82d9b2f234101aeddc9c20ffae0d8793a5902ced 100644
|
|
--- a/content/renderer/renderer_blink_platform_impl.h
|
|
+++ b/content/renderer/renderer_blink_platform_impl.h
|
|
@@ -206,6 +206,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 ee07da0b3073fa15f66058bdd06cd8bce6f46c6e..dc188f2ac6cdd718eb058af834ca8fdf5ae3c753 100644
|
|
--- a/third_party/blink/public/platform/platform.h
|
|
+++ b/third_party/blink/public/platform/platform.h
|
|
@@ -673,6 +673,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 0660054931e295abafb420ce567f6b45d9af39d6..bea00fa0a9faaa0c0e7fa5b444c1e485d1e883d1 100644
|
|
--- a/third_party/blink/renderer/core/workers/worker_thread.cc
|
|
+++ b/third_party/blink/renderer/core/workers/worker_thread.cc
|
|
@@ -824,6 +824,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);
|
|
|