summaryrefslogtreecommitdiff
path: root/chromium/third_party/blink/renderer/platform/loader/fetch/back_forward_cache_loader_helper.h
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2021-05-20 09:47:09 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2021-06-07 11:15:42 +0000
commit189d4fd8fad9e3c776873be51938cd31a42b6177 (patch)
tree6497caeff5e383937996768766ab3bb2081a40b2 /chromium/third_party/blink/renderer/platform/loader/fetch/back_forward_cache_loader_helper.h
parent8bc75099d364490b22f43a7ce366b366c08f4164 (diff)
downloadqtwebengine-chromium-189d4fd8fad9e3c776873be51938cd31a42b6177.tar.gz
BASELINE: Update Chromium to 90.0.4430.221
Change-Id: Iff4d9d18d2fcf1a576f3b1f453010f744a232920 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/third_party/blink/renderer/platform/loader/fetch/back_forward_cache_loader_helper.h')
-rw-r--r--chromium/third_party/blink/renderer/platform/loader/fetch/back_forward_cache_loader_helper.h43
1 files changed, 43 insertions, 0 deletions
diff --git a/chromium/third_party/blink/renderer/platform/loader/fetch/back_forward_cache_loader_helper.h b/chromium/third_party/blink/renderer/platform/loader/fetch/back_forward_cache_loader_helper.h
new file mode 100644
index 00000000000..ea87bb15a53
--- /dev/null
+++ b/chromium/third_party/blink/renderer/platform/loader/fetch/back_forward_cache_loader_helper.h
@@ -0,0 +1,43 @@
+// Copyright 2021 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef THIRD_PARTY_BLINK_RENDERER_PLATFORM_LOADER_FETCH_BACK_FORWARD_CACHE_LOADER_HELPER_H_
+#define THIRD_PARTY_BLINK_RENDERER_PLATFORM_LOADER_FETCH_BACK_FORWARD_CACHE_LOADER_HELPER_H_
+
+#include "third_party/blink/public/mojom/frame/back_forward_cache_controller.mojom-forward.h"
+#include "third_party/blink/renderer/platform/heap/garbage_collected.h"
+#include "third_party/blink/renderer/platform/heap/heap.h"
+#include "third_party/blink/renderer/platform/heap/member.h"
+#include "third_party/blink/renderer/platform/platform_export.h"
+
+namespace blink {
+
+// Helper class for in-flight network request support for back-forward cache.
+class PLATFORM_EXPORT BackForwardCacheLoaderHelper
+ : public GarbageCollected<BackForwardCacheLoaderHelper> {
+ public:
+ // Evict the page from BackForwardCache. Should be called when handling an
+ // event which can't proceed if the page is in BackForwardCache and can't be
+ // easily deferred to handle later, for example network redirect handling.
+ virtual void EvictFromBackForwardCache(mojom::RendererEvictionReason reason) {
+ }
+
+ // Called when a network request buffered an additional `num_bytes` while the
+ // in back-forward cache. May be called multiple times.
+ virtual void DidBufferLoadWhileInBackForwardCache(size_t num_bytes) {}
+
+ // Returns true if we can still continue buffering data from in-flight network
+ // requests while in back-forward cache.
+ virtual bool CanContinueBufferingWhileInBackForwardCache() const {
+ return false;
+ }
+
+ virtual void Detach() {}
+
+ virtual void Trace(Visitor*) const {}
+};
+
+} // namespace blink
+
+#endif // THIRD_PARTY_BLINK_RENDERER_PLATFORM_LOADER_FETCH_BACK_FORWARD_CACHE_LOADER_HELPER_H_