Deprecate ActiveDOMObject::canSuspendForDocumentSuspension()
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 17 Oct 2019 17:35:26 +0000 (17:35 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 17 Oct 2019 17:35:26 +0000 (17:35 +0000)
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: https://svn.webkit.org/repository/webkit/trunk@251244 268f45cc-cd09-0410-ab3c-d52691b4dbfc

115 files changed:
Source/WebCore/ChangeLog
Source/WebCore/Modules/applepay/ApplePaySession.cpp
Source/WebCore/Modules/applepay/ApplePaySession.h
Source/WebCore/Modules/cache/DOMCache.cpp
Source/WebCore/Modules/cache/DOMCache.h
Source/WebCore/Modules/cache/DOMCacheStorage.cpp
Source/WebCore/Modules/cache/DOMCacheStorage.h
Source/WebCore/Modules/encryptedmedia/MediaKeySession.cpp
Source/WebCore/Modules/encryptedmedia/MediaKeySession.h
Source/WebCore/Modules/encryptedmedia/legacy/WebKitMediaKeySession.cpp
Source/WebCore/Modules/encryptedmedia/legacy/WebKitMediaKeySession.h
Source/WebCore/Modules/entriesapi/FileSystemDirectoryReader.cpp
Source/WebCore/Modules/entriesapi/FileSystemDirectoryReader.h
Source/WebCore/Modules/entriesapi/FileSystemEntry.cpp
Source/WebCore/Modules/entriesapi/FileSystemEntry.h
Source/WebCore/Modules/fetch/FetchRequest.cpp
Source/WebCore/Modules/fetch/FetchRequest.h
Source/WebCore/Modules/fetch/FetchResponse.cpp
Source/WebCore/Modules/fetch/FetchResponse.h
Source/WebCore/Modules/geolocation/Geolocation.cpp
Source/WebCore/Modules/geolocation/Geolocation.h
Source/WebCore/Modules/indexeddb/IDBDatabase.cpp
Source/WebCore/Modules/indexeddb/IDBDatabase.h
Source/WebCore/Modules/indexeddb/IDBIndex.cpp
Source/WebCore/Modules/indexeddb/IDBIndex.h
Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp
Source/WebCore/Modules/indexeddb/IDBObjectStore.h
Source/WebCore/Modules/indexeddb/IDBRequest.cpp
Source/WebCore/Modules/indexeddb/IDBRequest.h
Source/WebCore/Modules/indexeddb/IDBTransaction.cpp
Source/WebCore/Modules/indexeddb/IDBTransaction.h
Source/WebCore/Modules/mediarecorder/MediaRecorder.cpp
Source/WebCore/Modules/mediarecorder/MediaRecorder.h
Source/WebCore/Modules/mediasource/MediaSource.cpp
Source/WebCore/Modules/mediasource/MediaSource.h
Source/WebCore/Modules/mediasource/SourceBuffer.cpp
Source/WebCore/Modules/mediasource/SourceBuffer.h
Source/WebCore/Modules/mediasource/SourceBufferList.cpp
Source/WebCore/Modules/mediasource/SourceBufferList.h
Source/WebCore/Modules/mediastream/MediaDevices.cpp
Source/WebCore/Modules/mediastream/MediaDevices.h
Source/WebCore/Modules/mediastream/MediaStream.cpp
Source/WebCore/Modules/mediastream/MediaStream.h
Source/WebCore/Modules/mediastream/MediaStreamTrack.cpp
Source/WebCore/Modules/mediastream/MediaStreamTrack.h
Source/WebCore/Modules/mediastream/RTCDTMFSender.cpp
Source/WebCore/Modules/mediastream/RTCDTMFSender.h
Source/WebCore/Modules/mediastream/RTCDataChannel.h
Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp
Source/WebCore/Modules/mediastream/RTCPeerConnection.h
Source/WebCore/Modules/mediastream/UserMediaRequest.cpp
Source/WebCore/Modules/mediastream/UserMediaRequest.h
Source/WebCore/Modules/notifications/Notification.cpp
Source/WebCore/Modules/notifications/Notification.h
Source/WebCore/Modules/paymentrequest/PaymentRequest.cpp
Source/WebCore/Modules/paymentrequest/PaymentRequest.h
Source/WebCore/Modules/paymentrequest/PaymentResponse.cpp
Source/WebCore/Modules/paymentrequest/PaymentResponse.h
Source/WebCore/Modules/pictureinpicture/PictureInPictureWindow.cpp
Source/WebCore/Modules/pictureinpicture/PictureInPictureWindow.h
Source/WebCore/Modules/webaudio/AudioContext.cpp
Source/WebCore/Modules/webaudio/AudioContext.h
Source/WebCore/Modules/webdatabase/DatabaseContext.cpp
Source/WebCore/Modules/webdatabase/DatabaseContext.h
Source/WebCore/Modules/webgpu/GPUCanvasContext.h
Source/WebCore/Modules/websockets/WebSocket.cpp
Source/WebCore/Modules/websockets/WebSocket.h
Source/WebCore/Modules/webvr/VRDisplay.cpp
Source/WebCore/Modules/webvr/VRDisplay.h
Source/WebCore/animation/WebAnimation.cpp
Source/WebCore/animation/WebAnimation.h
Source/WebCore/css/FontFaceSet.cpp
Source/WebCore/css/FontFaceSet.h
Source/WebCore/dom/ActiveDOMObject.h
Source/WebCore/dom/GenericEventQueue.cpp
Source/WebCore/dom/GenericEventQueue.h
Source/WebCore/dom/MessagePort.cpp
Source/WebCore/dom/MessagePort.h
Source/WebCore/dom/ScriptExecutionContext.cpp
Source/WebCore/fileapi/FileReader.cpp
Source/WebCore/fileapi/FileReader.h
Source/WebCore/html/HTMLMarqueeElement.cpp
Source/WebCore/html/HTMLMarqueeElement.h
Source/WebCore/html/HTMLMediaElement.cpp
Source/WebCore/html/HTMLMediaElement.h
Source/WebCore/html/HTMLSourceElement.cpp
Source/WebCore/html/HTMLSourceElement.h
Source/WebCore/html/ImageBitmap.cpp
Source/WebCore/html/PublicURLManager.cpp
Source/WebCore/html/PublicURLManager.h
Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp
Source/WebCore/html/canvas/WebGLRenderingContextBase.h
Source/WebCore/html/track/TrackListBase.cpp
Source/WebCore/html/track/TrackListBase.h
Source/WebCore/page/EventSource.cpp
Source/WebCore/page/EventSource.h
Source/WebCore/page/IntersectionObserver.cpp
Source/WebCore/page/IntersectionObserver.h
Source/WebCore/page/ResizeObserver.cpp
Source/WebCore/page/ResizeObserver.h
Source/WebCore/page/SuspendableTimer.cpp
Source/WebCore/page/SuspendableTimer.h
Source/WebCore/platform/SuspendableTaskQueue.cpp
Source/WebCore/platform/SuspendableTaskQueue.h
Source/WebCore/testing/Internals.cpp
Source/WebCore/workers/Worker.cpp
Source/WebCore/workers/Worker.h
Source/WebCore/workers/service/ServiceWorker.cpp
Source/WebCore/workers/service/ServiceWorker.h
Source/WebCore/workers/service/ServiceWorkerContainer.cpp
Source/WebCore/workers/service/ServiceWorkerContainer.h
Source/WebCore/workers/service/ServiceWorkerRegistration.cpp
Source/WebCore/workers/service/ServiceWorkerRegistration.h
Source/WebCore/xml/XMLHttpRequest.cpp
Source/WebCore/xml/XMLHttpRequest.h

index 11e93bf..4e2c80e 100644 (file)
@@ -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
index 69f8e32..18fd97b 100644 (file)
@@ -823,14 +823,14 @@ const char* ApplePaySession::activeDOMObjectName() const
     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 @@ bool ApplePaySession::canSuspendForDocumentSuspension() const
     case State::ShippingContactSelected:
     case State::PaymentMethodSelected:
     case State::CancelRequested:
-        return false;
+        // FIXME: This should never prevent entering the back/forward cache.
+        return true;
     }
 }
 
index 3a92507..4e343b1 100644 (file)
@@ -102,7 +102,7 @@ private:
 
     // ActiveDOMObject.
     const char* activeDOMObjectName() const override;
-    bool canSuspendForDocumentSuspension() const override;
+    bool shouldPreventEnteringBackForwardCache_DEPRECATED() const override;
     void stop() override;
 
     // EventTargetWithInlineData.
index b9f935b..eaf06a2 100644 (file)
@@ -608,11 +608,6 @@ const char* DOMCache::activeDOMObjectName() const
     return "Cache";
 }
 
-bool DOMCache::canSuspendForDocumentSuspension() const
-{
-    return true;
-}
-
 bool DOMCache::hasPendingActivity() const
 {
     return m_taskQueue->hasPendingTasks() || ActiveDOMObject::hasPendingActivity();
index 4dc03ca..d16f822 100644 (file)
@@ -74,7 +74,6 @@ private:
     // ActiveDOMObject
     void stop() final;
     const char* activeDOMObjectName() const final;
-    bool canSuspendForDocumentSuspension() const final;
 
     void putWithResponseData(DOMPromiseDeferred<void>&&, Ref<FetchRequest>&&, Ref<FetchResponse>&&, ExceptionOr<RefPtr<SharedBuffer>>&&);
 
index 56f813f..54eee7b 100644 (file)
@@ -288,11 +288,6 @@ const char* DOMCacheStorage::activeDOMObjectName() const
     return "CacheStorage";
 }
 
-bool DOMCacheStorage::canSuspendForDocumentSuspension() const
-{
-    return true;
-}
-
 bool DOMCacheStorage::hasPendingActivity() const
 {
     return m_taskQueue->hasPendingTasks() || ActiveDOMObject::hasPendingActivity();
index 66e88b3..b230eee 100644 (file)
@@ -56,7 +56,6 @@ private:
     // 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>&&);
index 96602ed..88c8aea 100644 (file)
@@ -743,10 +743,11 @@ const char* MediaKeySession::activeDOMObjectName() const
     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()
index c4795d8..aeb5c22 100644 (file)
@@ -104,7 +104,7 @@ private:
 
     // ActiveDOMObject
     const char* activeDOMObjectName() const override;
-    bool canSuspendForDocumentSuspension() const override;
+    bool shouldPreventEnteringBackForwardCache_DEPRECATED() const override;
     void stop() override;
 
     WeakPtr<MediaKeys> m_keys;
index 9e93c7b..8ddef25 100644 (file)
@@ -251,10 +251,10 @@ const char* WebKitMediaKeySession::activeDOMObjectName() const
     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;
 }
 
 }
index 4233ace..cfdeb24 100644 (file)
@@ -78,7 +78,7 @@ private:
     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; }
index df8f393..63aa0fe 100644 (file)
@@ -53,9 +53,10 @@ const char* FileSystemDirectoryReader::activeDOMObjectName() const
     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
index fcc4919..b900de7 100644 (file)
@@ -54,7 +54,7 @@ private:
     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;
index 3c5c4f9..d2516a3 100644 (file)
@@ -60,9 +60,10 @@ const char* FileSystemEntry::activeDOMObjectName() const
     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)
index c12f327..d9763ef 100644 (file)
@@ -55,7 +55,7 @@ protected:
 
 private:
     const char* activeDOMObjectName() const final;
-    bool canSuspendForDocumentSuspension() const final;
+    bool shouldPreventEnteringBackForwardCache_DEPRECATED() const final;
 
     Ref<DOMFileSystem> m_filesystem;
     String m_name;
index 291d29b..4a9e7e3 100644 (file)
@@ -329,10 +329,10 @@ const char* FetchRequest::activeDOMObjectName() const
     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
index e85d134..b7f1636 100644 (file)
@@ -92,7 +92,7 @@ private:
     ExceptionOr<void> setBody(FetchRequest&);
 
     const char* activeDOMObjectName() const final;
-    bool canSuspendForDocumentSuspension() const final;
+    bool shouldPreventEnteringBackForwardCache_DEPRECATED() const final;
 
     ResourceRequest m_request;
     FetchOptions m_options;
index d75e8eb..eb0ce44 100644 (file)
@@ -536,10 +536,10 @@ const char* FetchResponse::activeDOMObjectName() const
     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
index f2407ff..b9a4a06 100644 (file)
@@ -118,7 +118,7 @@ private:
 
     void stop() final;
     const char* activeDOMObjectName() const final;
-    bool canSuspendForDocumentSuspension() const final;
+    bool shouldPreventEnteringBackForwardCache_DEPRECATED() const final;
 
     const ResourceResponse& filteredResponse() const;
 
index acdaf79..a256d2f 100644 (file)
@@ -157,11 +157,6 @@ Page* Geolocation::page() const
 {
     return document() ? document()->page() : nullptr;
 }
-
-bool Geolocation::canSuspendForDocumentSuspension() const
-{
-    return true;
-}
     
 void Geolocation::suspend(ReasonForSuspension reason)
 {
index 536ee41..ad2d369 100644 (file)
@@ -83,7 +83,6 @@ private:
 
     // ActiveDOMObject
     void stop() override;
-    bool canSuspendForDocumentSuspension() const override;
     void suspend(ReasonForSuspension) override;
     void resume() override;
     const char* activeDOMObjectName() const override;
index 0c7ac17..c663f87 100644 (file)
@@ -313,15 +313,6 @@ const char* IDBDatabase::activeDOMObjectName() const
     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);
index 533d34a..bfa0f4d 100644 (file)
@@ -82,7 +82,6 @@ public:
     using ThreadSafeRefCounted<IDBDatabase>::deref;
 
     const char* activeDOMObjectName() const final;
-    bool canSuspendForDocumentSuspension() const final;
     void stop() final;
 
     const IDBDatabaseInfo& info() const { return m_info; }
index 4a7f66e..d7d5930 100644 (file)
@@ -62,11 +62,6 @@ const char* IDBIndex::activeDOMObjectName() const
     return "IDBIndex";
 }
 
-bool IDBIndex::canSuspendForDocumentSuspension() const
-{
-    return true;
-}
-
 bool IDBIndex::hasPendingActivity() const
 {
     return m_objectStore.hasPendingActivity();
index f83c1f1..cf27c06 100644 (file)
@@ -99,7 +99,6 @@ private:
     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;
index a597ac1..7dc2740 100644 (file)
@@ -75,11 +75,6 @@ const char* IDBObjectStore::activeDOMObjectName() const
     return "IDBObjectStore";
 }
 
-bool IDBObjectStore::canSuspendForDocumentSuspension() const
-{
-    return true;
-}
-
 bool IDBObjectStore::hasPendingActivity() const
 {
     return m_transaction.hasPendingActivity();
index d342563..b1caf5e 100644 (file)
@@ -125,7 +125,6 @@ private:
     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;
index a2461fc..d81a056 100644 (file)
@@ -259,12 +259,6 @@ const char* IDBRequest::activeDOMObjectName() const
     return "IDBRequest";
 }
 
-bool IDBRequest::canSuspendForDocumentSuspension() const
-{
-    ASSERT(&originThread() == &Thread::current());
-    return true;
-}
-
 bool IDBRequest::hasPendingActivity() const
 {
     ASSERT(&originThread() == &Thread::current() || Thread::mayBeGCThread());
index 2a0744b..278501b 100644 (file)
@@ -157,7 +157,6 @@ private:
     EventTargetInterface eventTargetInterface() const override;
 
     const char* activeDOMObjectName() const final;
-    bool canSuspendForDocumentSuspension() const final;
     void stop() final;
     virtual void cancelForStop();
 
index f08c2ea..64e1e89 100644 (file)
@@ -323,12 +323,6 @@ const char* IDBTransaction::activeDOMObjectName() const
     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());
index 3e68407..179e15b 100644 (file)
@@ -92,7 +92,6 @@ public:
     using ThreadSafeRefCounted<IDBTransaction>::deref;
 
     const char* activeDOMObjectName() const final;
-    bool canSuspendForDocumentSuspension() const final;
     bool hasPendingActivity() const final;
     void stop() final;
 
index 6c16fbc..bc665ae 100644 (file)
@@ -104,9 +104,9 @@ const char* MediaRecorder::activeDOMObjectName() const
     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)
index 5ff5d82..8496f5a 100644 (file)
@@ -88,7 +88,7 @@ private:
     // ActiveDOMObject API.
     void stop() final;
     const char* activeDOMObjectName() const final;
-    bool canSuspendForDocumentSuspension() const final;
+    bool shouldPreventEnteringBackForwardCache_DEPRECATED() const final;
     
     void stopRecordingInternal();
     
index 8edd77c..f4558c7 100644 (file)
@@ -987,11 +987,6 @@ void MediaSource::stop()
     m_private = nullptr;
 }
 
-bool MediaSource::canSuspendForDocumentSuspension() const
-{
-    return true;
-}
-
 const char* MediaSource::activeDOMObjectName() const
 {
     return "MediaSource";
index 8a1efca..9278d7a 100644 (file)
@@ -127,7 +127,6 @@ private:
     explicit MediaSource(ScriptExecutionContext&);
 
     void stop() final;
-    bool canSuspendForDocumentSuspension() const final;
     const char* activeDOMObjectName() const final;
 
     void setPrivateAndOpen(Ref<MediaSourcePrivate>&&) final;
index 03368ee..9e287e5 100644 (file)
@@ -538,11 +538,6 @@ void SourceBuffer::stop()
     m_removeTimer.stop();
 }
 
-bool SourceBuffer::canSuspendForDocumentSuspension() const
-{
-    return true;
-}
-
 const char* SourceBuffer::activeDOMObjectName() const
 {
     return "SourceBuffer";
index 7d95122..119ffc8 100644 (file)
@@ -149,7 +149,6 @@ private:
 
     void stop() final;
     const char* activeDOMObjectName() const final;
-    bool canSuspendForDocumentSuspension() const final;
 
     void sourceBufferPrivateDidReceiveInitializationSegment(const InitializationSegment&) final;
     void sourceBufferPrivateDidReceiveSample(MediaSample&) final;
index 49a7c3b..2c478c5 100644 (file)
@@ -101,11 +101,6 @@ void SourceBufferList::scheduleEvent(const AtomString& eventName)
     m_asyncEventQueue->enqueueEvent(WTFMove(event));
 }
 
-bool SourceBufferList::canSuspendForDocumentSuspension() const
-{
-    return true;
-}
-
 const char* SourceBufferList::activeDOMObjectName() const
 {
     return "SourceBufferList";
index b41003a..9c8aaa2 100644 (file)
@@ -78,7 +78,6 @@ private:
     void refEventTarget() override { ref(); }
     void derefEventTarget() override { deref(); }
 
-    bool canSuspendForDocumentSuspension() const final;
     const char* activeDOMObjectName() const final;
 
     UniqueRef<MainThreadGenericEventQueue> m_asyncEventQueue;
index 06f1754..31b4565 100644 (file)
@@ -219,11 +219,6 @@ const char* MediaDevices::activeDOMObjectName() const
     return "MediaDevices";
 }
 
-bool MediaDevices::canSuspendForDocumentSuspension() const
-{
-    return true;
-}
-
 void MediaDevices::listenForDeviceChanges()
 {
     if (m_listeningForDeviceChanges || (!m_canAccessCamera && !m_canAccessMicrophone))
index e54c5b3..5395eb8 100644 (file)
@@ -100,7 +100,6 @@ private:
 
     // ActiveDOMObject
     const char* activeDOMObjectName() const final;
-    bool canSuspendForDocumentSuspension() const final;
     void stop() final;
     bool hasPendingActivity() const final;
 
index 8296f32..504d117 100644 (file)
@@ -400,9 +400,10 @@ const char* MediaStream::activeDOMObjectName() const
     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
index 665f109..41da762 100644 (file)
@@ -146,7 +146,7 @@ private:
     // ActiveDOMObject API.
     void stop() final;
     const char* activeDOMObjectName() const final;
-    bool canSuspendForDocumentSuspension() const final;
+    bool shouldPreventEnteringBackForwardCache_DEPRECATED() const final;
 
     void updateActiveState();
     void activityEventTimerFired();
index 955294e..44bfa9b 100644 (file)
@@ -556,9 +556,10 @@ const char* MediaStreamTrack::activeDOMObjectName() const
     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
index 6b1669d..692f083 100644 (file)
@@ -177,7 +177,7 @@ private:
     // ActiveDOMObject API.
     void stop() final;
     const char* activeDOMObjectName() const final;
-    bool canSuspendForDocumentSuspension() const final;
+    bool shouldPreventEnteringBackForwardCache_DEPRECATED() const final;
 
     // EventTarget
     void refEventTarget() final { ref(); }
index 6ff4aa5..683bbba 100644 (file)
@@ -148,9 +148,10 @@ const char* RTCDTMFSender::activeDOMObjectName() const
     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
index 345954d..719a99d 100644 (file)
@@ -58,7 +58,7 @@ private:
 
     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(); }
index 4d3662d..e39eed3 100644 (file)
@@ -94,7 +94,9 @@ private:
     // 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;
index fd120fa..09b0396 100644 (file)
@@ -498,10 +498,10 @@ const char* RTCPeerConnection::activeDOMObjectName() const
     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)
index 6087366..1872065 100644 (file)
@@ -211,7 +211,7 @@ private:
     // 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;
 
index 77a52da..5d2c6f2 100644 (file)
@@ -336,9 +336,10 @@ const char* UserMediaRequest::activeDOMObjectName() const
     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
index f2c0efc..46f1d47 100644 (file)
@@ -85,7 +85,7 @@ private:
 
     void stop() final;
     const char* activeDOMObjectName() const final;
-    bool canSuspendForDocumentSuspension() const final;
+    bool shouldPreventEnteringBackForwardCache_DEPRECATED() const final;
 
     void mediaStreamDidFail(RealtimeMediaSource::Type);
 
index f29a124..36b997f 100644 (file)
@@ -119,10 +119,10 @@ const char* Notification::activeDOMObjectName() const
     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()
index 7ff98d4..e9d2d68 100644 (file)
@@ -97,7 +97,7 @@ private:
 
     // ActiveDOMObject
     const char* activeDOMObjectName() const final;
-    bool canSuspendForDocumentSuspension() const final;
+    bool shouldPreventEnteringBackForwardCache_DEPRECATED() const final;
     void stop() final;
 
     void refEventTarget() final { ref(); }
index cc0774b..00f1493 100644 (file)
@@ -539,9 +539,10 @@ Optional<PaymentShippingType> PaymentRequest::shippingType() const
     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)
index 7f1b52f..40a5ea2 100644 (file)
@@ -126,7 +126,7 @@ private:
 
     // ActiveDOMObject
     const char* activeDOMObjectName() const final { return "PaymentRequest"; }
-    bool canSuspendForDocumentSuspension() const final;
+    bool shouldPreventEnteringBackForwardCache_DEPRECATED() const final;
     void stop() final;
 
     // EventTarget
index 98b5d6c..1692dc0 100644 (file)
@@ -125,10 +125,11 @@ void PaymentResponse::settleRetryPromise(ExceptionOr<void>&& result)
     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()
index 9ae9f85..fe79a6d 100644 (file)
@@ -98,7 +98,7 @@ private:
 
     // ActiveDOMObject
     const char* activeDOMObjectName() const final { return "PaymentResponse"; }
-    bool canSuspendForDocumentSuspension() const final;
+    bool shouldPreventEnteringBackForwardCache_DEPRECATED() const final;
     void stop() final;
 
     // EventTarget
index 49ec747..a000f17 100644 (file)
@@ -54,11 +54,6 @@ const char* PictureInPictureWindow::activeDOMObjectName() const
     return "PictureInPictureWindow";
 }
 
-bool PictureInPictureWindow::canSuspendForDocumentSuspension() const
-{
-    return true;
-}
-
 EventTargetInterface PictureInPictureWindow::eventTargetInterface() const
 {
     return PictureInPictureWindowEventTargetInterfaceType;
index 7ae5a6b..231bf53 100644 (file)
@@ -48,7 +48,6 @@ public:
 
     // ActiveDOMObject
     const char* activeDOMObjectName() const final;
-    bool canSuspendForDocumentSuspension() const final;
 
     using RefCounted<PictureInPictureWindow>::ref;
     using RefCounted<PictureInPictureWindow>::deref;
index dd2e5ce..66f2208 100644 (file)
@@ -340,10 +340,10 @@ void AudioContext::stop()
     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
index e466f45..762c13b 100644 (file)
@@ -339,7 +339,7 @@ private:
 
     // 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.
index 2012f75..1fb061f 100644 (file)
@@ -130,12 +130,13 @@ void DatabaseContext::stop()
     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()
index 7dd4b9e..bef5520 100644 (file)
@@ -73,7 +73,7 @@ private:
 
     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;
index cd818ce..1bb270b 100644 (file)
@@ -60,7 +60,7 @@ private:
     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;
 };
index b32bf98..94403f2 100644 (file)
@@ -495,11 +495,6 @@ void WebSocket::contextDestroyed()
     ActiveDOMObject::contextDestroyed();
 }
 
-bool WebSocket::canSuspendForDocumentSuspension() const
-{
-    return true;
-}
-
 void WebSocket::suspend(ReasonForSuspension reason)
 {
     if (m_resumeTimer.isActive())
index 86efff7..abd225b 100644 (file)
@@ -106,7 +106,6 @@ private:
     void dispatchOrQueueEvent(Ref<Event>&&);
 
     void contextDestroyed() final;
-    bool canSuspendForDocumentSuspension() const final;
     void suspend(ReasonForSuspension) final;
     void resume() final;
     void stop() final;
index 806a7ab..cf588ed 100644 (file)
@@ -239,9 +239,10 @@ const char* VRDisplay::activeDOMObjectName() const
     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()
index 1cd75d8..e088cd1 100644 (file)
@@ -106,7 +106,7 @@ private:
 
     // ActiveDOMObject
     const char* activeDOMObjectName() const override;
-    bool canSuspendForDocumentSuspension() const override;
+    bool shouldPreventEnteringBackForwardCache_DEPRECATED() const override;
     void stop() override;
 
     void stopPresenting();
index 5f0c900..39f6b34 100644 (file)
@@ -1157,12 +1157,13 @@ const char* WebAnimation::activeDOMObjectName() const
     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()
index 20b4cca..d4159df 100644 (file)
@@ -197,7 +197,7 @@ private:
 
     // ActiveDOMObject.
     const char* activeDOMObjectName() const final;
-    bool canSuspendForDocumentSuspension() const final;
+    bool shouldPreventEnteringBackForwardCache_DEPRECATED() const final;
 
     // EventTarget
     EventTargetInterface eventTargetInterface() const final { return WebAnimationEventTargetInterfaceType; }
index def3a94..c625fbe 100644 (file)
@@ -192,11 +192,6 @@ auto FontFaceSet::status() const -> LoadStatus
     return LoadStatus::Loaded;
 }
 
-bool FontFaceSet::canSuspendForDocumentSuspension() const
-{
-    return true;
-}
-
 void FontFaceSet::startedLoading()
 {
     // FIXME: Fire a "loading" event asynchronously.
index 9f728ef..a102f80 100644 (file)
@@ -105,7 +105,6 @@ private:
 
     // ActiveDOMObject
     const char* activeDOMObjectName() const final { return "FontFaceSet"; }
-    bool canSuspendForDocumentSuspension() const final;
 
     // EventTarget
     EventTargetInterface eventTargetInterface() const final { return FontFaceSetEventTargetInterfaceType; }
index 6b8b986..5aa5954 100644 (file)
@@ -52,10 +52,6 @@ public:
 
     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 @@ public:
 
     // 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();
 
index 2211b9b..82c2b8f 100644 (file)
@@ -133,12 +133,6 @@ void GenericEventQueueBase<T>::setPaused(bool shouldPause)
 }
 
 template<typename T>
-bool GenericEventQueueBase<T>::canSuspendForDocumentSuspension() const
-{
-    return true;
-}
-
-template<typename T>
 void GenericEventQueueBase<T>::suspend(ReasonForSuspension)
 {
     if (m_isSuspended)
index ccd1064..5375d55 100644 (file)
@@ -61,7 +61,6 @@ private:
     void dispatchOneEvent();
 
     const char* activeDOMObjectName() const final;
-    bool canSuspendForDocumentSuspension() const final;
     void stop() final;
     void suspend(ReasonForSuspension) final;
     void resume() final;
index 1d50402..369562c 100644 (file)
@@ -413,9 +413,4 @@ const char* MessagePort::activeDOMObjectName() const
     return "MessagePort";
 }
 
-bool MessagePort::canSuspendForDocumentSuspension() const
-{
-    return true;
-}
-
 } // namespace WebCore
index 0b5f3d8..a136a56 100644 (file)
@@ -85,7 +85,6 @@ public:
 
     // ActiveDOMObject
     const char* activeDOMObjectName() const final;
-    bool canSuspendForDocumentSuspension() const final;
     void contextDestroyed() final;
     void stop() final { close(); }
     bool hasPendingActivity() const final;
index 3ea9b38..ca5c5a2 100644 (file)
@@ -229,7 +229,7 @@ bool ScriptExecutionContext::canSuspendActiveDOMObjectsForDocumentSuspension(Vec
     bool canSuspend = true;
 
     forEachActiveDOMObject([&](auto& activeDOMObject) {
-        if (!activeDOMObject.canSuspendForDocumentSuspension()) {
+        if (activeDOMObject.shouldPreventEnteringBackForwardCache_DEPRECATED()) {
             canSuspend = false;
             if (unsuspendableObjects)
                 unsuspendableObjects->append(&activeDOMObject);
index 99a7b5c..62438cd 100644 (file)
@@ -65,9 +65,10 @@ FileReader::~FileReader()
         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
index effdb29..c0b7df7 100644 (file)
@@ -78,7 +78,7 @@ private:
     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; }
index 1679e9b..0adf7d1 100644 (file)
@@ -159,11 +159,6 @@ ExceptionOr<void> HTMLMarqueeElement::setLoop(int loop)
     return { };
 }
 
-bool HTMLMarqueeElement::canSuspendForDocumentSuspension() const
-{
-    return true;
-}
-
 void HTMLMarqueeElement::suspend(ReasonForSuspension)
 {
     if (RenderMarquee* marqueeRenderer = renderMarquee())
index 05818a5..a2f2e54 100644 (file)
@@ -57,7 +57,6 @@ private:
     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"; }
index 9fa738a..fdecb87 100644 (file)
@@ -5663,11 +5663,6 @@ void HTMLMediaElement::clearMediaPlayer()
     updateSleepDisabling();
 }
 
-bool HTMLMediaElement::canSuspendForDocumentSuspension() const
-{
-    return true;
-}
-
 const char* HTMLMediaElement::activeDOMObjectName() const
 {
     return "HTMLMediaElement";
index 32a240a..f482d21 100644 (file)
@@ -633,7 +633,6 @@ private:
 
     // ActiveDOMObject API.
     const char* activeDOMObjectName() const override;
-    bool canSuspendForDocumentSuspension() const override;
     void suspend(ReasonForSuspension) override;
     void resume() override;
     void stop() override;
index dd5d85c..4216e97 100644 (file)
@@ -127,11 +127,6 @@ const char* HTMLSourceElement::activeDOMObjectName() const
     return "HTMLSourceElement";
 }
 
-bool HTMLSourceElement::canSuspendForDocumentSuspension() const
-{
-    return true;
-}
-
 void HTMLSourceElement::suspend(ReasonForSuspension reason)
 {
     // FIXME: Shouldn't this also stop the timer for PageWillBeSuspended?
index 8765871..4df0af5 100644 (file)
@@ -52,7 +52,6 @@ private:
 
     // ActiveDOMObject.
     const char* activeDOMObjectName() const final;
-    bool canSuspendForDocumentSuspension() const final;
     void suspend(ReasonForSuspension) final;
     void resume() final;
     void stop() final;
index ba4bf1e..f2e6340 100644 (file)
@@ -561,11 +561,6 @@ private:
         return "PendingImageBitmap";
     }
 
-    bool canSuspendForDocumentSuspension() const final
-    {
-        return true;
-    }
-
     void stop() final
     {
         delete this;
index d2f96d4..8f5fcf5 100644 (file)
@@ -81,12 +81,6 @@ void PublicURLManager::stop()
     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";
index 9bfe73e..0ecb7ed 100644 (file)
@@ -50,7 +50,6 @@ public:
 private:
     // ActiveDOMObject API.
     void stop() override;
-    bool canSuspendForDocumentSuspension() const override;
     const char* activeDOMObjectName() const override;
     
     typedef HashSet<String> URLSet;
index de47ae7..626246f 100644 (file)
@@ -5208,11 +5208,6 @@ const char* WebGLRenderingContextBase::activeDOMObjectName() const
     return "WebGLRenderingContext";
 }
 
-bool WebGLRenderingContextBase::canSuspendForDocumentSuspension() const
-{
-    return true;
-}
-
 void WebGLRenderingContextBase::suspend(ReasonForSuspension)
 {
     m_isSuspended = true;
index b172538..6ca2ac6 100644 (file)
@@ -393,7 +393,6 @@ protected:
     // ActiveDOMObject
     void stop() override;
     const char* activeDOMObjectName() const override;
-    bool canSuspendForDocumentSuspension() const override;
     void suspend(ReasonForSuspension) override;
     void resume() override;
 
index 9003e9c..4518d7f 100644 (file)
@@ -178,11 +178,6 @@ bool TrackListBase::isAnyTrackEnabled() const
     return false;
 }
 
-bool TrackListBase::canSuspendForDocumentSuspension() const
-{
-    return true;
-}
-
 } // namespace WebCore
 
 #endif
index 4255bc1..a3b1aa7 100644 (file)
@@ -75,8 +75,6 @@ protected:
 private:
     void scheduleTrackEvent(const AtomString& eventName, Ref<TrackBase>&&);
 
-    bool canSuspendForDocumentSuspension() const final;
-
     // EventTarget
     void refEventTarget() final { ref(); }
     void derefEventTarget() final { deref(); }
index f1f5b32..757765c 100644 (file)
@@ -403,11 +403,6 @@ const char* EventSource::activeDOMObjectName() const
     return "EventSource";
 }
 
-bool EventSource::canSuspendForDocumentSuspension() const
-{
-    return true;
-}
-
 void EventSource::suspend(ReasonForSuspension reason)
 {
     if (reason != ReasonForSuspension::BackForwardCache)
index 3559144..ce2530f 100644 (file)
@@ -91,7 +91,6 @@ private:
     // ActiveDOMObject
     void stop() final;
     const char* activeDOMObjectName() const final;
-    bool canSuspendForDocumentSuspension() const final;
     void suspend(ReasonForSuspension) final;
     void resume() final;
 
index f9fb287..cea487f 100644 (file)
@@ -279,11 +279,6 @@ const char* IntersectionObserver::activeDOMObjectName() const
     return "IntersectionObserver";
 }
 
-bool IntersectionObserver::canSuspendForDocumentSuspension() const
-{
-    return true;
-}
-
 void IntersectionObserver::stop()
 {
     disconnect();
index 7c9854b..d4b902e 100644 (file)
@@ -101,7 +101,6 @@ public:
     // ActiveDOMObject.
     bool hasPendingActivity() const override;
     const char* activeDOMObjectName() const override;
-    bool canSuspendForDocumentSuspension() const override;
     void stop() override;
 
 private:
index cbe5168..cf61f8c 100644 (file)
@@ -171,11 +171,6 @@ const char* ResizeObserver::activeDOMObjectName() const
     return "ResizeObserver";
 }
 
-bool ResizeObserver::canSuspendForDocumentSuspension() const
-{
-    return true;
-}
-
 void ResizeObserver::stop()
 {
     disconnect();
index eeebf9b..69cac88 100644 (file)
@@ -67,7 +67,6 @@ public:
     // ActiveDOMObject.
     bool hasPendingActivity() const override;
     const char* activeDOMObjectName() const override;
-    bool canSuspendForDocumentSuspension() const override;
     void stop() override;
 
 private:
index e7e517b..844e001 100644 (file)
@@ -78,11 +78,6 @@ void SuspendableTimerBase::resume()
         start(m_savedNextFireInterval, m_savedRepeatInterval);
 }
 
-bool SuspendableTimerBase::canSuspendForDocumentSuspension() const
-{
-    return true;
-}
-
 void SuspendableTimerBase::didStop()
 {
 }
index f3ef123..3be62e4 100644 (file)
@@ -67,7 +67,6 @@ private:
     // ActiveDOMObject API.
     bool hasPendingActivity() const final;
     void stop() final;
-    bool canSuspendForDocumentSuspension() const final;
     void suspend(ReasonForSuspension) final;
     void resume() final;
 
index 9cee4f4..046aaab 100644 (file)
@@ -81,11 +81,6 @@ const char* SuspendableTaskQueue::activeDOMObjectName() const
     return "SuspendableTaskQueue";
 }
 
-bool SuspendableTaskQueue::canSuspendForDocumentSuspension() const
-{
-    return true;
-}
-
 void SuspendableTaskQueue::stop()
 {
     close();
index b128991..b3260f4 100644 (file)
@@ -70,7 +70,6 @@ private:
 
     // ActiveDOMObject.
     const char* activeDOMObjectName() const final;
-    bool canSuspendForDocumentSuspension() const final;
     void stop() final;
     void suspend(ReasonForSuspension) final;
     void resume() final;
index f3c7e3e..97389d3 100644 (file)
@@ -944,7 +944,7 @@ private:
         suspendIfNeeded();
     }
 
-    bool canSuspendForDocumentSuspension() const final { return false; }
+    bool shouldPreventEnteringBackForwardCache_DEPRECATED() const final { return true; }
     const char* activeDOMObjectName() const { return "UnsuspendableActiveDOMObject"; }
 };
 
index e38eee3..0f5078e 100644 (file)
@@ -150,11 +150,6 @@ void Worker::terminate()
     m_eventQueue->cancelAllEvents();
 }
 
-bool Worker::canSuspendForDocumentSuspension() const
-{
-    return true;
-}
-
 const char* Worker::activeDOMObjectName() const
 {
     return "Worker";
index 8e3bfa8..4c54139 100644 (file)
@@ -83,7 +83,6 @@ private:
     void didReceiveResponse(unsigned long identifier, const ResourceResponse&) final;
     void notifyFinished() final;
 
-    bool canSuspendForDocumentSuspension() const final;
     void stop() final;
     const char* activeDOMObjectName() const final;
 
index d401a5d..42a5ab0 100644 (file)
@@ -144,11 +144,6 @@ const char* ServiceWorker::activeDOMObjectName() const
     return "ServiceWorker";
 }
 
-bool ServiceWorker::canSuspendForDocumentSuspension() const
-{
-    return true;
-}
-
 void ServiceWorker::suspend(ReasonForSuspension)
 {
     m_isSuspended = true;
index 47ec0ca..67567e5 100644 (file)
@@ -76,7 +76,6 @@ private:
 
     // ActiveDOMObject.
     const char* activeDOMObjectName() const final;
-    bool canSuspendForDocumentSuspension() const final;
     void suspend(ReasonForSuspension) final;
     void resume() final;
     void stop() final;
index ea23fe9..ef9ff3e 100644 (file)
@@ -513,11 +513,6 @@ const char* ServiceWorkerContainer::activeDOMObjectName() const
     return "ServiceWorkerContainer";
 }
 
-bool ServiceWorkerContainer::canSuspendForDocumentSuspension() const
-{
-    return true;
-}
-
 SWClientConnection& ServiceWorkerContainer::ensureSWClientConnection()
 {
     ASSERT(scriptExecutionContext());
index 461e70e..d11db4e 100644 (file)
@@ -113,7 +113,6 @@ private:
 
     // ActiveDOMObject.
     const char* activeDOMObjectName() const final;
-    bool canSuspendForDocumentSuspension() const final;
     
     ScriptExecutionContext* scriptExecutionContext() const final { return ActiveDOMObject::scriptExecutionContext(); }
     EventTargetInterface eventTargetInterface() const final { return ServiceWorkerContainerEventTargetInterfaceType; }
index 4d3bc6f..f218907 100644 (file)
@@ -238,11 +238,6 @@ const char* ServiceWorkerRegistration::activeDOMObjectName() const
     return "ServiceWorkerRegistration";
 }
 
-bool ServiceWorkerRegistration::canSuspendForDocumentSuspension() const
-{
-    return true;
-}
-
 void ServiceWorkerRegistration::suspend(ReasonForSuspension)
 {
     m_isSuspended = true;
index 052665c..191fa40 100644 (file)
@@ -91,7 +91,6 @@ private:
 
     // ActiveDOMObject.
     const char* activeDOMObjectName() const final;
-    bool canSuspendForDocumentSuspension() const final;
     void suspend(ReasonForSuspension) final;
     void resume() final;
     void stop() final;
index 53c4807..67ad293 100644 (file)
@@ -1141,12 +1141,13 @@ void XMLHttpRequest::didReachTimeout()
     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
index d70d3e9..52008c7 100644 (file)
@@ -137,7 +137,7 @@ private:
 
     // ActiveDOMObject
     void contextDestroyed() override;
-    bool canSuspendForDocumentSuspension() const override;
+    bool shouldPreventEnteringBackForwardCache_DEPRECATED() const override;
     void suspend(ReasonForSuspension) override;
     void resume() override;
     void stop() override;