Deprecate ActiveDOMObject::canSuspendForDocumentSuspension()
https://bugs.webkit.org/show_bug.cgi?id=203086
Reviewed by Geoffrey Garen.
Rename ActiveDOMObject::canSuspendForDocumentSuspension() to shouldPreventEnteringBackForwardCache_DEPRECATED()
to make it clear that no new overrides should be added and that it is no longer OK to prevent the page from
entering the back/forward cache. Also provide a default implementation that returns false so that well-behaved
classes no longer need to override this.
* Modules/applepay/ApplePaySession.cpp:
(WebCore::ApplePaySession::shouldPreventEnteringBackForwardCache_DEPRECATED const):
(WebCore::ApplePaySession::canSuspendForDocumentSuspension const): Deleted.
* Modules/applepay/ApplePaySession.h:
* Modules/cache/DOMCache.cpp:
(WebCore::DOMCache::canSuspendForDocumentSuspension const): Deleted.
* Modules/cache/DOMCache.h:
* Modules/cache/DOMCacheStorage.cpp:
(WebCore::DOMCacheStorage::canSuspendForDocumentSuspension const): Deleted.
* Modules/cache/DOMCacheStorage.h:
* Modules/encryptedmedia/MediaKeySession.cpp:
(WebCore::MediaKeySession::shouldPreventEnteringBackForwardCache_DEPRECATED const):
(WebCore::MediaKeySession::canSuspendForDocumentSuspension const): Deleted.
* Modules/encryptedmedia/MediaKeySession.h:
* Modules/encryptedmedia/legacy/WebKitMediaKeySession.cpp:
(WebCore::WebKitMediaKeySession::shouldPreventEnteringBackForwardCache_DEPRECATED const):
(WebCore::WebKitMediaKeySession::canSuspendForDocumentSuspension const): Deleted.
* Modules/encryptedmedia/legacy/WebKitMediaKeySession.h:
* Modules/entriesapi/FileSystemDirectoryReader.cpp:
(WebCore::FileSystemDirectoryReader::shouldPreventEnteringBackForwardCache_DEPRECATED const):
(WebCore::FileSystemDirectoryReader::canSuspendForDocumentSuspension const): Deleted.
* Modules/entriesapi/FileSystemDirectoryReader.h:
* Modules/entriesapi/FileSystemEntry.cpp:
(WebCore::FileSystemEntry::shouldPreventEnteringBackForwardCache_DEPRECATED const):
(WebCore::FileSystemEntry::canSuspendForDocumentSuspension const): Deleted.
* Modules/entriesapi/FileSystemEntry.h:
* Modules/fetch/FetchRequest.cpp:
(WebCore::FetchRequest::shouldPreventEnteringBackForwardCache_DEPRECATED const):
(WebCore::FetchRequest::canSuspendForDocumentSuspension const): Deleted.
* Modules/fetch/FetchRequest.h:
* Modules/fetch/FetchResponse.cpp:
(WebCore::FetchResponse::shouldPreventEnteringBackForwardCache_DEPRECATED const):
(WebCore::FetchResponse::canSuspendForDocumentSuspension const): Deleted.
* Modules/fetch/FetchResponse.h:
* Modules/geolocation/Geolocation.cpp:
(WebCore::Geolocation::page const):
(WebCore::Geolocation::canSuspendForDocumentSuspension const): Deleted.
* Modules/geolocation/Geolocation.h:
* Modules/indexeddb/IDBDatabase.cpp:
(WebCore::IDBDatabase::canSuspendForDocumentSuspension const): Deleted.
* Modules/indexeddb/IDBDatabase.h:
* Modules/indexeddb/IDBIndex.cpp:
(WebCore::IDBIndex::canSuspendForDocumentSuspension const): Deleted.
* Modules/indexeddb/IDBIndex.h:
* Modules/indexeddb/IDBObjectStore.cpp:
(WebCore::IDBObjectStore::canSuspendForDocumentSuspension const): Deleted.
* Modules/indexeddb/IDBObjectStore.h:
* Modules/indexeddb/IDBRequest.cpp:
(WebCore::IDBRequest::canSuspendForDocumentSuspension const): Deleted.
* Modules/indexeddb/IDBRequest.h:
* Modules/indexeddb/IDBTransaction.cpp:
(WebCore::IDBTransaction::canSuspendForDocumentSuspension const): Deleted.
* Modules/indexeddb/IDBTransaction.h:
* Modules/mediarecorder/MediaRecorder.cpp:
(WebCore::MediaRecorder::shouldPreventEnteringBackForwardCache_DEPRECATED const):
(WebCore::MediaRecorder::canSuspendForDocumentSuspension const): Deleted.
* Modules/mediarecorder/MediaRecorder.h:
* Modules/mediasource/MediaSource.cpp:
(WebCore::MediaSource::canSuspendForDocumentSuspension const): Deleted.
* Modules/mediasource/MediaSource.h:
* Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::canSuspendForDocumentSuspension const): Deleted.
* Modules/mediasource/SourceBuffer.h:
* Modules/mediasource/SourceBufferList.cpp:
(WebCore::SourceBufferList::canSuspendForDocumentSuspension const): Deleted.
* Modules/mediasource/SourceBufferList.h:
* Modules/mediastream/MediaDevices.cpp:
(WebCore::MediaDevices::canSuspendForDocumentSuspension const): Deleted.
* Modules/mediastream/MediaDevices.h:
* Modules/mediastream/MediaStream.cpp:
(WebCore::MediaStream::shouldPreventEnteringBackForwardCache_DEPRECATED const):
(WebCore::MediaStream::canSuspendForDocumentSuspension const): Deleted.
* Modules/mediastream/MediaStream.h:
* Modules/mediastream/MediaStreamTrack.cpp:
(WebCore::MediaStreamTrack::shouldPreventEnteringBackForwardCache_DEPRECATED const):
(WebCore::MediaStreamTrack::canSuspendForDocumentSuspension const): Deleted.
* Modules/mediastream/MediaStreamTrack.h:
* Modules/mediastream/RTCDTMFSender.cpp:
(WebCore::RTCDTMFSender::shouldPreventEnteringBackForwardCache_DEPRECATED const):
(WebCore::RTCDTMFSender::canSuspendForDocumentSuspension const): Deleted.
* Modules/mediastream/RTCDTMFSender.h:
* Modules/mediastream/RTCDataChannel.h:
* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::RTCPeerConnection::shouldPreventEnteringBackForwardCache_DEPRECATED const):
(WebCore::RTCPeerConnection::canSuspendForDocumentSuspension const): Deleted.
* Modules/mediastream/RTCPeerConnection.h:
* Modules/mediastream/UserMediaRequest.cpp:
(WebCore::UserMediaRequest::shouldPreventEnteringBackForwardCache_DEPRECATED const):
(WebCore::UserMediaRequest::canSuspendForDocumentSuspension const): Deleted.
* Modules/mediastream/UserMediaRequest.h:
* Modules/notifications/Notification.cpp:
(WebCore::Notification::shouldPreventEnteringBackForwardCache_DEPRECATED const):
(WebCore::Notification::canSuspendForDocumentSuspension const): Deleted.
* Modules/notifications/Notification.h:
* Modules/paymentrequest/PaymentRequest.cpp:
(WebCore::PaymentRequest::shouldPreventEnteringBackForwardCache_DEPRECATED const):
(WebCore::PaymentRequest::canSuspendForDocumentSuspension const): Deleted.
* Modules/paymentrequest/PaymentRequest.h:
* Modules/paymentrequest/PaymentResponse.cpp:
(WebCore::PaymentResponse::shouldPreventEnteringBackForwardCache_DEPRECATED const):
(WebCore::PaymentResponse::canSuspendForDocumentSuspension const): Deleted.
* Modules/paymentrequest/PaymentResponse.h:
* Modules/pictureinpicture/PictureInPictureWindow.cpp:
(WebCore::PictureInPictureWindow::canSuspendForDocumentSuspension const): Deleted.
* Modules/pictureinpicture/PictureInPictureWindow.h:
* Modules/webaudio/AudioContext.cpp:
(WebCore::AudioContext::shouldPreventEnteringBackForwardCache_DEPRECATED const):
(WebCore::AudioContext::canSuspendForDocumentSuspension const): Deleted.
* Modules/webaudio/AudioContext.h:
* Modules/webdatabase/DatabaseContext.cpp:
(WebCore::DatabaseContext::shouldPreventEnteringBackForwardCache_DEPRECATED const):
(WebCore::DatabaseContext::canSuspendForDocumentSuspension const): Deleted.
* Modules/webdatabase/DatabaseContext.h:
* Modules/webgpu/GPUCanvasContext.h:
* Modules/websockets/WebSocket.cpp:
(WebCore::WebSocket::canSuspendForDocumentSuspension const): Deleted.
* Modules/websockets/WebSocket.h:
* Modules/webvr/VRDisplay.cpp:
(WebCore::VRDisplay::shouldPreventEnteringBackForwardCache_DEPRECATED const):
(WebCore::VRDisplay::canSuspendForDocumentSuspension const): Deleted.
* Modules/webvr/VRDisplay.h:
* animation/WebAnimation.cpp:
(WebCore::WebAnimation::shouldPreventEnteringBackForwardCache_DEPRECATED const):
(WebCore::WebAnimation::canSuspendForDocumentSuspension const): Deleted.
* animation/WebAnimation.h:
* css/FontFaceSet.cpp:
(WebCore::FontFaceSet::canSuspendForDocumentSuspension const): Deleted.
* css/FontFaceSet.h:
* dom/ActiveDOMObject.h:
* dom/GenericEventQueue.cpp:
(WebCore::GenericEventQueueBase<T>::canSuspendForDocumentSuspension const): Deleted.
* dom/GenericEventQueue.h:
* dom/MessagePort.cpp:
(WebCore::MessagePort::canSuspendForDocumentSuspension const): Deleted.
* dom/MessagePort.h:
* dom/ScriptExecutionContext.cpp:
(WebCore::ScriptExecutionContext::canSuspendActiveDOMObjectsForDocumentSuspension):
* fileapi/FileReader.cpp:
(WebCore::FileReader::shouldPreventEnteringBackForwardCache_DEPRECATED const):
(WebCore::FileReader::canSuspendForDocumentSuspension const): Deleted.
* fileapi/FileReader.h:
* html/HTMLMarqueeElement.cpp:
(WebCore::HTMLMarqueeElement::canSuspendForDocumentSuspension const): Deleted.
* html/HTMLMarqueeElement.h:
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::canSuspendForDocumentSuspension const): Deleted.
* html/HTMLMediaElement.h:
* html/HTMLSourceElement.cpp:
(WebCore::HTMLSourceElement::canSuspendForDocumentSuspension const): Deleted.
* html/HTMLSourceElement.h:
* html/ImageBitmap.cpp:
* html/PublicURLManager.cpp:
(WebCore::PublicURLManager::canSuspendForDocumentSuspension const): Deleted.
* html/PublicURLManager.h:
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::canSuspendForDocumentSuspension const): Deleted.
* html/canvas/WebGLRenderingContextBase.h:
* html/track/TrackListBase.cpp:
(WebCore::TrackListBase::canSuspendForDocumentSuspension const): Deleted.
* html/track/TrackListBase.h:
* page/EventSource.cpp:
(WebCore::EventSource::canSuspendForDocumentSuspension const): Deleted.
* page/EventSource.h:
* page/IntersectionObserver.cpp:
(WebCore::IntersectionObserver::canSuspendForDocumentSuspension const): Deleted.
* page/IntersectionObserver.h:
* page/ResizeObserver.cpp:
(WebCore::ResizeObserver::canSuspendForDocumentSuspension const): Deleted.
* page/ResizeObserver.h:
* page/SuspendableTimer.cpp:
(WebCore::SuspendableTimerBase::canSuspendForDocumentSuspension const): Deleted.
* page/SuspendableTimer.h:
* platform/SuspendableTaskQueue.cpp:
(WebCore::SuspendableTaskQueue::canSuspendForDocumentSuspension const): Deleted.
* platform/SuspendableTaskQueue.h:
* testing/Internals.cpp:
* workers/Worker.cpp:
(WebCore::Worker::canSuspendForDocumentSuspension const): Deleted.
* workers/Worker.h:
* workers/service/ServiceWorker.cpp:
(WebCore::ServiceWorker::canSuspendForDocumentSuspension const): Deleted.
* workers/service/ServiceWorker.h:
* workers/service/ServiceWorkerContainer.cpp:
(WebCore::ServiceWorkerContainer::canSuspendForDocumentSuspension const): Deleted.
* workers/service/ServiceWorkerContainer.h:
* workers/service/ServiceWorkerRegistration.cpp:
(WebCore::ServiceWorkerRegistration::canSuspendForDocumentSuspension const): Deleted.
* workers/service/ServiceWorkerRegistration.h:
* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::shouldPreventEnteringBackForwardCache_DEPRECATED const):
(WebCore::XMLHttpRequest::canSuspendForDocumentSuspension const): Deleted.
* xml/XMLHttpRequest.h:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@251244 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog
index 11e93bf..4e2c80e 100644
--- a/Source/WebCore/ChangeLog
+++ b/Source/WebCore/ChangeLog
@@ -1,3 +1,208 @@
+2019-10-17 Chris Dumez <cdumez@apple.com>
+
+ Deprecate ActiveDOMObject::canSuspendForDocumentSuspension()
+ https://bugs.webkit.org/show_bug.cgi?id=203086
+
+ Reviewed by Geoffrey Garen.
+
+ Rename ActiveDOMObject::canSuspendForDocumentSuspension() to shouldPreventEnteringBackForwardCache_DEPRECATED()
+ to make it clear that no new overrides should be added and that it is no longer OK to prevent the page from
+ entering the back/forward cache. Also provide a default implementation that returns false so that well-behaved
+ classes no longer need to override this.
+
+ * Modules/applepay/ApplePaySession.cpp:
+ (WebCore::ApplePaySession::shouldPreventEnteringBackForwardCache_DEPRECATED const):
+ (WebCore::ApplePaySession::canSuspendForDocumentSuspension const): Deleted.
+ * Modules/applepay/ApplePaySession.h:
+ * Modules/cache/DOMCache.cpp:
+ (WebCore::DOMCache::canSuspendForDocumentSuspension const): Deleted.
+ * Modules/cache/DOMCache.h:
+ * Modules/cache/DOMCacheStorage.cpp:
+ (WebCore::DOMCacheStorage::canSuspendForDocumentSuspension const): Deleted.
+ * Modules/cache/DOMCacheStorage.h:
+ * Modules/encryptedmedia/MediaKeySession.cpp:
+ (WebCore::MediaKeySession::shouldPreventEnteringBackForwardCache_DEPRECATED const):
+ (WebCore::MediaKeySession::canSuspendForDocumentSuspension const): Deleted.
+ * Modules/encryptedmedia/MediaKeySession.h:
+ * Modules/encryptedmedia/legacy/WebKitMediaKeySession.cpp:
+ (WebCore::WebKitMediaKeySession::shouldPreventEnteringBackForwardCache_DEPRECATED const):
+ (WebCore::WebKitMediaKeySession::canSuspendForDocumentSuspension const): Deleted.
+ * Modules/encryptedmedia/legacy/WebKitMediaKeySession.h:
+ * Modules/entriesapi/FileSystemDirectoryReader.cpp:
+ (WebCore::FileSystemDirectoryReader::shouldPreventEnteringBackForwardCache_DEPRECATED const):
+ (WebCore::FileSystemDirectoryReader::canSuspendForDocumentSuspension const): Deleted.
+ * Modules/entriesapi/FileSystemDirectoryReader.h:
+ * Modules/entriesapi/FileSystemEntry.cpp:
+ (WebCore::FileSystemEntry::shouldPreventEnteringBackForwardCache_DEPRECATED const):
+ (WebCore::FileSystemEntry::canSuspendForDocumentSuspension const): Deleted.
+ * Modules/entriesapi/FileSystemEntry.h:
+ * Modules/fetch/FetchRequest.cpp:
+ (WebCore::FetchRequest::shouldPreventEnteringBackForwardCache_DEPRECATED const):
+ (WebCore::FetchRequest::canSuspendForDocumentSuspension const): Deleted.
+ * Modules/fetch/FetchRequest.h:
+ * Modules/fetch/FetchResponse.cpp:
+ (WebCore::FetchResponse::shouldPreventEnteringBackForwardCache_DEPRECATED const):
+ (WebCore::FetchResponse::canSuspendForDocumentSuspension const): Deleted.
+ * Modules/fetch/FetchResponse.h:
+ * Modules/geolocation/Geolocation.cpp:
+ (WebCore::Geolocation::page const):
+ (WebCore::Geolocation::canSuspendForDocumentSuspension const): Deleted.
+ * Modules/geolocation/Geolocation.h:
+ * Modules/indexeddb/IDBDatabase.cpp:
+ (WebCore::IDBDatabase::canSuspendForDocumentSuspension const): Deleted.
+ * Modules/indexeddb/IDBDatabase.h:
+ * Modules/indexeddb/IDBIndex.cpp:
+ (WebCore::IDBIndex::canSuspendForDocumentSuspension const): Deleted.
+ * Modules/indexeddb/IDBIndex.h:
+ * Modules/indexeddb/IDBObjectStore.cpp:
+ (WebCore::IDBObjectStore::canSuspendForDocumentSuspension const): Deleted.
+ * Modules/indexeddb/IDBObjectStore.h:
+ * Modules/indexeddb/IDBRequest.cpp:
+ (WebCore::IDBRequest::canSuspendForDocumentSuspension const): Deleted.
+ * Modules/indexeddb/IDBRequest.h:
+ * Modules/indexeddb/IDBTransaction.cpp:
+ (WebCore::IDBTransaction::canSuspendForDocumentSuspension const): Deleted.
+ * Modules/indexeddb/IDBTransaction.h:
+ * Modules/mediarecorder/MediaRecorder.cpp:
+ (WebCore::MediaRecorder::shouldPreventEnteringBackForwardCache_DEPRECATED const):
+ (WebCore::MediaRecorder::canSuspendForDocumentSuspension const): Deleted.
+ * Modules/mediarecorder/MediaRecorder.h:
+ * Modules/mediasource/MediaSource.cpp:
+ (WebCore::MediaSource::canSuspendForDocumentSuspension const): Deleted.
+ * Modules/mediasource/MediaSource.h:
+ * Modules/mediasource/SourceBuffer.cpp:
+ (WebCore::SourceBuffer::canSuspendForDocumentSuspension const): Deleted.
+ * Modules/mediasource/SourceBuffer.h:
+ * Modules/mediasource/SourceBufferList.cpp:
+ (WebCore::SourceBufferList::canSuspendForDocumentSuspension const): Deleted.
+ * Modules/mediasource/SourceBufferList.h:
+ * Modules/mediastream/MediaDevices.cpp:
+ (WebCore::MediaDevices::canSuspendForDocumentSuspension const): Deleted.
+ * Modules/mediastream/MediaDevices.h:
+ * Modules/mediastream/MediaStream.cpp:
+ (WebCore::MediaStream::shouldPreventEnteringBackForwardCache_DEPRECATED const):
+ (WebCore::MediaStream::canSuspendForDocumentSuspension const): Deleted.
+ * Modules/mediastream/MediaStream.h:
+ * Modules/mediastream/MediaStreamTrack.cpp:
+ (WebCore::MediaStreamTrack::shouldPreventEnteringBackForwardCache_DEPRECATED const):
+ (WebCore::MediaStreamTrack::canSuspendForDocumentSuspension const): Deleted.
+ * Modules/mediastream/MediaStreamTrack.h:
+ * Modules/mediastream/RTCDTMFSender.cpp:
+ (WebCore::RTCDTMFSender::shouldPreventEnteringBackForwardCache_DEPRECATED const):
+ (WebCore::RTCDTMFSender::canSuspendForDocumentSuspension const): Deleted.
+ * Modules/mediastream/RTCDTMFSender.h:
+ * Modules/mediastream/RTCDataChannel.h:
+ * Modules/mediastream/RTCPeerConnection.cpp:
+ (WebCore::RTCPeerConnection::shouldPreventEnteringBackForwardCache_DEPRECATED const):
+ (WebCore::RTCPeerConnection::canSuspendForDocumentSuspension const): Deleted.
+ * Modules/mediastream/RTCPeerConnection.h:
+ * Modules/mediastream/UserMediaRequest.cpp:
+ (WebCore::UserMediaRequest::shouldPreventEnteringBackForwardCache_DEPRECATED const):
+ (WebCore::UserMediaRequest::canSuspendForDocumentSuspension const): Deleted.
+ * Modules/mediastream/UserMediaRequest.h:
+ * Modules/notifications/Notification.cpp:
+ (WebCore::Notification::shouldPreventEnteringBackForwardCache_DEPRECATED const):
+ (WebCore::Notification::canSuspendForDocumentSuspension const): Deleted.
+ * Modules/notifications/Notification.h:
+ * Modules/paymentrequest/PaymentRequest.cpp:
+ (WebCore::PaymentRequest::shouldPreventEnteringBackForwardCache_DEPRECATED const):
+ (WebCore::PaymentRequest::canSuspendForDocumentSuspension const): Deleted.
+ * Modules/paymentrequest/PaymentRequest.h:
+ * Modules/paymentrequest/PaymentResponse.cpp:
+ (WebCore::PaymentResponse::shouldPreventEnteringBackForwardCache_DEPRECATED const):
+ (WebCore::PaymentResponse::canSuspendForDocumentSuspension const): Deleted.
+ * Modules/paymentrequest/PaymentResponse.h:
+ * Modules/pictureinpicture/PictureInPictureWindow.cpp:
+ (WebCore::PictureInPictureWindow::canSuspendForDocumentSuspension const): Deleted.
+ * Modules/pictureinpicture/PictureInPictureWindow.h:
+ * Modules/webaudio/AudioContext.cpp:
+ (WebCore::AudioContext::shouldPreventEnteringBackForwardCache_DEPRECATED const):
+ (WebCore::AudioContext::canSuspendForDocumentSuspension const): Deleted.
+ * Modules/webaudio/AudioContext.h:
+ * Modules/webdatabase/DatabaseContext.cpp:
+ (WebCore::DatabaseContext::shouldPreventEnteringBackForwardCache_DEPRECATED const):
+ (WebCore::DatabaseContext::canSuspendForDocumentSuspension const): Deleted.
+ * Modules/webdatabase/DatabaseContext.h:
+ * Modules/webgpu/GPUCanvasContext.h:
+ * Modules/websockets/WebSocket.cpp:
+ (WebCore::WebSocket::canSuspendForDocumentSuspension const): Deleted.
+ * Modules/websockets/WebSocket.h:
+ * Modules/webvr/VRDisplay.cpp:
+ (WebCore::VRDisplay::shouldPreventEnteringBackForwardCache_DEPRECATED const):
+ (WebCore::VRDisplay::canSuspendForDocumentSuspension const): Deleted.
+ * Modules/webvr/VRDisplay.h:
+ * animation/WebAnimation.cpp:
+ (WebCore::WebAnimation::shouldPreventEnteringBackForwardCache_DEPRECATED const):
+ (WebCore::WebAnimation::canSuspendForDocumentSuspension const): Deleted.
+ * animation/WebAnimation.h:
+ * css/FontFaceSet.cpp:
+ (WebCore::FontFaceSet::canSuspendForDocumentSuspension const): Deleted.
+ * css/FontFaceSet.h:
+ * dom/ActiveDOMObject.h:
+ * dom/GenericEventQueue.cpp:
+ (WebCore::GenericEventQueueBase<T>::canSuspendForDocumentSuspension const): Deleted.
+ * dom/GenericEventQueue.h:
+ * dom/MessagePort.cpp:
+ (WebCore::MessagePort::canSuspendForDocumentSuspension const): Deleted.
+ * dom/MessagePort.h:
+ * dom/ScriptExecutionContext.cpp:
+ (WebCore::ScriptExecutionContext::canSuspendActiveDOMObjectsForDocumentSuspension):
+ * fileapi/FileReader.cpp:
+ (WebCore::FileReader::shouldPreventEnteringBackForwardCache_DEPRECATED const):
+ (WebCore::FileReader::canSuspendForDocumentSuspension const): Deleted.
+ * fileapi/FileReader.h:
+ * html/HTMLMarqueeElement.cpp:
+ (WebCore::HTMLMarqueeElement::canSuspendForDocumentSuspension const): Deleted.
+ * html/HTMLMarqueeElement.h:
+ * html/HTMLMediaElement.cpp:
+ (WebCore::HTMLMediaElement::canSuspendForDocumentSuspension const): Deleted.
+ * html/HTMLMediaElement.h:
+ * html/HTMLSourceElement.cpp:
+ (WebCore::HTMLSourceElement::canSuspendForDocumentSuspension const): Deleted.
+ * html/HTMLSourceElement.h:
+ * html/ImageBitmap.cpp:
+ * html/PublicURLManager.cpp:
+ (WebCore::PublicURLManager::canSuspendForDocumentSuspension const): Deleted.
+ * html/PublicURLManager.h:
+ * html/canvas/WebGLRenderingContextBase.cpp:
+ (WebCore::WebGLRenderingContextBase::canSuspendForDocumentSuspension const): Deleted.
+ * html/canvas/WebGLRenderingContextBase.h:
+ * html/track/TrackListBase.cpp:
+ (WebCore::TrackListBase::canSuspendForDocumentSuspension const): Deleted.
+ * html/track/TrackListBase.h:
+ * page/EventSource.cpp:
+ (WebCore::EventSource::canSuspendForDocumentSuspension const): Deleted.
+ * page/EventSource.h:
+ * page/IntersectionObserver.cpp:
+ (WebCore::IntersectionObserver::canSuspendForDocumentSuspension const): Deleted.
+ * page/IntersectionObserver.h:
+ * page/ResizeObserver.cpp:
+ (WebCore::ResizeObserver::canSuspendForDocumentSuspension const): Deleted.
+ * page/ResizeObserver.h:
+ * page/SuspendableTimer.cpp:
+ (WebCore::SuspendableTimerBase::canSuspendForDocumentSuspension const): Deleted.
+ * page/SuspendableTimer.h:
+ * platform/SuspendableTaskQueue.cpp:
+ (WebCore::SuspendableTaskQueue::canSuspendForDocumentSuspension const): Deleted.
+ * platform/SuspendableTaskQueue.h:
+ * testing/Internals.cpp:
+ * workers/Worker.cpp:
+ (WebCore::Worker::canSuspendForDocumentSuspension const): Deleted.
+ * workers/Worker.h:
+ * workers/service/ServiceWorker.cpp:
+ (WebCore::ServiceWorker::canSuspendForDocumentSuspension const): Deleted.
+ * workers/service/ServiceWorker.h:
+ * workers/service/ServiceWorkerContainer.cpp:
+ (WebCore::ServiceWorkerContainer::canSuspendForDocumentSuspension const): Deleted.
+ * workers/service/ServiceWorkerContainer.h:
+ * workers/service/ServiceWorkerRegistration.cpp:
+ (WebCore::ServiceWorkerRegistration::canSuspendForDocumentSuspension const): Deleted.
+ * workers/service/ServiceWorkerRegistration.h:
+ * xml/XMLHttpRequest.cpp:
+ (WebCore::XMLHttpRequest::shouldPreventEnteringBackForwardCache_DEPRECATED const):
+ (WebCore::XMLHttpRequest::canSuspendForDocumentSuspension const): Deleted.
+ * xml/XMLHttpRequest.h:
+
2019-10-17 Zalan Bujtas <zalan@apple.com>
[LFC][TFC] Table formatting context accesses geometry information from parent BFC
diff --git a/Source/WebCore/Modules/applepay/ApplePaySession.cpp b/Source/WebCore/Modules/applepay/ApplePaySession.cpp
index 69f8e32..18fd97b 100644
--- a/Source/WebCore/Modules/applepay/ApplePaySession.cpp
+++ b/Source/WebCore/Modules/applepay/ApplePaySession.cpp
@@ -823,14 +823,14 @@
return "ApplePaySession";
}
-bool ApplePaySession::canSuspendForDocumentSuspension() const
+bool ApplePaySession::shouldPreventEnteringBackForwardCache_DEPRECATED() const
{
switch (m_state) {
case State::Idle:
case State::Aborted:
case State::Completed:
case State::Canceled:
- return true;
+ return false;
case State::Active:
case State::Authorized:
@@ -838,7 +838,8 @@
case State::ShippingContactSelected:
case State::PaymentMethodSelected:
case State::CancelRequested:
- return false;
+ // FIXME: This should never prevent entering the back/forward cache.
+ return true;
}
}
diff --git a/Source/WebCore/Modules/applepay/ApplePaySession.h b/Source/WebCore/Modules/applepay/ApplePaySession.h
index 3a92507..4e343b1 100644
--- a/Source/WebCore/Modules/applepay/ApplePaySession.h
+++ b/Source/WebCore/Modules/applepay/ApplePaySession.h
@@ -102,7 +102,7 @@
// ActiveDOMObject.
const char* activeDOMObjectName() const override;
- bool canSuspendForDocumentSuspension() const override;
+ bool shouldPreventEnteringBackForwardCache_DEPRECATED() const override;
void stop() override;
// EventTargetWithInlineData.
diff --git a/Source/WebCore/Modules/cache/DOMCache.cpp b/Source/WebCore/Modules/cache/DOMCache.cpp
index b9f935b..eaf06a2 100644
--- a/Source/WebCore/Modules/cache/DOMCache.cpp
+++ b/Source/WebCore/Modules/cache/DOMCache.cpp
@@ -608,11 +608,6 @@
return "Cache";
}
-bool DOMCache::canSuspendForDocumentSuspension() const
-{
- return true;
-}
-
bool DOMCache::hasPendingActivity() const
{
return m_taskQueue->hasPendingTasks() || ActiveDOMObject::hasPendingActivity();
diff --git a/Source/WebCore/Modules/cache/DOMCache.h b/Source/WebCore/Modules/cache/DOMCache.h
index 4dc03ca..d16f822 100644
--- a/Source/WebCore/Modules/cache/DOMCache.h
+++ b/Source/WebCore/Modules/cache/DOMCache.h
@@ -74,7 +74,6 @@
// ActiveDOMObject
void stop() final;
const char* activeDOMObjectName() const final;
- bool canSuspendForDocumentSuspension() const final;
void putWithResponseData(DOMPromiseDeferred<void>&&, Ref<FetchRequest>&&, Ref<FetchResponse>&&, ExceptionOr<RefPtr<SharedBuffer>>&&);
diff --git a/Source/WebCore/Modules/cache/DOMCacheStorage.cpp b/Source/WebCore/Modules/cache/DOMCacheStorage.cpp
index 56f813f..54eee7b 100644
--- a/Source/WebCore/Modules/cache/DOMCacheStorage.cpp
+++ b/Source/WebCore/Modules/cache/DOMCacheStorage.cpp
@@ -288,11 +288,6 @@
return "CacheStorage";
}
-bool DOMCacheStorage::canSuspendForDocumentSuspension() const
-{
- return true;
-}
-
bool DOMCacheStorage::hasPendingActivity() const
{
return m_taskQueue->hasPendingTasks() || ActiveDOMObject::hasPendingActivity();
diff --git a/Source/WebCore/Modules/cache/DOMCacheStorage.h b/Source/WebCore/Modules/cache/DOMCacheStorage.h
index 66e88b3..b230eee 100644
--- a/Source/WebCore/Modules/cache/DOMCacheStorage.h
+++ b/Source/WebCore/Modules/cache/DOMCacheStorage.h
@@ -56,7 +56,6 @@
// ActiveDOMObject
void stop() final;
const char* activeDOMObjectName() const final;
- bool canSuspendForDocumentSuspension() const final;
void doOpen(const String& name, DOMPromiseDeferred<IDLInterface<DOMCache>>&&);
void doRemove(const String&, DOMPromiseDeferred<IDLBoolean>&&);
diff --git a/Source/WebCore/Modules/encryptedmedia/MediaKeySession.cpp b/Source/WebCore/Modules/encryptedmedia/MediaKeySession.cpp
index 96602ed..88c8aea 100644
--- a/Source/WebCore/Modules/encryptedmedia/MediaKeySession.cpp
+++ b/Source/WebCore/Modules/encryptedmedia/MediaKeySession.cpp
@@ -743,10 +743,11 @@
return "MediaKeySession";
}
-bool MediaKeySession::canSuspendForDocumentSuspension() const
+// FIXME: This should never prevent entering the back/forward cache.
+bool MediaKeySession::shouldPreventEnteringBackForwardCache_DEPRECATED() const
{
notImplemented();
- return false;
+ return true;
}
void MediaKeySession::stop()
diff --git a/Source/WebCore/Modules/encryptedmedia/MediaKeySession.h b/Source/WebCore/Modules/encryptedmedia/MediaKeySession.h
index c4795d8..aeb5c22 100644
--- a/Source/WebCore/Modules/encryptedmedia/MediaKeySession.h
+++ b/Source/WebCore/Modules/encryptedmedia/MediaKeySession.h
@@ -104,7 +104,7 @@
// ActiveDOMObject
const char* activeDOMObjectName() const override;
- bool canSuspendForDocumentSuspension() const override;
+ bool shouldPreventEnteringBackForwardCache_DEPRECATED() const override;
void stop() override;
WeakPtr<MediaKeys> m_keys;
diff --git a/Source/WebCore/Modules/encryptedmedia/legacy/WebKitMediaKeySession.cpp b/Source/WebCore/Modules/encryptedmedia/legacy/WebKitMediaKeySession.cpp
index 9e93c7b..8ddef257d 100644
--- a/Source/WebCore/Modules/encryptedmedia/legacy/WebKitMediaKeySession.cpp
+++ b/Source/WebCore/Modules/encryptedmedia/legacy/WebKitMediaKeySession.cpp
@@ -251,10 +251,10 @@
return "WebKitMediaKeySession";
}
-bool WebKitMediaKeySession::canSuspendForDocumentSuspension() const
+bool WebKitMediaKeySession::shouldPreventEnteringBackForwardCache_DEPRECATED() const
{
- // FIXME: We should try and do better here.
- return false;
+ // FIXME: This should never prevent entering the back/forward cache.
+ return true;
}
}
diff --git a/Source/WebCore/Modules/encryptedmedia/legacy/WebKitMediaKeySession.h b/Source/WebCore/Modules/encryptedmedia/legacy/WebKitMediaKeySession.h
index 4233ace..cfdeb24 100644
--- a/Source/WebCore/Modules/encryptedmedia/legacy/WebKitMediaKeySession.h
+++ b/Source/WebCore/Modules/encryptedmedia/legacy/WebKitMediaKeySession.h
@@ -78,7 +78,7 @@
void derefEventTarget() final { deref(); }
void stop() final;
- bool canSuspendForDocumentSuspension() const final;
+ bool shouldPreventEnteringBackForwardCache_DEPRECATED() const final;
const char* activeDOMObjectName() const final;
EventTargetInterface eventTargetInterface() const final { return WebKitMediaKeySessionEventTargetInterfaceType; }
diff --git a/Source/WebCore/Modules/entriesapi/FileSystemDirectoryReader.cpp b/Source/WebCore/Modules/entriesapi/FileSystemDirectoryReader.cpp
index df8f393..63aa0fe 100644
--- a/Source/WebCore/Modules/entriesapi/FileSystemDirectoryReader.cpp
+++ b/Source/WebCore/Modules/entriesapi/FileSystemDirectoryReader.cpp
@@ -53,9 +53,10 @@
return "FileSystemDirectoryReader";
}
-bool FileSystemDirectoryReader::canSuspendForDocumentSuspension() const
+// FIXME: This should never prevent entering the back/forward cache.
+bool FileSystemDirectoryReader::shouldPreventEnteringBackForwardCache_DEPRECATED() const
{
- return !hasPendingActivity();
+ return hasPendingActivity();
}
// https://wicg.github.io/entries-api/#dom-filesystemdirectoryentry-readentries
diff --git a/Source/WebCore/Modules/entriesapi/FileSystemDirectoryReader.h b/Source/WebCore/Modules/entriesapi/FileSystemDirectoryReader.h
index fcc4919..b900de7 100644
--- a/Source/WebCore/Modules/entriesapi/FileSystemDirectoryReader.h
+++ b/Source/WebCore/Modules/entriesapi/FileSystemDirectoryReader.h
@@ -54,7 +54,7 @@
FileSystemDirectoryReader(ScriptExecutionContext&, FileSystemDirectoryEntry&);
const char* activeDOMObjectName() const final;
- bool canSuspendForDocumentSuspension() const final;
+ bool shouldPreventEnteringBackForwardCache_DEPRECATED() const final;
Ref<FileSystemDirectoryEntry> m_directory;
Optional<Exception> m_error;
diff --git a/Source/WebCore/Modules/entriesapi/FileSystemEntry.cpp b/Source/WebCore/Modules/entriesapi/FileSystemEntry.cpp
index 3c5c4f9..d2516a3 100644
--- a/Source/WebCore/Modules/entriesapi/FileSystemEntry.cpp
+++ b/Source/WebCore/Modules/entriesapi/FileSystemEntry.cpp
@@ -60,9 +60,10 @@
return "FileSystemEntry";
}
-bool FileSystemEntry::canSuspendForDocumentSuspension() const
+// FIXME: This should never prevent entering the back/forward cache.
+bool FileSystemEntry::shouldPreventEnteringBackForwardCache_DEPRECATED() const
{
- return !hasPendingActivity();
+ return hasPendingActivity();
}
void FileSystemEntry::getParent(ScriptExecutionContext& context, RefPtr<FileSystemEntryCallback>&& successCallback, RefPtr<ErrorCallback>&& errorCallback)
diff --git a/Source/WebCore/Modules/entriesapi/FileSystemEntry.h b/Source/WebCore/Modules/entriesapi/FileSystemEntry.h
index c12f327..d9763ef 100644
--- a/Source/WebCore/Modules/entriesapi/FileSystemEntry.h
+++ b/Source/WebCore/Modules/entriesapi/FileSystemEntry.h
@@ -55,7 +55,7 @@
private:
const char* activeDOMObjectName() const final;
- bool canSuspendForDocumentSuspension() const final;
+ bool shouldPreventEnteringBackForwardCache_DEPRECATED() const final;
Ref<DOMFileSystem> m_filesystem;
String m_name;
diff --git a/Source/WebCore/Modules/fetch/FetchRequest.cpp b/Source/WebCore/Modules/fetch/FetchRequest.cpp
index 291d29b..4a9e7e3 100644
--- a/Source/WebCore/Modules/fetch/FetchRequest.cpp
+++ b/Source/WebCore/Modules/fetch/FetchRequest.cpp
@@ -329,10 +329,10 @@
return "Request";
}
-bool FetchRequest::canSuspendForDocumentSuspension() const
+bool FetchRequest::shouldPreventEnteringBackForwardCache_DEPRECATED() const
{
- // FIXME: We can probably do the same strategy as XHR.
- return !isActive();
+ // FIXME: This should never prevent entering the back/forward cache.
+ return isActive();
}
} // namespace WebCore
diff --git a/Source/WebCore/Modules/fetch/FetchRequest.h b/Source/WebCore/Modules/fetch/FetchRequest.h
index e85d134..b7f1636 100644
--- a/Source/WebCore/Modules/fetch/FetchRequest.h
+++ b/Source/WebCore/Modules/fetch/FetchRequest.h
@@ -92,7 +92,7 @@
ExceptionOr<void> setBody(FetchRequest&);
const char* activeDOMObjectName() const final;
- bool canSuspendForDocumentSuspension() const final;
+ bool shouldPreventEnteringBackForwardCache_DEPRECATED() const final;
ResourceRequest m_request;
FetchOptions m_options;
diff --git a/Source/WebCore/Modules/fetch/FetchResponse.cpp b/Source/WebCore/Modules/fetch/FetchResponse.cpp
index d75e8eb..eb0ce44 100644
--- a/Source/WebCore/Modules/fetch/FetchResponse.cpp
+++ b/Source/WebCore/Modules/fetch/FetchResponse.cpp
@@ -536,10 +536,10 @@
return "Response";
}
-bool FetchResponse::canSuspendForDocumentSuspension() const
+bool FetchResponse::shouldPreventEnteringBackForwardCache_DEPRECATED() const
{
- // FIXME: We can probably do the same strategy as XHR.
- return !isActive();
+ // FIXME: This should never prevent entering the back/forward cache.
+ return isActive();
}
ResourceResponse FetchResponse::resourceResponse() const
diff --git a/Source/WebCore/Modules/fetch/FetchResponse.h b/Source/WebCore/Modules/fetch/FetchResponse.h
index f2407ff..b9a4a065 100644
--- a/Source/WebCore/Modules/fetch/FetchResponse.h
+++ b/Source/WebCore/Modules/fetch/FetchResponse.h
@@ -118,7 +118,7 @@
void stop() final;
const char* activeDOMObjectName() const final;
- bool canSuspendForDocumentSuspension() const final;
+ bool shouldPreventEnteringBackForwardCache_DEPRECATED() const final;
const ResourceResponse& filteredResponse() const;
diff --git a/Source/WebCore/Modules/geolocation/Geolocation.cpp b/Source/WebCore/Modules/geolocation/Geolocation.cpp
index acdaf79..a256d2f 100644
--- a/Source/WebCore/Modules/geolocation/Geolocation.cpp
+++ b/Source/WebCore/Modules/geolocation/Geolocation.cpp
@@ -157,11 +157,6 @@
{
return document() ? document()->page() : nullptr;
}
-
-bool Geolocation::canSuspendForDocumentSuspension() const
-{
- return true;
-}
void Geolocation::suspend(ReasonForSuspension reason)
{
diff --git a/Source/WebCore/Modules/geolocation/Geolocation.h b/Source/WebCore/Modules/geolocation/Geolocation.h
index 536ee41..ad2d369 100644
--- a/Source/WebCore/Modules/geolocation/Geolocation.h
+++ b/Source/WebCore/Modules/geolocation/Geolocation.h
@@ -83,7 +83,6 @@
// ActiveDOMObject
void stop() override;
- bool canSuspendForDocumentSuspension() const override;
void suspend(ReasonForSuspension) override;
void resume() override;
const char* activeDOMObjectName() const override;
diff --git a/Source/WebCore/Modules/indexeddb/IDBDatabase.cpp b/Source/WebCore/Modules/indexeddb/IDBDatabase.cpp
index 0c7ac17..c663f87 100644
--- a/Source/WebCore/Modules/indexeddb/IDBDatabase.cpp
+++ b/Source/WebCore/Modules/indexeddb/IDBDatabase.cpp
@@ -313,15 +313,6 @@
return "IDBDatabase";
}
-bool IDBDatabase::canSuspendForDocumentSuspension() const
-{
- ASSERT(&originThread() == &Thread::current());
-
- // FIXME: This value will sometimes be false when database operations are actually in progress.
- // Such database operations do not yet exist.
- return true;
-}
-
void IDBDatabase::stop()
{
LOG(IndexedDB, "IDBDatabase::stop - %" PRIu64, m_databaseConnectionIdentifier);
diff --git a/Source/WebCore/Modules/indexeddb/IDBDatabase.h b/Source/WebCore/Modules/indexeddb/IDBDatabase.h
index 533d34a..bfa0f4d 100644
--- a/Source/WebCore/Modules/indexeddb/IDBDatabase.h
+++ b/Source/WebCore/Modules/indexeddb/IDBDatabase.h
@@ -82,7 +82,6 @@
using ThreadSafeRefCounted<IDBDatabase>::deref;
const char* activeDOMObjectName() const final;
- bool canSuspendForDocumentSuspension() const final;
void stop() final;
const IDBDatabaseInfo& info() const { return m_info; }
diff --git a/Source/WebCore/Modules/indexeddb/IDBIndex.cpp b/Source/WebCore/Modules/indexeddb/IDBIndex.cpp
index 4a7f66e..d7d5930 100644
--- a/Source/WebCore/Modules/indexeddb/IDBIndex.cpp
+++ b/Source/WebCore/Modules/indexeddb/IDBIndex.cpp
@@ -62,11 +62,6 @@
return "IDBIndex";
}
-bool IDBIndex::canSuspendForDocumentSuspension() const
-{
- return true;
-}
-
bool IDBIndex::hasPendingActivity() const
{
return m_objectStore.hasPendingActivity();
diff --git a/Source/WebCore/Modules/indexeddb/IDBIndex.h b/Source/WebCore/Modules/indexeddb/IDBIndex.h
index f83c1f1..cf27c06 100644
--- a/Source/WebCore/Modules/indexeddb/IDBIndex.h
+++ b/Source/WebCore/Modules/indexeddb/IDBIndex.h
@@ -99,7 +99,6 @@
ExceptionOr<Ref<IDBRequest>> doGetAllKeys(JSC::ExecState&, Optional<uint32_t> count, WTF::Function<ExceptionOr<RefPtr<IDBKeyRange>>()> &&);
const char* activeDOMObjectName() const final;
- bool canSuspendForDocumentSuspension() const final;
IDBIndexInfo m_info;
IDBIndexInfo m_originalInfo;
diff --git a/Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp b/Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp
index a597ac1..7dc2740 100644
--- a/Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp
+++ b/Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp
@@ -75,11 +75,6 @@
return "IDBObjectStore";
}
-bool IDBObjectStore::canSuspendForDocumentSuspension() const
-{
- return true;
-}
-
bool IDBObjectStore::hasPendingActivity() const
{
return m_transaction.hasPendingActivity();
diff --git a/Source/WebCore/Modules/indexeddb/IDBObjectStore.h b/Source/WebCore/Modules/indexeddb/IDBObjectStore.h
index d342563..b1caf5e 100644
--- a/Source/WebCore/Modules/indexeddb/IDBObjectStore.h
+++ b/Source/WebCore/Modules/indexeddb/IDBObjectStore.h
@@ -125,7 +125,6 @@
ExceptionOr<Ref<IDBRequest>> doGetAllKeys(JSC::ExecState&, Optional<uint32_t> count, WTF::Function<ExceptionOr<RefPtr<IDBKeyRange>>()> &&);
const char* activeDOMObjectName() const final;
- bool canSuspendForDocumentSuspension() const final;
IDBObjectStoreInfo m_info;
IDBObjectStoreInfo m_originalInfo;
diff --git a/Source/WebCore/Modules/indexeddb/IDBRequest.cpp b/Source/WebCore/Modules/indexeddb/IDBRequest.cpp
index a2461fc..d81a056 100644
--- a/Source/WebCore/Modules/indexeddb/IDBRequest.cpp
+++ b/Source/WebCore/Modules/indexeddb/IDBRequest.cpp
@@ -259,12 +259,6 @@
return "IDBRequest";
}
-bool IDBRequest::canSuspendForDocumentSuspension() const
-{
- ASSERT(&originThread() == &Thread::current());
- return true;
-}
-
bool IDBRequest::hasPendingActivity() const
{
ASSERT(&originThread() == &Thread::current() || Thread::mayBeGCThread());
diff --git a/Source/WebCore/Modules/indexeddb/IDBRequest.h b/Source/WebCore/Modules/indexeddb/IDBRequest.h
index 2a0744b..278501b 100644
--- a/Source/WebCore/Modules/indexeddb/IDBRequest.h
+++ b/Source/WebCore/Modules/indexeddb/IDBRequest.h
@@ -157,7 +157,6 @@
EventTargetInterface eventTargetInterface() const override;
const char* activeDOMObjectName() const final;
- bool canSuspendForDocumentSuspension() const final;
void stop() final;
virtual void cancelForStop();
diff --git a/Source/WebCore/Modules/indexeddb/IDBTransaction.cpp b/Source/WebCore/Modules/indexeddb/IDBTransaction.cpp
index f08c2ea..64e1e89 100644
--- a/Source/WebCore/Modules/indexeddb/IDBTransaction.cpp
+++ b/Source/WebCore/Modules/indexeddb/IDBTransaction.cpp
@@ -323,12 +323,6 @@
return "IDBTransaction";
}
-bool IDBTransaction::canSuspendForDocumentSuspension() const
-{
- ASSERT(&m_database->originThread() == &Thread::current());
- return true;
-}
-
bool IDBTransaction::hasPendingActivity() const
{
ASSERT(&m_database->originThread() == &Thread::current() || Thread::mayBeGCThread());
diff --git a/Source/WebCore/Modules/indexeddb/IDBTransaction.h b/Source/WebCore/Modules/indexeddb/IDBTransaction.h
index 3e68407..179e15b 100644
--- a/Source/WebCore/Modules/indexeddb/IDBTransaction.h
+++ b/Source/WebCore/Modules/indexeddb/IDBTransaction.h
@@ -92,7 +92,6 @@
using ThreadSafeRefCounted<IDBTransaction>::deref;
const char* activeDOMObjectName() const final;
- bool canSuspendForDocumentSuspension() const final;
bool hasPendingActivity() const final;
void stop() final;
diff --git a/Source/WebCore/Modules/mediarecorder/MediaRecorder.cpp b/Source/WebCore/Modules/mediarecorder/MediaRecorder.cpp
index 6c16fbc..bc665ae 100644
--- a/Source/WebCore/Modules/mediarecorder/MediaRecorder.cpp
+++ b/Source/WebCore/Modules/mediarecorder/MediaRecorder.cpp
@@ -104,9 +104,9 @@
return "MediaRecorder";
}
-bool MediaRecorder::canSuspendForDocumentSuspension() const
+bool MediaRecorder::shouldPreventEnteringBackForwardCache_DEPRECATED() const
{
- return false; // FIXME: We should do better here as this prevents entering BackForwardCache.
+ return true; // FIXME: We should do better here as this prevents entering BackForwardCache.
}
ExceptionOr<void> MediaRecorder::startRecording(Optional<int> timeslice)
diff --git a/Source/WebCore/Modules/mediarecorder/MediaRecorder.h b/Source/WebCore/Modules/mediarecorder/MediaRecorder.h
index 5ff5d82..8496f5a 100644
--- a/Source/WebCore/Modules/mediarecorder/MediaRecorder.h
+++ b/Source/WebCore/Modules/mediarecorder/MediaRecorder.h
@@ -88,7 +88,7 @@
// ActiveDOMObject API.
void stop() final;
const char* activeDOMObjectName() const final;
- bool canSuspendForDocumentSuspension() const final;
+ bool shouldPreventEnteringBackForwardCache_DEPRECATED() const final;
void stopRecordingInternal();
diff --git a/Source/WebCore/Modules/mediasource/MediaSource.cpp b/Source/WebCore/Modules/mediasource/MediaSource.cpp
index 8edd77c..f4558c7 100644
--- a/Source/WebCore/Modules/mediasource/MediaSource.cpp
+++ b/Source/WebCore/Modules/mediasource/MediaSource.cpp
@@ -987,11 +987,6 @@
m_private = nullptr;
}
-bool MediaSource::canSuspendForDocumentSuspension() const
-{
- return true;
-}
-
const char* MediaSource::activeDOMObjectName() const
{
return "MediaSource";
diff --git a/Source/WebCore/Modules/mediasource/MediaSource.h b/Source/WebCore/Modules/mediasource/MediaSource.h
index 8a1efca..9278d7a 100644
--- a/Source/WebCore/Modules/mediasource/MediaSource.h
+++ b/Source/WebCore/Modules/mediasource/MediaSource.h
@@ -127,7 +127,6 @@
explicit MediaSource(ScriptExecutionContext&);
void stop() final;
- bool canSuspendForDocumentSuspension() const final;
const char* activeDOMObjectName() const final;
void setPrivateAndOpen(Ref<MediaSourcePrivate>&&) final;
diff --git a/Source/WebCore/Modules/mediasource/SourceBuffer.cpp b/Source/WebCore/Modules/mediasource/SourceBuffer.cpp
index 03368ee..9e287e5 100644
--- a/Source/WebCore/Modules/mediasource/SourceBuffer.cpp
+++ b/Source/WebCore/Modules/mediasource/SourceBuffer.cpp
@@ -538,11 +538,6 @@
m_removeTimer.stop();
}
-bool SourceBuffer::canSuspendForDocumentSuspension() const
-{
- return true;
-}
-
const char* SourceBuffer::activeDOMObjectName() const
{
return "SourceBuffer";
diff --git a/Source/WebCore/Modules/mediasource/SourceBuffer.h b/Source/WebCore/Modules/mediasource/SourceBuffer.h
index 7d95122..119ffc8 100644
--- a/Source/WebCore/Modules/mediasource/SourceBuffer.h
+++ b/Source/WebCore/Modules/mediasource/SourceBuffer.h
@@ -149,7 +149,6 @@
void stop() final;
const char* activeDOMObjectName() const final;
- bool canSuspendForDocumentSuspension() const final;
void sourceBufferPrivateDidReceiveInitializationSegment(const InitializationSegment&) final;
void sourceBufferPrivateDidReceiveSample(MediaSample&) final;
diff --git a/Source/WebCore/Modules/mediasource/SourceBufferList.cpp b/Source/WebCore/Modules/mediasource/SourceBufferList.cpp
index 49a7c3b..2c478c5 100644
--- a/Source/WebCore/Modules/mediasource/SourceBufferList.cpp
+++ b/Source/WebCore/Modules/mediasource/SourceBufferList.cpp
@@ -101,11 +101,6 @@
m_asyncEventQueue->enqueueEvent(WTFMove(event));
}
-bool SourceBufferList::canSuspendForDocumentSuspension() const
-{
- return true;
-}
-
const char* SourceBufferList::activeDOMObjectName() const
{
return "SourceBufferList";
diff --git a/Source/WebCore/Modules/mediasource/SourceBufferList.h b/Source/WebCore/Modules/mediasource/SourceBufferList.h
index b41003a..9c8aaa2 100644
--- a/Source/WebCore/Modules/mediasource/SourceBufferList.h
+++ b/Source/WebCore/Modules/mediasource/SourceBufferList.h
@@ -78,7 +78,6 @@
void refEventTarget() override { ref(); }
void derefEventTarget() override { deref(); }
- bool canSuspendForDocumentSuspension() const final;
const char* activeDOMObjectName() const final;
UniqueRef<MainThreadGenericEventQueue> m_asyncEventQueue;
diff --git a/Source/WebCore/Modules/mediastream/MediaDevices.cpp b/Source/WebCore/Modules/mediastream/MediaDevices.cpp
index 06f1754..31b4565 100644
--- a/Source/WebCore/Modules/mediastream/MediaDevices.cpp
+++ b/Source/WebCore/Modules/mediastream/MediaDevices.cpp
@@ -219,11 +219,6 @@
return "MediaDevices";
}
-bool MediaDevices::canSuspendForDocumentSuspension() const
-{
- return true;
-}
-
void MediaDevices::listenForDeviceChanges()
{
if (m_listeningForDeviceChanges || (!m_canAccessCamera && !m_canAccessMicrophone))
diff --git a/Source/WebCore/Modules/mediastream/MediaDevices.h b/Source/WebCore/Modules/mediastream/MediaDevices.h
index e54c5b3..5395eb8 100644
--- a/Source/WebCore/Modules/mediastream/MediaDevices.h
+++ b/Source/WebCore/Modules/mediastream/MediaDevices.h
@@ -100,7 +100,6 @@
// ActiveDOMObject
const char* activeDOMObjectName() const final;
- bool canSuspendForDocumentSuspension() const final;
void stop() final;
bool hasPendingActivity() const final;
diff --git a/Source/WebCore/Modules/mediastream/MediaStream.cpp b/Source/WebCore/Modules/mediastream/MediaStream.cpp
index 8296f32..504d117 100644
--- a/Source/WebCore/Modules/mediastream/MediaStream.cpp
+++ b/Source/WebCore/Modules/mediastream/MediaStream.cpp
@@ -400,9 +400,10 @@
return "MediaStream";
}
-bool MediaStream::canSuspendForDocumentSuspension() const
+// FIXME: This should never prevent entering the back/forward cache.
+bool MediaStream::shouldPreventEnteringBackForwardCache_DEPRECATED() const
{
- return !hasPendingActivity();
+ return hasPendingActivity();
}
bool MediaStream::hasPendingActivity() const
diff --git a/Source/WebCore/Modules/mediastream/MediaStream.h b/Source/WebCore/Modules/mediastream/MediaStream.h
index 665f109..41da762 100644
--- a/Source/WebCore/Modules/mediastream/MediaStream.h
+++ b/Source/WebCore/Modules/mediastream/MediaStream.h
@@ -146,7 +146,7 @@
// ActiveDOMObject API.
void stop() final;
const char* activeDOMObjectName() const final;
- bool canSuspendForDocumentSuspension() const final;
+ bool shouldPreventEnteringBackForwardCache_DEPRECATED() const final;
void updateActiveState();
void activityEventTimerFired();
diff --git a/Source/WebCore/Modules/mediastream/MediaStreamTrack.cpp b/Source/WebCore/Modules/mediastream/MediaStreamTrack.cpp
index 955294e..44bfa9b 100644
--- a/Source/WebCore/Modules/mediastream/MediaStreamTrack.cpp
+++ b/Source/WebCore/Modules/mediastream/MediaStreamTrack.cpp
@@ -556,9 +556,10 @@
return "MediaStreamTrack";
}
-bool MediaStreamTrack::canSuspendForDocumentSuspension() const
+// FIXME: This should never prevent entering the back/forward cache.
+bool MediaStreamTrack::shouldPreventEnteringBackForwardCache_DEPRECATED() const
{
- return !hasPendingActivity();
+ return hasPendingActivity();
}
bool MediaStreamTrack::hasPendingActivity() const
diff --git a/Source/WebCore/Modules/mediastream/MediaStreamTrack.h b/Source/WebCore/Modules/mediastream/MediaStreamTrack.h
index 6b1669d..692f083 100644
--- a/Source/WebCore/Modules/mediastream/MediaStreamTrack.h
+++ b/Source/WebCore/Modules/mediastream/MediaStreamTrack.h
@@ -177,7 +177,7 @@
// ActiveDOMObject API.
void stop() final;
const char* activeDOMObjectName() const final;
- bool canSuspendForDocumentSuspension() const final;
+ bool shouldPreventEnteringBackForwardCache_DEPRECATED() const final;
// EventTarget
void refEventTarget() final { ref(); }
diff --git a/Source/WebCore/Modules/mediastream/RTCDTMFSender.cpp b/Source/WebCore/Modules/mediastream/RTCDTMFSender.cpp
index 6ff4aa5..683bbba 100644
--- a/Source/WebCore/Modules/mediastream/RTCDTMFSender.cpp
+++ b/Source/WebCore/Modules/mediastream/RTCDTMFSender.cpp
@@ -148,9 +148,10 @@
return "RTCDTMFSender";
}
-bool RTCDTMFSender::canSuspendForDocumentSuspension() const
+// FIXME: This should never prevent entering the back/forward cache.
+bool RTCDTMFSender::shouldPreventEnteringBackForwardCache_DEPRECATED() const
{
- return !m_sender || m_sender->isStopped();
+ return m_sender && !m_sender->isStopped();
}
} // namespace WebCore
diff --git a/Source/WebCore/Modules/mediastream/RTCDTMFSender.h b/Source/WebCore/Modules/mediastream/RTCDTMFSender.h
index 345954d..719a99d 100644
--- a/Source/WebCore/Modules/mediastream/RTCDTMFSender.h
+++ b/Source/WebCore/Modules/mediastream/RTCDTMFSender.h
@@ -58,7 +58,7 @@
void stop() final;
const char* activeDOMObjectName() const final;
- bool canSuspendForDocumentSuspension() const final;
+ bool shouldPreventEnteringBackForwardCache_DEPRECATED() const final;
EventTargetInterface eventTargetInterface() const final { return RTCDTMFSenderEventTargetInterfaceType; }
ScriptExecutionContext* scriptExecutionContext() const final { return ActiveDOMObject::scriptExecutionContext(); }
diff --git a/Source/WebCore/Modules/mediastream/RTCDataChannel.h b/Source/WebCore/Modules/mediastream/RTCDataChannel.h
index 4d3662d..e39eed3 100644
--- a/Source/WebCore/Modules/mediastream/RTCDataChannel.h
+++ b/Source/WebCore/Modules/mediastream/RTCDataChannel.h
@@ -94,7 +94,9 @@
// ActiveDOMObject API
void stop() final;
const char* activeDOMObjectName() const final { return "RTCDataChannel"; }
- bool canSuspendForDocumentSuspension() const final { return m_readyState != RTCDataChannelState::Open; }
+
+ // FIXME: This should never prevent entering the back/forward cache.
+ bool shouldPreventEnteringBackForwardCache_DEPRECATED() const final { return m_readyState == RTCDataChannelState::Open; }
// RTCDataChannelHandlerClient API
void didChangeReadyState(RTCDataChannelState) final;
diff --git a/Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp b/Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp
index fd120fa..09b0396 100644
--- a/Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp
+++ b/Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp
@@ -498,10 +498,10 @@
return "RTCPeerConnection";
}
-bool RTCPeerConnection::canSuspendForDocumentSuspension() const
+// FIXME: This should never prevent entering the back/forward cache.
+bool RTCPeerConnection::shouldPreventEnteringBackForwardCache_DEPRECATED() const
{
- // FIXME: Evaluate whether to extend this to connected cases as well.
- return m_iceConnectionState != RTCIceConnectionState::Completed && m_iceConnectionState != RTCIceConnectionState::Connected;
+ return m_iceConnectionState == RTCIceConnectionState::Completed || m_iceConnectionState == RTCIceConnectionState::Connected;
}
void RTCPeerConnection::suspend(ReasonForSuspension reason)
diff --git a/Source/WebCore/Modules/mediastream/RTCPeerConnection.h b/Source/WebCore/Modules/mediastream/RTCPeerConnection.h
index 6087366..1872065 100644
--- a/Source/WebCore/Modules/mediastream/RTCPeerConnection.h
+++ b/Source/WebCore/Modules/mediastream/RTCPeerConnection.h
@@ -211,7 +211,7 @@
// ActiveDOMObject
WEBCORE_EXPORT void stop() final;
const char* activeDOMObjectName() const final;
- bool canSuspendForDocumentSuspension() const final;
+ bool shouldPreventEnteringBackForwardCache_DEPRECATED() const final;
void suspend(ReasonForSuspension) final;
void resume() final;
diff --git a/Source/WebCore/Modules/mediastream/UserMediaRequest.cpp b/Source/WebCore/Modules/mediastream/UserMediaRequest.cpp
index 77a52da..5d2c6f2 100644
--- a/Source/WebCore/Modules/mediastream/UserMediaRequest.cpp
+++ b/Source/WebCore/Modules/mediastream/UserMediaRequest.cpp
@@ -336,9 +336,10 @@
return "UserMediaRequest";
}
-bool UserMediaRequest::canSuspendForDocumentSuspension() const
+// FIXME: This should never prevent entering the back/forward cache.
+bool UserMediaRequest::shouldPreventEnteringBackForwardCache_DEPRECATED() const
{
- return !hasPendingActivity();
+ return hasPendingActivity();
}
Document* UserMediaRequest::document() const
diff --git a/Source/WebCore/Modules/mediastream/UserMediaRequest.h b/Source/WebCore/Modules/mediastream/UserMediaRequest.h
index f2c0efc..46f1d47 100644
--- a/Source/WebCore/Modules/mediastream/UserMediaRequest.h
+++ b/Source/WebCore/Modules/mediastream/UserMediaRequest.h
@@ -85,7 +85,7 @@
void stop() final;
const char* activeDOMObjectName() const final;
- bool canSuspendForDocumentSuspension() const final;
+ bool shouldPreventEnteringBackForwardCache_DEPRECATED() const final;
void mediaStreamDidFail(RealtimeMediaSource::Type);
diff --git a/Source/WebCore/Modules/notifications/Notification.cpp b/Source/WebCore/Modules/notifications/Notification.cpp
index f29a124..36b997fe 100644
--- a/Source/WebCore/Modules/notifications/Notification.cpp
+++ b/Source/WebCore/Modules/notifications/Notification.cpp
@@ -119,10 +119,10 @@
return "Notification";
}
-bool Notification::canSuspendForDocumentSuspension() const
+// FIXME: This should never prevent entering the back/forward cache.
+bool Notification::shouldPreventEnteringBackForwardCache_DEPRECATED() const
{
- // We can suspend if the Notification is not shown yet or after it is closed.
- return m_state == Idle || m_state == Closed;
+ return m_state != Idle && m_state != Closed;
}
void Notification::stop()
diff --git a/Source/WebCore/Modules/notifications/Notification.h b/Source/WebCore/Modules/notifications/Notification.h
index 7ff98d4..e9d2d68 100644
--- a/Source/WebCore/Modules/notifications/Notification.h
+++ b/Source/WebCore/Modules/notifications/Notification.h
@@ -97,7 +97,7 @@
// ActiveDOMObject
const char* activeDOMObjectName() const final;
- bool canSuspendForDocumentSuspension() const final;
+ bool shouldPreventEnteringBackForwardCache_DEPRECATED() const final;
void stop() final;
void refEventTarget() final { ref(); }
diff --git a/Source/WebCore/Modules/paymentrequest/PaymentRequest.cpp b/Source/WebCore/Modules/paymentrequest/PaymentRequest.cpp
index cc0774b..00f1493 100644
--- a/Source/WebCore/Modules/paymentrequest/PaymentRequest.cpp
+++ b/Source/WebCore/Modules/paymentrequest/PaymentRequest.cpp
@@ -539,9 +539,10 @@
return WTF::nullopt;
}
-bool PaymentRequest::canSuspendForDocumentSuspension() const
+// FIXME: This should never prevent entering the back/forward cache.
+bool PaymentRequest::shouldPreventEnteringBackForwardCache_DEPRECATED() const
{
- return !hasPendingActivity();
+ return hasPendingActivity();
}
void PaymentRequest::shippingAddressChanged(Ref<PaymentAddress>&& shippingAddress)
diff --git a/Source/WebCore/Modules/paymentrequest/PaymentRequest.h b/Source/WebCore/Modules/paymentrequest/PaymentRequest.h
index 7f1b52f..40a5ea2 100644
--- a/Source/WebCore/Modules/paymentrequest/PaymentRequest.h
+++ b/Source/WebCore/Modules/paymentrequest/PaymentRequest.h
@@ -126,7 +126,7 @@
// ActiveDOMObject
const char* activeDOMObjectName() const final { return "PaymentRequest"; }
- bool canSuspendForDocumentSuspension() const final;
+ bool shouldPreventEnteringBackForwardCache_DEPRECATED() const final;
void stop() final;
// EventTarget
diff --git a/Source/WebCore/Modules/paymentrequest/PaymentResponse.cpp b/Source/WebCore/Modules/paymentrequest/PaymentResponse.cpp
index 98b5d6c..1692dc0 100644
--- a/Source/WebCore/Modules/paymentrequest/PaymentResponse.cpp
+++ b/Source/WebCore/Modules/paymentrequest/PaymentResponse.cpp
@@ -125,10 +125,11 @@
m_retryPromise = nullptr;
}
-bool PaymentResponse::canSuspendForDocumentSuspension() const
+// FIXME: This should never prevent entering the back/forward cache.
+bool PaymentResponse::shouldPreventEnteringBackForwardCache_DEPRECATED() const
{
ASSERT(m_state != State::Stopped);
- return !hasPendingActivity();
+ return hasPendingActivity();
}
void PaymentResponse::stop()
diff --git a/Source/WebCore/Modules/paymentrequest/PaymentResponse.h b/Source/WebCore/Modules/paymentrequest/PaymentResponse.h
index 9ae9f85..fe79a6d 100644
--- a/Source/WebCore/Modules/paymentrequest/PaymentResponse.h
+++ b/Source/WebCore/Modules/paymentrequest/PaymentResponse.h
@@ -98,7 +98,7 @@
// ActiveDOMObject
const char* activeDOMObjectName() const final { return "PaymentResponse"; }
- bool canSuspendForDocumentSuspension() const final;
+ bool shouldPreventEnteringBackForwardCache_DEPRECATED() const final;
void stop() final;
// EventTarget
diff --git a/Source/WebCore/Modules/pictureinpicture/PictureInPictureWindow.cpp b/Source/WebCore/Modules/pictureinpicture/PictureInPictureWindow.cpp
index 49ec747..a000f17 100644
--- a/Source/WebCore/Modules/pictureinpicture/PictureInPictureWindow.cpp
+++ b/Source/WebCore/Modules/pictureinpicture/PictureInPictureWindow.cpp
@@ -54,11 +54,6 @@
return "PictureInPictureWindow";
}
-bool PictureInPictureWindow::canSuspendForDocumentSuspension() const
-{
- return true;
-}
-
EventTargetInterface PictureInPictureWindow::eventTargetInterface() const
{
return PictureInPictureWindowEventTargetInterfaceType;
diff --git a/Source/WebCore/Modules/pictureinpicture/PictureInPictureWindow.h b/Source/WebCore/Modules/pictureinpicture/PictureInPictureWindow.h
index 7ae5a6b..231bf53 100644
--- a/Source/WebCore/Modules/pictureinpicture/PictureInPictureWindow.h
+++ b/Source/WebCore/Modules/pictureinpicture/PictureInPictureWindow.h
@@ -48,7 +48,6 @@
// ActiveDOMObject
const char* activeDOMObjectName() const final;
- bool canSuspendForDocumentSuspension() const final;
using RefCounted<PictureInPictureWindow>::ref;
using RefCounted<PictureInPictureWindow>::deref;
diff --git a/Source/WebCore/Modules/webaudio/AudioContext.cpp b/Source/WebCore/Modules/webaudio/AudioContext.cpp
index dd2e5ce..66f2208 100644
--- a/Source/WebCore/Modules/webaudio/AudioContext.cpp
+++ b/Source/WebCore/Modules/webaudio/AudioContext.cpp
@@ -340,10 +340,10 @@
clear();
}
-bool AudioContext::canSuspendForDocumentSuspension() const
+bool AudioContext::shouldPreventEnteringBackForwardCache_DEPRECATED() const
{
// FIXME: We should be able to suspend while rendering as well with some more code.
- return m_state == State::Suspended || m_state == State::Closed;
+ return m_state != State::Suspended && m_state != State::Closed;
}
const char* AudioContext::activeDOMObjectName() const
diff --git a/Source/WebCore/Modules/webaudio/AudioContext.h b/Source/WebCore/Modules/webaudio/AudioContext.h
index e466f45..762c13b 100644
--- a/Source/WebCore/Modules/webaudio/AudioContext.h
+++ b/Source/WebCore/Modules/webaudio/AudioContext.h
@@ -339,7 +339,7 @@
// ActiveDOMObject API.
void stop() override;
- bool canSuspendForDocumentSuspension() const override;
+ bool shouldPreventEnteringBackForwardCache_DEPRECATED() const override;
const char* activeDOMObjectName() const override;
// When the context goes away, there might still be some sources which haven't finished playing.
diff --git a/Source/WebCore/Modules/webdatabase/DatabaseContext.cpp b/Source/WebCore/Modules/webdatabase/DatabaseContext.cpp
index 2012f75..1fb061f 100644
--- a/Source/WebCore/Modules/webdatabase/DatabaseContext.cpp
+++ b/Source/WebCore/Modules/webdatabase/DatabaseContext.cpp
@@ -130,12 +130,13 @@
stopDatabases();
}
-bool DatabaseContext::canSuspendForDocumentSuspension() const
+// FIXME: This should never prevent entering the back/forward cache.
+bool DatabaseContext::shouldPreventEnteringBackForwardCache_DEPRECATED() const
{
if (!hasOpenDatabases() || !m_databaseThread)
- return true;
+ return false;
- return !m_databaseThread->hasPendingDatabaseActivity();
+ return m_databaseThread->hasPendingDatabaseActivity();
}
DatabaseThread* DatabaseContext::databaseThread()
diff --git a/Source/WebCore/Modules/webdatabase/DatabaseContext.h b/Source/WebCore/Modules/webdatabase/DatabaseContext.h
index 7dd4b9e..bef5520 100644
--- a/Source/WebCore/Modules/webdatabase/DatabaseContext.h
+++ b/Source/WebCore/Modules/webdatabase/DatabaseContext.h
@@ -73,7 +73,7 @@
void contextDestroyed() override;
void stop() override;
- bool canSuspendForDocumentSuspension() const override;
+ bool shouldPreventEnteringBackForwardCache_DEPRECATED() const override;
const char* activeDOMObjectName() const override { return "DatabaseContext"; }
RefPtr<DatabaseThread> m_databaseThread;
diff --git a/Source/WebCore/Modules/webgpu/GPUCanvasContext.h b/Source/WebCore/Modules/webgpu/GPUCanvasContext.h
index cd818ce..1bb270b 100644
--- a/Source/WebCore/Modules/webgpu/GPUCanvasContext.h
+++ b/Source/WebCore/Modules/webgpu/GPUCanvasContext.h
@@ -60,7 +60,7 @@
const char* activeDOMObjectName() const final { return "GPUCanvasContext"; }
// FIXME: Stubs.
void stop() final { }
- bool canSuspendForDocumentSuspension() const final { return false; }
+ bool shouldPreventEnteringBackForwardCache_DEPRECATED() const final { return true; } // FIXME: This should never prevent entering the back/forward cache.
RefPtr<WebGPUSwapChain> m_swapChain;
};
diff --git a/Source/WebCore/Modules/websockets/WebSocket.cpp b/Source/WebCore/Modules/websockets/WebSocket.cpp
index b32bf98..94403f2 100644
--- a/Source/WebCore/Modules/websockets/WebSocket.cpp
+++ b/Source/WebCore/Modules/websockets/WebSocket.cpp
@@ -495,11 +495,6 @@
ActiveDOMObject::contextDestroyed();
}
-bool WebSocket::canSuspendForDocumentSuspension() const
-{
- return true;
-}
-
void WebSocket::suspend(ReasonForSuspension reason)
{
if (m_resumeTimer.isActive())
diff --git a/Source/WebCore/Modules/websockets/WebSocket.h b/Source/WebCore/Modules/websockets/WebSocket.h
index 86efff7..abd225b 100644
--- a/Source/WebCore/Modules/websockets/WebSocket.h
+++ b/Source/WebCore/Modules/websockets/WebSocket.h
@@ -106,7 +106,6 @@
void dispatchOrQueueEvent(Ref<Event>&&);
void contextDestroyed() final;
- bool canSuspendForDocumentSuspension() const final;
void suspend(ReasonForSuspension) final;
void resume() final;
void stop() final;
diff --git a/Source/WebCore/Modules/webvr/VRDisplay.cpp b/Source/WebCore/Modules/webvr/VRDisplay.cpp
index 806a7ab..cf588ed 100644
--- a/Source/WebCore/Modules/webvr/VRDisplay.cpp
+++ b/Source/WebCore/Modules/webvr/VRDisplay.cpp
@@ -239,9 +239,10 @@
return "VRDisplay";
}
-bool VRDisplay::canSuspendForDocumentSuspension() const
+// FIXME: This should never prevent entering the back/forward cache.
+bool VRDisplay::shouldPreventEnteringBackForwardCache_DEPRECATED() const
{
- return false;
+ return true;
}
void VRDisplay::stop()
diff --git a/Source/WebCore/Modules/webvr/VRDisplay.h b/Source/WebCore/Modules/webvr/VRDisplay.h
index 1cd75d8..e088cd1 100644
--- a/Source/WebCore/Modules/webvr/VRDisplay.h
+++ b/Source/WebCore/Modules/webvr/VRDisplay.h
@@ -106,7 +106,7 @@
// ActiveDOMObject
const char* activeDOMObjectName() const override;
- bool canSuspendForDocumentSuspension() const override;
+ bool shouldPreventEnteringBackForwardCache_DEPRECATED() const override;
void stop() override;
void stopPresenting();
diff --git a/Source/WebCore/animation/WebAnimation.cpp b/Source/WebCore/animation/WebAnimation.cpp
index 5f0c900..39f6b34 100644
--- a/Source/WebCore/animation/WebAnimation.cpp
+++ b/Source/WebCore/animation/WebAnimation.cpp
@@ -1157,12 +1157,13 @@
return "Animation";
}
-bool WebAnimation::canSuspendForDocumentSuspension() const
+// FIXME: This should never prevent entering the back/forward cache.
+bool WebAnimation::shouldPreventEnteringBackForwardCache_DEPRECATED() const
{
// Use the base class's implementation of hasPendingActivity() since we wouldn't want the custom implementation
// in this class designed to keep JS wrappers alive to interfere with the ability for a page using animations
// to enter the back/forward cache.
- return !ActiveDOMObject::hasPendingActivity();
+ return ActiveDOMObject::hasPendingActivity();
}
void WebAnimation::stop()
diff --git a/Source/WebCore/animation/WebAnimation.h b/Source/WebCore/animation/WebAnimation.h
index 20b4cca..d4159df 100644
--- a/Source/WebCore/animation/WebAnimation.h
+++ b/Source/WebCore/animation/WebAnimation.h
@@ -197,7 +197,7 @@
// ActiveDOMObject.
const char* activeDOMObjectName() const final;
- bool canSuspendForDocumentSuspension() const final;
+ bool shouldPreventEnteringBackForwardCache_DEPRECATED() const final;
// EventTarget
EventTargetInterface eventTargetInterface() const final { return WebAnimationEventTargetInterfaceType; }
diff --git a/Source/WebCore/css/FontFaceSet.cpp b/Source/WebCore/css/FontFaceSet.cpp
index def3a94..c625fbe 100644
--- a/Source/WebCore/css/FontFaceSet.cpp
+++ b/Source/WebCore/css/FontFaceSet.cpp
@@ -192,11 +192,6 @@
return LoadStatus::Loaded;
}
-bool FontFaceSet::canSuspendForDocumentSuspension() const
-{
- return true;
-}
-
void FontFaceSet::startedLoading()
{
// FIXME: Fire a "loading" event asynchronously.
diff --git a/Source/WebCore/css/FontFaceSet.h b/Source/WebCore/css/FontFaceSet.h
index 9f728ef..a102f80 100644
--- a/Source/WebCore/css/FontFaceSet.h
+++ b/Source/WebCore/css/FontFaceSet.h
@@ -105,7 +105,6 @@
// ActiveDOMObject
const char* activeDOMObjectName() const final { return "FontFaceSet"; }
- bool canSuspendForDocumentSuspension() const final;
// EventTarget
EventTargetInterface eventTargetInterface() const final { return FontFaceSetEventTargetInterfaceType; }
diff --git a/Source/WebCore/dom/ActiveDOMObject.h b/Source/WebCore/dom/ActiveDOMObject.h
index 6b8b986..5aa5954 100644
--- a/Source/WebCore/dom/ActiveDOMObject.h
+++ b/Source/WebCore/dom/ActiveDOMObject.h
@@ -52,10 +52,6 @@
virtual bool hasPendingActivity() const;
- // The canSuspendForDocumentSuspension() function is used by the caller if there is a choice between suspending
- // and stopping. For example, a page won't be suspended and placed in the back/forward
- // cache if it contains any objects that cannot be suspended.
-
// However, the suspend function will sometimes be called even if canSuspendForDocumentSuspension() returns false.
// That happens in step-by-step JS debugging for example - in this case it would be incorrect
// to stop the object. Exact semantics of suspend is up to the object in cases like that.
@@ -64,7 +60,7 @@
// These three functions must not have a side effect of creating or destroying
// any ActiveDOMObject. That means they must not result in calls to arbitrary JavaScript.
- virtual bool canSuspendForDocumentSuspension() const = 0; // Returning false in canSuspendForDocumentSuspension() will prevent the page from entering the BackForwardCache.
+ virtual bool shouldPreventEnteringBackForwardCache_DEPRECATED() const { return false; } // Please do not add new overrides for this function.
virtual void suspend(ReasonForSuspension);
virtual void resume();
diff --git a/Source/WebCore/dom/GenericEventQueue.cpp b/Source/WebCore/dom/GenericEventQueue.cpp
index 2211b9b..82c2b8f 100644
--- a/Source/WebCore/dom/GenericEventQueue.cpp
+++ b/Source/WebCore/dom/GenericEventQueue.cpp
@@ -133,12 +133,6 @@
}
template<typename T>
-bool GenericEventQueueBase<T>::canSuspendForDocumentSuspension() const
-{
- return true;
-}
-
-template<typename T>
void GenericEventQueueBase<T>::suspend(ReasonForSuspension)
{
if (m_isSuspended)
diff --git a/Source/WebCore/dom/GenericEventQueue.h b/Source/WebCore/dom/GenericEventQueue.h
index ccd1064..5375d55 100644
--- a/Source/WebCore/dom/GenericEventQueue.h
+++ b/Source/WebCore/dom/GenericEventQueue.h
@@ -61,7 +61,6 @@
void dispatchOneEvent();
const char* activeDOMObjectName() const final;
- bool canSuspendForDocumentSuspension() const final;
void stop() final;
void suspend(ReasonForSuspension) final;
void resume() final;
diff --git a/Source/WebCore/dom/MessagePort.cpp b/Source/WebCore/dom/MessagePort.cpp
index 1d50402..369562c 100644
--- a/Source/WebCore/dom/MessagePort.cpp
+++ b/Source/WebCore/dom/MessagePort.cpp
@@ -413,9 +413,4 @@
return "MessagePort";
}
-bool MessagePort::canSuspendForDocumentSuspension() const
-{
- return true;
-}
-
} // namespace WebCore
diff --git a/Source/WebCore/dom/MessagePort.h b/Source/WebCore/dom/MessagePort.h
index 0b5f3d8..a136a56 100644
--- a/Source/WebCore/dom/MessagePort.h
+++ b/Source/WebCore/dom/MessagePort.h
@@ -85,7 +85,6 @@
// ActiveDOMObject
const char* activeDOMObjectName() const final;
- bool canSuspendForDocumentSuspension() const final;
void contextDestroyed() final;
void stop() final { close(); }
bool hasPendingActivity() const final;
diff --git a/Source/WebCore/dom/ScriptExecutionContext.cpp b/Source/WebCore/dom/ScriptExecutionContext.cpp
index 3ea9b38..ca5c5a2 100644
--- a/Source/WebCore/dom/ScriptExecutionContext.cpp
+++ b/Source/WebCore/dom/ScriptExecutionContext.cpp
@@ -229,7 +229,7 @@
bool canSuspend = true;
forEachActiveDOMObject([&](auto& activeDOMObject) {
- if (!activeDOMObject.canSuspendForDocumentSuspension()) {
+ if (activeDOMObject.shouldPreventEnteringBackForwardCache_DEPRECATED()) {
canSuspend = false;
if (unsuspendableObjects)
unsuspendableObjects->append(&activeDOMObject);
diff --git a/Source/WebCore/fileapi/FileReader.cpp b/Source/WebCore/fileapi/FileReader.cpp
index 99a7b5c..62438cd 100644
--- a/Source/WebCore/fileapi/FileReader.cpp
+++ b/Source/WebCore/fileapi/FileReader.cpp
@@ -65,9 +65,10 @@
m_loader->cancel();
}
-bool FileReader::canSuspendForDocumentSuspension() const
+// FIXME: This should never prevent entering the back/forward cache.
+bool FileReader::shouldPreventEnteringBackForwardCache_DEPRECATED() const
{
- return !hasPendingActivity();
+ return hasPendingActivity();
}
const char* FileReader::activeDOMObjectName() const
diff --git a/Source/WebCore/fileapi/FileReader.h b/Source/WebCore/fileapi/FileReader.h
index effdb29..c0b7df7a 100644
--- a/Source/WebCore/fileapi/FileReader.h
+++ b/Source/WebCore/fileapi/FileReader.h
@@ -78,7 +78,7 @@
explicit FileReader(ScriptExecutionContext&);
const char* activeDOMObjectName() const final;
- bool canSuspendForDocumentSuspension() const final;
+ bool shouldPreventEnteringBackForwardCache_DEPRECATED() const final;
void stop() final;
EventTargetInterface eventTargetInterface() const final { return FileReaderEventTargetInterfaceType; }
diff --git a/Source/WebCore/html/HTMLMarqueeElement.cpp b/Source/WebCore/html/HTMLMarqueeElement.cpp
index 1679e9b..0adf7d1 100644
--- a/Source/WebCore/html/HTMLMarqueeElement.cpp
+++ b/Source/WebCore/html/HTMLMarqueeElement.cpp
@@ -159,11 +159,6 @@
return { };
}
-bool HTMLMarqueeElement::canSuspendForDocumentSuspension() const
-{
- return true;
-}
-
void HTMLMarqueeElement::suspend(ReasonForSuspension)
{
if (RenderMarquee* marqueeRenderer = renderMarquee())
diff --git a/Source/WebCore/html/HTMLMarqueeElement.h b/Source/WebCore/html/HTMLMarqueeElement.h
index 05818a5..a2f2e54 100644
--- a/Source/WebCore/html/HTMLMarqueeElement.h
+++ b/Source/WebCore/html/HTMLMarqueeElement.h
@@ -57,7 +57,6 @@
bool isPresentationAttribute(const QualifiedName&) const final;
void collectStyleForPresentationAttribute(const QualifiedName&, const AtomString&, MutableStyleProperties&) final;
- bool canSuspendForDocumentSuspension() const final;
void suspend(ReasonForSuspension) final;
void resume() final;
const char* activeDOMObjectName() const final { return "HTMLMarqueeElement"; }
diff --git a/Source/WebCore/html/HTMLMediaElement.cpp b/Source/WebCore/html/HTMLMediaElement.cpp
index 9fa738a..fdecb87 100644
--- a/Source/WebCore/html/HTMLMediaElement.cpp
+++ b/Source/WebCore/html/HTMLMediaElement.cpp
@@ -5663,11 +5663,6 @@
updateSleepDisabling();
}
-bool HTMLMediaElement::canSuspendForDocumentSuspension() const
-{
- return true;
-}
-
const char* HTMLMediaElement::activeDOMObjectName() const
{
return "HTMLMediaElement";
diff --git a/Source/WebCore/html/HTMLMediaElement.h b/Source/WebCore/html/HTMLMediaElement.h
index 32a240a..f482d21 100644
--- a/Source/WebCore/html/HTMLMediaElement.h
+++ b/Source/WebCore/html/HTMLMediaElement.h
@@ -633,7 +633,6 @@
// ActiveDOMObject API.
const char* activeDOMObjectName() const override;
- bool canSuspendForDocumentSuspension() const override;
void suspend(ReasonForSuspension) override;
void resume() override;
void stop() override;
diff --git a/Source/WebCore/html/HTMLSourceElement.cpp b/Source/WebCore/html/HTMLSourceElement.cpp
index dd5d85c..4216e97 100644
--- a/Source/WebCore/html/HTMLSourceElement.cpp
+++ b/Source/WebCore/html/HTMLSourceElement.cpp
@@ -127,11 +127,6 @@
return "HTMLSourceElement";
}
-bool HTMLSourceElement::canSuspendForDocumentSuspension() const
-{
- return true;
-}
-
void HTMLSourceElement::suspend(ReasonForSuspension reason)
{
// FIXME: Shouldn't this also stop the timer for PageWillBeSuspended?
diff --git a/Source/WebCore/html/HTMLSourceElement.h b/Source/WebCore/html/HTMLSourceElement.h
index 8765871..4df0af5 100644
--- a/Source/WebCore/html/HTMLSourceElement.h
+++ b/Source/WebCore/html/HTMLSourceElement.h
@@ -52,7 +52,6 @@
// ActiveDOMObject.
const char* activeDOMObjectName() const final;
- bool canSuspendForDocumentSuspension() const final;
void suspend(ReasonForSuspension) final;
void resume() final;
void stop() final;
diff --git a/Source/WebCore/html/ImageBitmap.cpp b/Source/WebCore/html/ImageBitmap.cpp
index ba4bf1e..f2e6340 100644
--- a/Source/WebCore/html/ImageBitmap.cpp
+++ b/Source/WebCore/html/ImageBitmap.cpp
@@ -561,11 +561,6 @@
return "PendingImageBitmap";
}
- bool canSuspendForDocumentSuspension() const final
- {
- return true;
- }
-
void stop() final
{
delete this;
diff --git a/Source/WebCore/html/PublicURLManager.cpp b/Source/WebCore/html/PublicURLManager.cpp
index d2f96d4..8f5fcf5 100644
--- a/Source/WebCore/html/PublicURLManager.cpp
+++ b/Source/WebCore/html/PublicURLManager.cpp
@@ -81,12 +81,6 @@
m_registryToURL.clear();
}
-bool PublicURLManager::canSuspendForDocumentSuspension() const
-{
- // Suspending an PublicURLManager is safe as it does not cause any JS to be executed.
- return true;
-}
-
const char* PublicURLManager::activeDOMObjectName() const
{
return "PublicURLManager";
diff --git a/Source/WebCore/html/PublicURLManager.h b/Source/WebCore/html/PublicURLManager.h
index 9bfe73e..0ecb7ed 100644
--- a/Source/WebCore/html/PublicURLManager.h
+++ b/Source/WebCore/html/PublicURLManager.h
@@ -50,7 +50,6 @@
private:
// ActiveDOMObject API.
void stop() override;
- bool canSuspendForDocumentSuspension() const override;
const char* activeDOMObjectName() const override;
typedef HashSet<String> URLSet;
diff --git a/Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp b/Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp
index de47ae7..626246f 100644
--- a/Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp
+++ b/Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp
@@ -5208,11 +5208,6 @@
return "WebGLRenderingContext";
}
-bool WebGLRenderingContextBase::canSuspendForDocumentSuspension() const
-{
- return true;
-}
-
void WebGLRenderingContextBase::suspend(ReasonForSuspension)
{
m_isSuspended = true;
diff --git a/Source/WebCore/html/canvas/WebGLRenderingContextBase.h b/Source/WebCore/html/canvas/WebGLRenderingContextBase.h
index b172538..6ca2ac6 100644
--- a/Source/WebCore/html/canvas/WebGLRenderingContextBase.h
+++ b/Source/WebCore/html/canvas/WebGLRenderingContextBase.h
@@ -393,7 +393,6 @@
// ActiveDOMObject
void stop() override;
const char* activeDOMObjectName() const override;
- bool canSuspendForDocumentSuspension() const override;
void suspend(ReasonForSuspension) override;
void resume() override;
diff --git a/Source/WebCore/html/track/TrackListBase.cpp b/Source/WebCore/html/track/TrackListBase.cpp
index 9003e9c..4518d7f 100644
--- a/Source/WebCore/html/track/TrackListBase.cpp
+++ b/Source/WebCore/html/track/TrackListBase.cpp
@@ -178,11 +178,6 @@
return false;
}
-bool TrackListBase::canSuspendForDocumentSuspension() const
-{
- return true;
-}
-
} // namespace WebCore
#endif
diff --git a/Source/WebCore/html/track/TrackListBase.h b/Source/WebCore/html/track/TrackListBase.h
index 4255bc1..a3b1aa7 100644
--- a/Source/WebCore/html/track/TrackListBase.h
+++ b/Source/WebCore/html/track/TrackListBase.h
@@ -75,8 +75,6 @@
private:
void scheduleTrackEvent(const AtomString& eventName, Ref<TrackBase>&&);
- bool canSuspendForDocumentSuspension() const final;
-
// EventTarget
void refEventTarget() final { ref(); }
void derefEventTarget() final { deref(); }
diff --git a/Source/WebCore/page/EventSource.cpp b/Source/WebCore/page/EventSource.cpp
index f1f5b32b..757765c 100644
--- a/Source/WebCore/page/EventSource.cpp
+++ b/Source/WebCore/page/EventSource.cpp
@@ -403,11 +403,6 @@
return "EventSource";
}
-bool EventSource::canSuspendForDocumentSuspension() const
-{
- return true;
-}
-
void EventSource::suspend(ReasonForSuspension reason)
{
if (reason != ReasonForSuspension::BackForwardCache)
diff --git a/Source/WebCore/page/EventSource.h b/Source/WebCore/page/EventSource.h
index 3559144..ce2530f 100644
--- a/Source/WebCore/page/EventSource.h
+++ b/Source/WebCore/page/EventSource.h
@@ -91,7 +91,6 @@
// ActiveDOMObject
void stop() final;
const char* activeDOMObjectName() const final;
- bool canSuspendForDocumentSuspension() const final;
void suspend(ReasonForSuspension) final;
void resume() final;
diff --git a/Source/WebCore/page/IntersectionObserver.cpp b/Source/WebCore/page/IntersectionObserver.cpp
index f9fb287..cea487f 100644
--- a/Source/WebCore/page/IntersectionObserver.cpp
+++ b/Source/WebCore/page/IntersectionObserver.cpp
@@ -279,11 +279,6 @@
return "IntersectionObserver";
}
-bool IntersectionObserver::canSuspendForDocumentSuspension() const
-{
- return true;
-}
-
void IntersectionObserver::stop()
{
disconnect();
diff --git a/Source/WebCore/page/IntersectionObserver.h b/Source/WebCore/page/IntersectionObserver.h
index 7c9854b..d4b902e 100644
--- a/Source/WebCore/page/IntersectionObserver.h
+++ b/Source/WebCore/page/IntersectionObserver.h
@@ -101,7 +101,6 @@
// ActiveDOMObject.
bool hasPendingActivity() const override;
const char* activeDOMObjectName() const override;
- bool canSuspendForDocumentSuspension() const override;
void stop() override;
private:
diff --git a/Source/WebCore/page/ResizeObserver.cpp b/Source/WebCore/page/ResizeObserver.cpp
index cbe5168..cf61f8c 100644
--- a/Source/WebCore/page/ResizeObserver.cpp
+++ b/Source/WebCore/page/ResizeObserver.cpp
@@ -171,11 +171,6 @@
return "ResizeObserver";
}
-bool ResizeObserver::canSuspendForDocumentSuspension() const
-{
- return true;
-}
-
void ResizeObserver::stop()
{
disconnect();
diff --git a/Source/WebCore/page/ResizeObserver.h b/Source/WebCore/page/ResizeObserver.h
index eeebf9b..69cac88 100644
--- a/Source/WebCore/page/ResizeObserver.h
+++ b/Source/WebCore/page/ResizeObserver.h
@@ -67,7 +67,6 @@
// ActiveDOMObject.
bool hasPendingActivity() const override;
const char* activeDOMObjectName() const override;
- bool canSuspendForDocumentSuspension() const override;
void stop() override;
private:
diff --git a/Source/WebCore/page/SuspendableTimer.cpp b/Source/WebCore/page/SuspendableTimer.cpp
index e7e517b..844e001 100644
--- a/Source/WebCore/page/SuspendableTimer.cpp
+++ b/Source/WebCore/page/SuspendableTimer.cpp
@@ -78,11 +78,6 @@
start(m_savedNextFireInterval, m_savedRepeatInterval);
}
-bool SuspendableTimerBase::canSuspendForDocumentSuspension() const
-{
- return true;
-}
-
void SuspendableTimerBase::didStop()
{
}
diff --git a/Source/WebCore/page/SuspendableTimer.h b/Source/WebCore/page/SuspendableTimer.h
index f3ef123..3be62e4 100644
--- a/Source/WebCore/page/SuspendableTimer.h
+++ b/Source/WebCore/page/SuspendableTimer.h
@@ -67,7 +67,6 @@
// ActiveDOMObject API.
bool hasPendingActivity() const final;
void stop() final;
- bool canSuspendForDocumentSuspension() const final;
void suspend(ReasonForSuspension) final;
void resume() final;
diff --git a/Source/WebCore/platform/SuspendableTaskQueue.cpp b/Source/WebCore/platform/SuspendableTaskQueue.cpp
index 9cee4f4..046aaab 100644
--- a/Source/WebCore/platform/SuspendableTaskQueue.cpp
+++ b/Source/WebCore/platform/SuspendableTaskQueue.cpp
@@ -81,11 +81,6 @@
return "SuspendableTaskQueue";
}
-bool SuspendableTaskQueue::canSuspendForDocumentSuspension() const
-{
- return true;
-}
-
void SuspendableTaskQueue::stop()
{
close();
diff --git a/Source/WebCore/platform/SuspendableTaskQueue.h b/Source/WebCore/platform/SuspendableTaskQueue.h
index b128991..b3260f4 100644
--- a/Source/WebCore/platform/SuspendableTaskQueue.h
+++ b/Source/WebCore/platform/SuspendableTaskQueue.h
@@ -70,7 +70,6 @@
// ActiveDOMObject.
const char* activeDOMObjectName() const final;
- bool canSuspendForDocumentSuspension() const final;
void stop() final;
void suspend(ReasonForSuspension) final;
void resume() final;
diff --git a/Source/WebCore/testing/Internals.cpp b/Source/WebCore/testing/Internals.cpp
index f3c7e3e..97389d3 100644
--- a/Source/WebCore/testing/Internals.cpp
+++ b/Source/WebCore/testing/Internals.cpp
@@ -944,7 +944,7 @@
suspendIfNeeded();
}
- bool canSuspendForDocumentSuspension() const final { return false; }
+ bool shouldPreventEnteringBackForwardCache_DEPRECATED() const final { return true; }
const char* activeDOMObjectName() const { return "UnsuspendableActiveDOMObject"; }
};
diff --git a/Source/WebCore/workers/Worker.cpp b/Source/WebCore/workers/Worker.cpp
index e38eee3..0f5078e 100644
--- a/Source/WebCore/workers/Worker.cpp
+++ b/Source/WebCore/workers/Worker.cpp
@@ -150,11 +150,6 @@
m_eventQueue->cancelAllEvents();
}
-bool Worker::canSuspendForDocumentSuspension() const
-{
- return true;
-}
-
const char* Worker::activeDOMObjectName() const
{
return "Worker";
diff --git a/Source/WebCore/workers/Worker.h b/Source/WebCore/workers/Worker.h
index 8e3bfa8..4c54139 100644
--- a/Source/WebCore/workers/Worker.h
+++ b/Source/WebCore/workers/Worker.h
@@ -83,7 +83,6 @@
void didReceiveResponse(unsigned long identifier, const ResourceResponse&) final;
void notifyFinished() final;
- bool canSuspendForDocumentSuspension() const final;
void stop() final;
const char* activeDOMObjectName() const final;
diff --git a/Source/WebCore/workers/service/ServiceWorker.cpp b/Source/WebCore/workers/service/ServiceWorker.cpp
index d401a5d..42a5ab0 100644
--- a/Source/WebCore/workers/service/ServiceWorker.cpp
+++ b/Source/WebCore/workers/service/ServiceWorker.cpp
@@ -144,11 +144,6 @@
return "ServiceWorker";
}
-bool ServiceWorker::canSuspendForDocumentSuspension() const
-{
- return true;
-}
-
void ServiceWorker::suspend(ReasonForSuspension)
{
m_isSuspended = true;
diff --git a/Source/WebCore/workers/service/ServiceWorker.h b/Source/WebCore/workers/service/ServiceWorker.h
index 47ec0ca..67567e5 100644
--- a/Source/WebCore/workers/service/ServiceWorker.h
+++ b/Source/WebCore/workers/service/ServiceWorker.h
@@ -76,7 +76,6 @@
// ActiveDOMObject.
const char* activeDOMObjectName() const final;
- bool canSuspendForDocumentSuspension() const final;
void suspend(ReasonForSuspension) final;
void resume() final;
void stop() final;
diff --git a/Source/WebCore/workers/service/ServiceWorkerContainer.cpp b/Source/WebCore/workers/service/ServiceWorkerContainer.cpp
index ea23fe9..ef9ff3e 100644
--- a/Source/WebCore/workers/service/ServiceWorkerContainer.cpp
+++ b/Source/WebCore/workers/service/ServiceWorkerContainer.cpp
@@ -513,11 +513,6 @@
return "ServiceWorkerContainer";
}
-bool ServiceWorkerContainer::canSuspendForDocumentSuspension() const
-{
- return true;
-}
-
SWClientConnection& ServiceWorkerContainer::ensureSWClientConnection()
{
ASSERT(scriptExecutionContext());
diff --git a/Source/WebCore/workers/service/ServiceWorkerContainer.h b/Source/WebCore/workers/service/ServiceWorkerContainer.h
index 461e70e..d11db4e 100644
--- a/Source/WebCore/workers/service/ServiceWorkerContainer.h
+++ b/Source/WebCore/workers/service/ServiceWorkerContainer.h
@@ -113,7 +113,6 @@
// ActiveDOMObject.
const char* activeDOMObjectName() const final;
- bool canSuspendForDocumentSuspension() const final;
ScriptExecutionContext* scriptExecutionContext() const final { return ActiveDOMObject::scriptExecutionContext(); }
EventTargetInterface eventTargetInterface() const final { return ServiceWorkerContainerEventTargetInterfaceType; }
diff --git a/Source/WebCore/workers/service/ServiceWorkerRegistration.cpp b/Source/WebCore/workers/service/ServiceWorkerRegistration.cpp
index 4d3bc6f..f218907 100644
--- a/Source/WebCore/workers/service/ServiceWorkerRegistration.cpp
+++ b/Source/WebCore/workers/service/ServiceWorkerRegistration.cpp
@@ -238,11 +238,6 @@
return "ServiceWorkerRegistration";
}
-bool ServiceWorkerRegistration::canSuspendForDocumentSuspension() const
-{
- return true;
-}
-
void ServiceWorkerRegistration::suspend(ReasonForSuspension)
{
m_isSuspended = true;
diff --git a/Source/WebCore/workers/service/ServiceWorkerRegistration.h b/Source/WebCore/workers/service/ServiceWorkerRegistration.h
index 052665c..191fa40 100644
--- a/Source/WebCore/workers/service/ServiceWorkerRegistration.h
+++ b/Source/WebCore/workers/service/ServiceWorkerRegistration.h
@@ -91,7 +91,6 @@
// ActiveDOMObject.
const char* activeDOMObjectName() const final;
- bool canSuspendForDocumentSuspension() const final;
void suspend(ReasonForSuspension) final;
void resume() final;
void stop() final;
diff --git a/Source/WebCore/xml/XMLHttpRequest.cpp b/Source/WebCore/xml/XMLHttpRequest.cpp
index 53c4807..67ad293 100644
--- a/Source/WebCore/xml/XMLHttpRequest.cpp
+++ b/Source/WebCore/xml/XMLHttpRequest.cpp
@@ -1141,12 +1141,13 @@
dispatchErrorEvents(eventNames().timeoutEvent);
}
-bool XMLHttpRequest::canSuspendForDocumentSuspension() const
+// FIXME: This should never prevent entering the back/forward cache.
+bool XMLHttpRequest::shouldPreventEnteringBackForwardCache_DEPRECATED() const
{
// If the load event has not fired yet, cancelling the load in suspend() may cause
// the load event to be fired and arbitrary JS execution, which would be unsafe.
// Therefore, we prevent suspending in this case.
- return !m_loader || document()->loadEventFinished();
+ return m_loader && !document()->loadEventFinished();
}
const char* XMLHttpRequest::activeDOMObjectName() const
diff --git a/Source/WebCore/xml/XMLHttpRequest.h b/Source/WebCore/xml/XMLHttpRequest.h
index d70d3e9..52008c7 100644
--- a/Source/WebCore/xml/XMLHttpRequest.h
+++ b/Source/WebCore/xml/XMLHttpRequest.h
@@ -137,7 +137,7 @@
// ActiveDOMObject
void contextDestroyed() override;
- bool canSuspendForDocumentSuspension() const override;
+ bool shouldPreventEnteringBackForwardCache_DEPRECATED() const override;
void suspend(ReasonForSuspension) override;
void resume() override;
void stop() override;