mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
* chore: bump chromium in DEPS to 98.0.4732.0 * chore: bump chromium in DEPS to 98.0.4734.0 * chore: bump chromium in DEPS to 98.0.4736.0 * chore: bump chromium in DEPS to 98.0.4738.0 * chore: bump chromium in DEPS to 98.0.4740.0 * chore: bump chromium in DEPS to 98.0.4742.0 * chore: bump chromium in DEPS to 98.0.4744.0 * chore: bump chromium in DEPS to 98.0.4746.0 * chore: bump chromium in DEPS to 98.0.4748.0 * chore: bump chromium in DEPS to 98.0.4750.0 * chore: bump chromium in DEPS to 98.0.4752.0 * chore: bump chromium in DEPS to 98.0.4754.0 * chore: bump chromium in DEPS to 98.0.4756.0 * chore: bump chromium in DEPS to 98.0.4758.0 * chore: bump chromium in DEPS to 98.0.4758.3 * chore: bump chromium in DEPS to 98.0.4758.5 * chore: bump chromium in DEPS to 98.0.4758.9 * chore: bump chromium in DEPS to 98.0.4758.10 * chore: bump chromium in DEPS to 98.0.4758.9 * chore: bump chromium in DEPS to 98.0.4758.10 * chore: bump chromium in DEPS to 98.0.4758.9 * chore: bump chromium in DEPS to 98.0.4758.10 * chore: bump chromium in DEPS to 98.0.4758.9 * chore: bump chromium in DEPS to 98.0.4758.10 * chore: bump chromium in DEPS to 98.0.4758.9 * chore: bump chromium in DEPS to 98.0.4758.10 * 3292117: Remove unneeded base/compiler_specific.h includes in //chrome. https://chromium-review.googlesource.com/c/chromium/src/+/3292117 (cherry picked from commit 1a84b21a5e461927c13a0601395b036cf668077a) * 3289198: Enables calculating line, word and sentence boundaries on the browser https://chromium-review.googlesource.com/c/chromium/src/+/3289198 (cherry picked from commit c8b1766a789d596273fe6bee8adab62e7963bc17) * 3276176: Remove expired gdi-text-printing flag and associated code. https://chromium-review.googlesource.com/c/chromium/src/+/3276176 (cherry picked from commit 0abd3208d6aa42f9329d50407290536d3196a19b) * 3240963: content: allow embedder to prevent locking scheme registry https://chromium-review.googlesource.com/c/chromium/src/+/3240963 (cherry picked from commit 19540a965d47205cb079738d3d11b12f82edbb98) * 3269899: Rename WebContentsImpl::GetFrameTree to GetPrimaryFrameTree https://chromium-review.googlesource.com/c/chromium/src/+/3269899 (cherry picked from commit a5b704e184c45cffd2dbc97e42bec76d52ed3f7a) * chore: fixup patch indices (cherry picked from commit dd9cb2a448c7368abab9e6733e442ad75ca9fc38) * 3276279: Enable -Wshadow by default for the "chromium code" config. https://chromium-review.googlesource.com/c/chromium/src/+/3276279 (cherry picked from commit ec20f7fc862de2b0057fe4d59c13d94b70a9e13c) * 3279737: appcache: Remove WebPreference/WebSetting https://chromium-review.googlesource.com/c/chromium/src/+/3279737 (cherry picked from commit 04088b5a4413f074cd4090838ed4ccb123f32c56) * 3275564: [api] Advance API deprecation for APIs last marked in v9.6 https://chromium-review.googlesource.com/c/v8/v8/+/3275564 (cherry picked from commit 72ef5a0bced84ca5dbacb0de4e63fe73fc8d34e5) * 3261873: Clean up WebScriptSource constructors https://chromium-review.googlesource.com/c/chromium/src/+/3261873 (cherry picked from commit c277b0b411b2dcfabdab2798dd489aab2a01fa2c) * 3279346: appcache: Remove ConsoleMessage appcache field https://chromium-review.googlesource.com/c/chromium/src/+/3279346 (cherry picked from commit ea85e829ccd6fbf019b0056300232d0a4bf6a8e8) * 3264212: Move legacy file loading to legacy_test_runner https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3264212 Both Persistence and UI have been removed from globals, but the issues they seemed to be patching are no longer reproducible from what I can tell, and so we can just delete these and re-evaluate if something surfaces. (cherry picked from commit f3e01465ce8b15af93aebdb5bd08fffed9dbe81c) * 3290415: x11: remove the USE_X11 define. https://chromium-review.googlesource.com/c/chromium/src/+/3290415 (cherry picked from commit 1351e45cb53851018675e707941d71f44e7bb2a7) * 3179530: Defer system calls in PrintingContext for OOP printing https://chromium-review.googlesource.com/c/chromium/src/+/3179530 (cherry picked from commit 4e235ab720ec3f2f7112b47be948469e9fc9023a) * 3299445: Consolidate is_win conditionals in chrome/test/BUILD.gn. https://chromium-review.googlesource.com/c/chromium/src/+/3299445 (cherry picked from commit d09ef41fc11f8190d6174d48506291c462420bbc) * chore: update patch indices (cherry picked from commit 77b72f77b8322e75c72debe446c34e38ccb0468c) * 3223975: Break PrintJobWorker OOP logic into separate class https://chromium-review.googlesource.com/c/chromium/src/+/3223975 (cherry picked from commit e02a7b1e8025709101f13e8a82398714a3c6f451) * 3279001: Remove support for font-family: -webkit-pictograph https://chromium-review.googlesource.com/c/chromium/src/+/3279001 (cherry picked from commit 01ba427a032dad1a1cb272bca8a420ec4f3d2198) * chore: fixup patch indices (cherry picked from commit 49d33970d6f8c5b5c9393d509c5727e66f9698a1) * chore: update patches (cherry picked from commit 266bb0db2ede34b8569d94fe6725b567a389fa83) * chore: update patches (cherry picked from commit 7ec7dac00dca5f00a09d11fe6b741470e4524519) * chore: update printing patch for miracle ptr (cherry picked from commit 4954c64859a7d4da2e57318b66d09fdc49d11327) * chore: add noexcept to fix clang error (cherry picked from commit ef9b7d1826c20f5df5442962a82815732dfb0086) * chore: update patches (cherry picked from commit 495e5c8dfb203002300f96924199e6cb86fe272e) * chore: update patches (cherry picked from commit c41579b260ae71bef2f6437ff21644ec0858ec35) * 3293841: Remove File Handling permissions code Ref: https://chromium-review.googlesource.com/c/chromium/src/+/3293841 (cherry picked from commit e6a5c4fa0c3d3c4f4cf77961d2f73f6f2bffa4dd) * chore: update patches 3311700: Move the PpapiPluginSandboxedProcessLauncherDelegate | https://chromium-review.googlesource.com/c/chromium/src/+/3311700 (cherry picked from commit 1f0b5231ea12840cc3610ac306ec421d8bc884b1) * 3289260: [CodeHealth]: Remove uses of Notification Service Ref: https://chromium-review.googlesource.com/c/chromium/src/+/3289260 (cherry picked from commit 741d48c9d8e8740c9f3e3c2dbf2072fc76ca92ad) * 3301600: Disable scripted print in fenced frames Ref: https://chromium-review.googlesource.com/c/chromium/src/+/3301600 (cherry picked from commit 9ebe29ae559df0de103b29615990ff7b171e54ca) * chore: add missing thread_restrictions headers (cherry picked from commit 8440c2ff2ec1cb808e8f5d77eb75e41d9be7d0f6) * 3305132: Rewrite most `Foo* field_` pointer fields to `raw_ptr<Foo> field_`. Ref: https://chromium-review.googlesource.com/c/chromium/src/+/3305132 (cherry picked from commit f4e090c9190fe919123b660d2e0909f09a66d03b) * fix: add ppapi_sandbox header for linux 3311700: Move the PpapiPluginSandboxedProcessLauncherDelegate | https://chromium-review.googlesource.com/c/chromium/src/+/3311700 (cherry picked from commit 00335143af0dab4a1240670d73f9061f3f7dddb3) * 3321044: Remove DictionaryValue::Clear() Ref: https://chromium-review.googlesource.com/c/chromium/src/+/3321044 (cherry picked from commit 2cba28ab91d6a1e60024d8826e82bbe07e4a1b6e) * chore: update printing.patch Refs: - 3304556: [code health] Remove notification observation from PrintJob. | https://chromium-review.googlesource.com/c/chromium/src/+/3304556 - 3305095: [code health] Remove NotificationService from PrintViewManagerBase. | https://chromium-review.googlesource.com/c/chromium/src/+/3305095 (cherry picked from commit b3e6811a687e5883a2e74ae044a2e52f0ac000bc) * build: add v8-embedder-state headers to GN patch (cherry picked from commit 46b085f0ae7b2fe3556efbed2a36853a23cccc1c) * chore: update patches * chore: update video consumers (cherry picked from commit e78c76f76a3bc2d868a330434e33a16be48ebc76) * refactor: use newer base::Value API (cherry picked from commit 7d711f6a85245bc8b80e7601c992647be2dce40f) * oops 😵💫 (cherry picked from commit e348ab73242e96f5c4d572d00185a5c25c218d26) * chore: rename CookiePartitionKeychain ...to CookiePartitionKeyCollection (cherry picked from commit b88f03dcb225f219ec78dd7463058231c74603e2) * chore: update patch after rebase * fix: WCO method got renamed (cherry picked from commit f80c70fdccbc4847e08b2ef08849a1d00350d341) * build: turn PartitionAlloc back off on mac for now (cherry picked from commit 0ef90f5385411c7f8f9ab3904c644a0f254343cf) * 3344749: Revert "Stop using NSRunLoop in renderer process" https://chromium-review.googlesource.com/c/chromium/src/+/3344749 (cherry picked from commit de8e4afb6f7f24db2a6062dd7d2ddcabf13f3f16) * chore: disable serial device enumerator sequence dcheck (cherry picked from commit c3a51158ed572cecbe5818b78e9c91cd8c7e3367) * chore: bump chromium in DEPS to 98.0.4758.9 * fix: comment out line in DeviceService dtor (cherry picked from commit bf2af594c7336ff0c93a1155de7710a6c7387147) * Revert "chore: bump chromium in DEPS to 98.0.4758.9" This reverts commit 5d2232ff9aa70fb227c984272e2317f3946b03c2. * fix: destructor for EmbedderStateScope * fixup! 3279001: Remove support for font-family: -webkit-pictograph (cherry picked from commit a0707af4facb31b8458723f9647201776b8431a3) * fixup! 3279346: appcache: Remove ConsoleMessage appcache field (cherry picked from commit c947cf23218818b81107c18331eaf21379f11db9) * chore: update patches * chore: bump chromium in DEPS to 98.0.4758.9 * chore: bump chromium in DEPS to 98.0.4758.10 * chore: bump chromium in DEPS to 98.0.4758.9 Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com> Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com> Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com> Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com> Co-authored-by: VerteDinde <khammond@slack-corp.com> Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org> Co-authored-by: clavin <clavin@electronjs.org> Co-authored-by: John Kleinschmidt <jkleinsc@github.com>
138 lines
7.9 KiB
Diff
138 lines
7.9 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Jeremy Apthorp <nornagon@nornagon.net>
|
|
Date: Wed, 15 Jan 2020 16:35:18 -0800
|
|
Subject: add DidInstallConditionalFeatures
|
|
|
|
This adds a hook on script context creation _after conditional features
|
|
have been installed_. Electron uses this to run preload scripts and
|
|
various other initialization. This is necessary because at the time
|
|
DidCreateScriptContext is called, not all JS APIs are available in the
|
|
context, which can cause some preload scripts to trip.
|
|
|
|
diff --git a/content/public/renderer/render_frame_observer.h b/content/public/renderer/render_frame_observer.h
|
|
index f6d262f1bf7aa77c2a63f4a4c3351be0fe2ab3fd..52db2e1948fd7752b88d5a692748053491594c2d 100644
|
|
--- a/content/public/renderer/render_frame_observer.h
|
|
+++ b/content/public/renderer/render_frame_observer.h
|
|
@@ -129,6 +129,8 @@ class CONTENT_EXPORT RenderFrameObserver : public IPC::Listener,
|
|
virtual void DidHandleOnloadEvents() {}
|
|
virtual void DidCreateScriptContext(v8::Local<v8::Context> context,
|
|
int32_t world_id) {}
|
|
+ virtual void DidInstallConditionalFeatures(v8::Local<v8::Context> context,
|
|
+ int32_t world_id) {}
|
|
virtual void WillReleaseScriptContext(v8::Local<v8::Context> context,
|
|
int32_t world_id) {}
|
|
virtual void DidClearWindowObject() {}
|
|
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
|
|
index 584ae29be139c9be347e4fa9f920a2cc84baf00a..c7a5f0916cf8ba6db6fa85537c140024a92ff24d 100644
|
|
--- a/content/renderer/render_frame_impl.cc
|
|
+++ b/content/renderer/render_frame_impl.cc
|
|
@@ -4515,6 +4515,12 @@ void RenderFrameImpl::DidCreateScriptContext(v8::Local<v8::Context> context,
|
|
observer.DidCreateScriptContext(context, world_id);
|
|
}
|
|
|
|
+void RenderFrameImpl::DidInstallConditionalFeatures(
|
|
+ v8::Local<v8::Context> context, int world_id) {
|
|
+ for (auto& observer : observers_)
|
|
+ observer.DidInstallConditionalFeatures(context, world_id);
|
|
+}
|
|
+
|
|
void RenderFrameImpl::WillReleaseScriptContext(v8::Local<v8::Context> context,
|
|
int world_id) {
|
|
for (auto& observer : observers_)
|
|
diff --git a/content/renderer/render_frame_impl.h b/content/renderer/render_frame_impl.h
|
|
index 1b582c1736db20dab712ee7875f37c2140bd7d45..efab4f51e56e6e179fb832b1cf47d7f4a348e6c7 100644
|
|
--- a/content/renderer/render_frame_impl.h
|
|
+++ b/content/renderer/render_frame_impl.h
|
|
@@ -602,6 +602,8 @@ class CONTENT_EXPORT RenderFrameImpl
|
|
blink::WebLocalFrameClient::LazyLoadBehavior lazy_load_behavior) override;
|
|
void DidCreateScriptContext(v8::Local<v8::Context> context,
|
|
int world_id) override;
|
|
+ void DidInstallConditionalFeatures(v8::Local<v8::Context> context,
|
|
+ int world_id) override;
|
|
void WillReleaseScriptContext(v8::Local<v8::Context> context,
|
|
int world_id) override;
|
|
void DidChangeScrollOffset() override;
|
|
diff --git a/third_party/blink/public/web/web_local_frame_client.h b/third_party/blink/public/web/web_local_frame_client.h
|
|
index 994841c02b0472e5239d9b73a07b2592a39df8be..ad19a3cddf200f6600a04c1136fd21218d496ba8 100644
|
|
--- a/third_party/blink/public/web/web_local_frame_client.h
|
|
+++ b/third_party/blink/public/web/web_local_frame_client.h
|
|
@@ -596,6 +596,9 @@ class BLINK_EXPORT WebLocalFrameClient {
|
|
virtual void DidCreateScriptContext(v8::Local<v8::Context>,
|
|
int32_t world_id) {}
|
|
|
|
+ virtual void DidInstallConditionalFeatures(v8::Local<v8::Context>,
|
|
+ int32_t world_id) {}
|
|
+
|
|
// WebKit is about to release its reference to a v8 context for a frame.
|
|
virtual void WillReleaseScriptContext(v8::Local<v8::Context>,
|
|
int32_t world_id) {}
|
|
diff --git a/third_party/blink/renderer/bindings/core/v8/local_window_proxy.cc b/third_party/blink/renderer/bindings/core/v8/local_window_proxy.cc
|
|
index 29e255dc75a1d54211dc6059801d3c16b7cefdca..044195c7d77be5ff4abe9d2a71ddbbf2076b2efd 100644
|
|
--- a/third_party/blink/renderer/bindings/core/v8/local_window_proxy.cc
|
|
+++ b/third_party/blink/renderer/bindings/core/v8/local_window_proxy.cc
|
|
@@ -214,6 +214,7 @@ void LocalWindowProxy::Initialize() {
|
|
}
|
|
|
|
InstallConditionalFeatures();
|
|
+ GetFrame()->Client()->DidInstallConditionalFeatures(context, world_->GetWorldId());
|
|
|
|
if (World().IsMainWorld()) {
|
|
GetFrame()->Loader().DispatchDidClearWindowObjectInMainWorld();
|
|
diff --git a/third_party/blink/renderer/core/frame/local_frame_client.h b/third_party/blink/renderer/core/frame/local_frame_client.h
|
|
index c28bc5f4d285ab2db1b0501ad8663c4f948f3ddc..327c04b40460fc033ca7f4e4f838608cfc6c0ba3 100644
|
|
--- a/third_party/blink/renderer/core/frame/local_frame_client.h
|
|
+++ b/third_party/blink/renderer/core/frame/local_frame_client.h
|
|
@@ -311,6 +311,8 @@ class CORE_EXPORT LocalFrameClient : public FrameClient {
|
|
|
|
virtual void DidCreateScriptContext(v8::Local<v8::Context>,
|
|
int32_t world_id) = 0;
|
|
+ virtual void DidInstallConditionalFeatures(v8::Local<v8::Context>,
|
|
+ int32_t world_id) = 0;
|
|
virtual void WillReleaseScriptContext(v8::Local<v8::Context>,
|
|
int32_t world_id) = 0;
|
|
virtual bool AllowScriptExtensions() = 0;
|
|
diff --git a/third_party/blink/renderer/core/frame/local_frame_client_impl.cc b/third_party/blink/renderer/core/frame/local_frame_client_impl.cc
|
|
index 0922aaf1a5f076ed4544b6870ac3674b023c428b..ff8ccf56eaafe36fe4de08a448789b13033e8604 100644
|
|
--- a/third_party/blink/renderer/core/frame/local_frame_client_impl.cc
|
|
+++ b/third_party/blink/renderer/core/frame/local_frame_client_impl.cc
|
|
@@ -274,6 +274,13 @@ void LocalFrameClientImpl::DidCreateScriptContext(
|
|
web_frame_->Client()->DidCreateScriptContext(context, world_id);
|
|
}
|
|
|
|
+void LocalFrameClientImpl::DidInstallConditionalFeatures(
|
|
+ v8::Local<v8::Context> context,
|
|
+ int32_t world_id) {
|
|
+ if (web_frame_->Client())
|
|
+ web_frame_->Client()->DidInstallConditionalFeatures(context, world_id);
|
|
+}
|
|
+
|
|
void LocalFrameClientImpl::WillReleaseScriptContext(
|
|
v8::Local<v8::Context> context,
|
|
int32_t world_id) {
|
|
diff --git a/third_party/blink/renderer/core/frame/local_frame_client_impl.h b/third_party/blink/renderer/core/frame/local_frame_client_impl.h
|
|
index 59dd5662dccea2e570b93e7bbdc59fded301979c..30d7bafbf5877d71868fbdec9abbcacacd4b72a8 100644
|
|
--- a/third_party/blink/renderer/core/frame/local_frame_client_impl.h
|
|
+++ b/third_party/blink/renderer/core/frame/local_frame_client_impl.h
|
|
@@ -78,6 +78,8 @@ class CORE_EXPORT LocalFrameClientImpl final : public LocalFrameClient {
|
|
|
|
void DidCreateScriptContext(v8::Local<v8::Context>,
|
|
int32_t world_id) override;
|
|
+ void DidInstallConditionalFeatures(v8::Local<v8::Context>,
|
|
+ int32_t world_id) override;
|
|
void WillReleaseScriptContext(v8::Local<v8::Context>,
|
|
int32_t world_id) override;
|
|
|
|
diff --git a/third_party/blink/renderer/core/loader/empty_clients.h b/third_party/blink/renderer/core/loader/empty_clients.h
|
|
index 4fa74cc53ddd7557dc5b9e9e6c7ed16214f049b9..cf1e3e898f3b4c9461ed700e0776856689b4c65b 100644
|
|
--- a/third_party/blink/renderer/core/loader/empty_clients.h
|
|
+++ b/third_party/blink/renderer/core/loader/empty_clients.h
|
|
@@ -356,6 +356,8 @@ class CORE_EXPORT EmptyLocalFrameClient : public LocalFrameClient {
|
|
|
|
void DidCreateScriptContext(v8::Local<v8::Context>,
|
|
int32_t world_id) override {}
|
|
+ void DidInstallConditionalFeatures(v8::Local<v8::Context>,
|
|
+ int32_t world_id) override {}
|
|
void WillReleaseScriptContext(v8::Local<v8::Context>,
|
|
int32_t world_id) override {}
|
|
bool AllowScriptExtensions() override { return false; }
|