123456789101112131415161718192021222324252627282930313233343536373839404142 |
- From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
- From: Samuel Attard <[email protected]>
- 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 0f7739eb9fffb85f4e8f51c24715680c5eb991d3..2fc081c117ecfeceecc3acae5208ba3d33be6859 100644
- --- a/third_party/blink/renderer/core/loader/document_loader.h
- +++ b/third_party/blink/renderer/core/loader/document_loader.h
- @@ -324,7 +324,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_; }
-
|