electron/patches/chromium/feat_expose_documentloader_setdefersloading_on_webdocumentloader.patch
trop[bot] e7eb572c21
chore: bump chromium to 132.0.6826.0 (34-x-y) (#44603)
* chore: bump chromium in DEPS to 132.0.6821.0

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>

* chore: bump chromium in DEPS to 132.0.6822.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>

* chore: bump chromium in DEPS to 132.0.6824.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>

* 5998172: Migrate remaining NOTREACHED()s in chrome/ | https://chromium-review.googlesource.com/c/chromium/src/+/5998172

Co-authored-by: Keeley Hammond <khammond@slack-corp.com>

* 5872484: Pass along accelerators for menu items coming from DevTools | https://chromium-review.googlesource.com/c/chromium/src/+/5872484

Co-authored-by: Keeley Hammond <khammond@slack-corp.com>

* chore: update patches

Co-authored-by: Keeley Hammond <khammond@slack-corp.com>

* 5872913: Enable `raw_span` clang plugin [1/2] | https://chromium-review.googlesource.com/c/chromium/src/+/5872913

Co-authored-by: Keeley Hammond <khammond@slack-corp.com>

* fixup! picture-in-picture import

Co-authored-by: Keeley Hammond <khammond@slack-corp.com>

* 5912245: [video pip] Add progress bar to 2024 UI | https://chromium-review.googlesource.com/c/chromium/src/+/5912245

Co-authored-by: Keeley Hammond <khammond@slack-corp.com>

* fixup! 5872913: Enable raw_span clang plugin [1/2] | https://chromium-review.googlesource.com/c/chromium/src/+/5872913

Co-authored-by: Keeley Hammond <khammond@slack-corp.com>

---------

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>
2024-11-09 08:08:26 -06:00

42 lines
2.2 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Samuel Attard <marshallofsound@electronjs.org>
Date: Thu, 9 Mar 2023 01:28:56 -0800
Subject: feat: expose DocumentLoader::SetDefersLoading on WebDocumentLoader
This allows embedders to call SetDefersLoading without reaching into Blink internals. Electron uses this to defer page loading until the preload scripts have finished executing.
This might be upstreamable?
diff --git a/third_party/blink/public/web/web_document_loader.h b/third_party/blink/public/web/web_document_loader.h
index 23b29fe25bc463ff1d36aa502a27c4222595e7c5..c1ac6172c4cee72f64f42ca64d2db9c0f1f48738 100644
--- a/third_party/blink/public/web/web_document_loader.h
+++ b/third_party/blink/public/web/web_document_loader.h
@@ -38,6 +38,7 @@
#include "third_party/blink/public/platform/cross_variant_mojo_util.h"
#include "third_party/blink/public/platform/web_archive_info.h"
#include "third_party/blink/public/platform/web_common.h"
+#include "third_party/blink/public/platform/web_loader_freeze_mode.h"
#include "third_party/blink/public/platform/web_source_location.h"
#include "third_party/blink/public/web/web_navigation_type.h"
@@ -63,6 +64,8 @@ class BLINK_EXPORT WebDocumentLoader {
virtual std::unique_ptr<ExtraData> Clone() = 0;
};
+ virtual void SetDefersLoading(WebLoaderFreezeMode) = 0;
+
static bool WillLoadUrlAsEmpty(const WebURL&);
// Returns the http referrer of original request which initited this load.
diff --git a/third_party/blink/renderer/core/loader/document_loader.h b/third_party/blink/renderer/core/loader/document_loader.h
index 1738bf073ecb7dcb388758cc50148a07626df5ea..fbfc870a21979dacad95a901fb9a7624e18e4a61 100644
--- a/third_party/blink/renderer/core/loader/document_loader.h
+++ b/third_party/blink/renderer/core/loader/document_loader.h
@@ -325,7 +325,7 @@ class CORE_EXPORT DocumentLoader : public GarbageCollected<DocumentLoader>,
std::optional<scheduler::TaskAttributionId>
soft_navigation_heuristics_task_id);
- void SetDefersLoading(LoaderFreezeMode);
+ void SetDefersLoading(LoaderFreezeMode) override;
DocumentLoadTiming& GetTiming() { return document_load_timing_; }