WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
bug-203086-20191017092447.patch (text/plain), 88.14 KB, created by
Chris Dumez
on 2019-10-17 09:24:48 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Chris Dumez
Created:
2019-10-17 09:24:48 PDT
Size:
88.14 KB
patch
obsolete
>Subversion Revision: 251233 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 71c789f4f2a43022065740e7385057f9b48fe9d4..5581e127a766976c428abd14870ac7dc2d0483e4 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 NOBODY (OOPS!). >+ >+ 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 Youenn Fablet <youenn@apple.com> > > MultiChannelResampler does not need to recreate a ChannelProvider for every process call >diff --git a/Source/WebCore/Modules/applepay/ApplePaySession.cpp b/Source/WebCore/Modules/applepay/ApplePaySession.cpp >index 69f8e32d6082d2f3a3a5e050c372498dafc30054..18fd97ba8e2ea1ae8686d5a6e0a981622e525d85 100644 >--- a/Source/WebCore/Modules/applepay/ApplePaySession.cpp >+++ b/Source/WebCore/Modules/applepay/ApplePaySession.cpp >@@ -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; > } > } > >diff --git a/Source/WebCore/Modules/applepay/ApplePaySession.h b/Source/WebCore/Modules/applepay/ApplePaySession.h >index 3a92507cfe7eb37f233ca0662f81d49734a81f07..4e343b10cd300572d245ca1ed6054cca83ae2b1f 100644 >--- a/Source/WebCore/Modules/applepay/ApplePaySession.h >+++ b/Source/WebCore/Modules/applepay/ApplePaySession.h >@@ -102,7 +102,7 @@ private: > > // 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 b9f935b806700d29b4821df9b602a4db8ab3196d..eaf06a2810fd971dd6b8c151c51aef138283bcca 100644 >--- a/Source/WebCore/Modules/cache/DOMCache.cpp >+++ b/Source/WebCore/Modules/cache/DOMCache.cpp >@@ -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(); >diff --git a/Source/WebCore/Modules/cache/DOMCache.h b/Source/WebCore/Modules/cache/DOMCache.h >index 4dc03ca57290c0e5f89a8dbc464b9efc429a42fe..d16f82215c4f1d898c1d756424e8037a9d33d7cd 100644 >--- a/Source/WebCore/Modules/cache/DOMCache.h >+++ b/Source/WebCore/Modules/cache/DOMCache.h >@@ -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>>&&); > >diff --git a/Source/WebCore/Modules/cache/DOMCacheStorage.cpp b/Source/WebCore/Modules/cache/DOMCacheStorage.cpp >index 56f813f5884ae6afb3a9ee192ff818bfbce121c3..54eee7b520f6a04cd1b7d9dbcbe4d0ee78c178d2 100644 >--- a/Source/WebCore/Modules/cache/DOMCacheStorage.cpp >+++ b/Source/WebCore/Modules/cache/DOMCacheStorage.cpp >@@ -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(); >diff --git a/Source/WebCore/Modules/cache/DOMCacheStorage.h b/Source/WebCore/Modules/cache/DOMCacheStorage.h >index 66e88b3687c2c9e2a278b8599ffad9fb7dfb68e1..b230eeeb5058d7e0b7a1fdb4e82db89b6e021821 100644 >--- a/Source/WebCore/Modules/cache/DOMCacheStorage.h >+++ b/Source/WebCore/Modules/cache/DOMCacheStorage.h >@@ -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>&&); >diff --git a/Source/WebCore/Modules/encryptedmedia/MediaKeySession.cpp b/Source/WebCore/Modules/encryptedmedia/MediaKeySession.cpp >index 96602ed2e5becaa1556a5a1f49ab7feb3c081920..88c8aea44cb9cf79d739e51e5323d11356ca3faf 100644 >--- a/Source/WebCore/Modules/encryptedmedia/MediaKeySession.cpp >+++ b/Source/WebCore/Modules/encryptedmedia/MediaKeySession.cpp >@@ -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() >diff --git a/Source/WebCore/Modules/encryptedmedia/MediaKeySession.h b/Source/WebCore/Modules/encryptedmedia/MediaKeySession.h >index c4795d8256301ae873425a9a1be06e3b081a0fbf..aeb5c22ee84cd063d19e564ad96567da1f74ec57 100644 >--- a/Source/WebCore/Modules/encryptedmedia/MediaKeySession.h >+++ b/Source/WebCore/Modules/encryptedmedia/MediaKeySession.h >@@ -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; >diff --git a/Source/WebCore/Modules/encryptedmedia/legacy/WebKitMediaKeySession.cpp b/Source/WebCore/Modules/encryptedmedia/legacy/WebKitMediaKeySession.cpp >index 9e93c7b2861e64080694acfa3fff34299b9670c4..8ddef257dfe0f47a654278b94d4ac88d933bb59f 100644 >--- a/Source/WebCore/Modules/encryptedmedia/legacy/WebKitMediaKeySession.cpp >+++ b/Source/WebCore/Modules/encryptedmedia/legacy/WebKitMediaKeySession.cpp >@@ -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; > } > > } >diff --git a/Source/WebCore/Modules/encryptedmedia/legacy/WebKitMediaKeySession.h b/Source/WebCore/Modules/encryptedmedia/legacy/WebKitMediaKeySession.h >index 4233ace2675c45fbb6060fc0b095b8acf7947520..cfdeb24865eeedb3c6069064402693499d236023 100644 >--- a/Source/WebCore/Modules/encryptedmedia/legacy/WebKitMediaKeySession.h >+++ b/Source/WebCore/Modules/encryptedmedia/legacy/WebKitMediaKeySession.h >@@ -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; } >diff --git a/Source/WebCore/Modules/entriesapi/FileSystemDirectoryReader.cpp b/Source/WebCore/Modules/entriesapi/FileSystemDirectoryReader.cpp >index df8f3938b674f33396c295eb4b7acb34dfc3d6fd..63aa0fea90957d53ae64b8527056914e29d5af57 100644 >--- a/Source/WebCore/Modules/entriesapi/FileSystemDirectoryReader.cpp >+++ b/Source/WebCore/Modules/entriesapi/FileSystemDirectoryReader.cpp >@@ -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 >diff --git a/Source/WebCore/Modules/entriesapi/FileSystemDirectoryReader.h b/Source/WebCore/Modules/entriesapi/FileSystemDirectoryReader.h >index fcc49195737ad96c086b1003eaa56d53cb0016ad..b900de7371a41bf201edf9d856173f5d87d18463 100644 >--- a/Source/WebCore/Modules/entriesapi/FileSystemDirectoryReader.h >+++ b/Source/WebCore/Modules/entriesapi/FileSystemDirectoryReader.h >@@ -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; >diff --git a/Source/WebCore/Modules/entriesapi/FileSystemEntry.cpp b/Source/WebCore/Modules/entriesapi/FileSystemEntry.cpp >index 3c5c4f9983d0c148d089270d87b4f7eb6b6bd02f..d2516a37245cfc7d20d089a270ea43fd267c1f64 100644 >--- a/Source/WebCore/Modules/entriesapi/FileSystemEntry.cpp >+++ b/Source/WebCore/Modules/entriesapi/FileSystemEntry.cpp >@@ -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) >diff --git a/Source/WebCore/Modules/entriesapi/FileSystemEntry.h b/Source/WebCore/Modules/entriesapi/FileSystemEntry.h >index c12f32751c900dcb1696993f465962c0e2ff45ae..d9763effeb0b6f1425406a030768b2a96a30080e 100644 >--- a/Source/WebCore/Modules/entriesapi/FileSystemEntry.h >+++ b/Source/WebCore/Modules/entriesapi/FileSystemEntry.h >@@ -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; >diff --git a/Source/WebCore/Modules/fetch/FetchRequest.cpp b/Source/WebCore/Modules/fetch/FetchRequest.cpp >index 291d29bf83bc3fed823affef1186e9cc856d7fa7..4a9e7e33b01014064a3c16639e3ec5c013275d6d 100644 >--- a/Source/WebCore/Modules/fetch/FetchRequest.cpp >+++ b/Source/WebCore/Modules/fetch/FetchRequest.cpp >@@ -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 >diff --git a/Source/WebCore/Modules/fetch/FetchRequest.h b/Source/WebCore/Modules/fetch/FetchRequest.h >index e85d1347cf0747c37f05c7b52420c7eab4aa1a2b..b7f16367961691187d7e5da7fadcb79763212471 100644 >--- a/Source/WebCore/Modules/fetch/FetchRequest.h >+++ b/Source/WebCore/Modules/fetch/FetchRequest.h >@@ -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; >diff --git a/Source/WebCore/Modules/fetch/FetchResponse.cpp b/Source/WebCore/Modules/fetch/FetchResponse.cpp >index d75e8eb23d823cdab40f7d34619b32e4f5484923..eb0ce442e8efbbff04f9c20322ead975bcf3c7d4 100644 >--- a/Source/WebCore/Modules/fetch/FetchResponse.cpp >+++ b/Source/WebCore/Modules/fetch/FetchResponse.cpp >@@ -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 >diff --git a/Source/WebCore/Modules/fetch/FetchResponse.h b/Source/WebCore/Modules/fetch/FetchResponse.h >index f2407ffed5421d23ef7542e40d2f6449b2d84780..b9a4a065718934b6c6f04a90ab2f19e9abd12c0b 100644 >--- a/Source/WebCore/Modules/fetch/FetchResponse.h >+++ b/Source/WebCore/Modules/fetch/FetchResponse.h >@@ -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; > >diff --git a/Source/WebCore/Modules/geolocation/Geolocation.cpp b/Source/WebCore/Modules/geolocation/Geolocation.cpp >index acdaf79e3e133cced5e47b8a5659bb2441f195f4..a256d2f8a42548c42ae3c955d9502cc0ad893d91 100644 >--- a/Source/WebCore/Modules/geolocation/Geolocation.cpp >+++ b/Source/WebCore/Modules/geolocation/Geolocation.cpp >@@ -157,11 +157,6 @@ Page* Geolocation::page() const > { > 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 536ee41f8ded4206a2e79174aacf8abae7ed0590..ad2d3698a482766438aec35ac5a717842881b88f 100644 >--- a/Source/WebCore/Modules/geolocation/Geolocation.h >+++ b/Source/WebCore/Modules/geolocation/Geolocation.h >@@ -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; >diff --git a/Source/WebCore/Modules/indexeddb/IDBDatabase.cpp b/Source/WebCore/Modules/indexeddb/IDBDatabase.cpp >index 0c7ac174d6894ae9eae2558ba2fffd454b8d9679..c663f87bb66a0e35ef767d631b87d6ca356e92b5 100644 >--- a/Source/WebCore/Modules/indexeddb/IDBDatabase.cpp >+++ b/Source/WebCore/Modules/indexeddb/IDBDatabase.cpp >@@ -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); >diff --git a/Source/WebCore/Modules/indexeddb/IDBDatabase.h b/Source/WebCore/Modules/indexeddb/IDBDatabase.h >index 533d34a3f75e8c1810f912f537096ad6fde7c1fc..bfa0f4d6c110a6ffc80a4449463fec3834835a0a 100644 >--- a/Source/WebCore/Modules/indexeddb/IDBDatabase.h >+++ b/Source/WebCore/Modules/indexeddb/IDBDatabase.h >@@ -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; } >diff --git a/Source/WebCore/Modules/indexeddb/IDBIndex.cpp b/Source/WebCore/Modules/indexeddb/IDBIndex.cpp >index 4a7f66e85820aa4922dcb283c5cac0cc6ada3a53..d7d5930d9d245ebc95519c8d4d66bd76b26e17c5 100644 >--- a/Source/WebCore/Modules/indexeddb/IDBIndex.cpp >+++ b/Source/WebCore/Modules/indexeddb/IDBIndex.cpp >@@ -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(); >diff --git a/Source/WebCore/Modules/indexeddb/IDBIndex.h b/Source/WebCore/Modules/indexeddb/IDBIndex.h >index f83c1f117d6a099d7370c799a6ecbcd994c33e58..cf27c06265c62af6cad394a9a53f4136aee324ad 100644 >--- a/Source/WebCore/Modules/indexeddb/IDBIndex.h >+++ b/Source/WebCore/Modules/indexeddb/IDBIndex.h >@@ -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; >diff --git a/Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp b/Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp >index a597ac19b63b888c122f9283a7dca2ef974fee20..7dc274000f2d6c68c14cc2480aa3169859a0028e 100644 >--- a/Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp >+++ b/Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp >@@ -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(); >diff --git a/Source/WebCore/Modules/indexeddb/IDBObjectStore.h b/Source/WebCore/Modules/indexeddb/IDBObjectStore.h >index d342563da8e44304f3feb6bf8be85598c157cfb5..b1caf5ec35811b44b569a531f116bff9cffccdda 100644 >--- a/Source/WebCore/Modules/indexeddb/IDBObjectStore.h >+++ b/Source/WebCore/Modules/indexeddb/IDBObjectStore.h >@@ -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; >diff --git a/Source/WebCore/Modules/indexeddb/IDBRequest.cpp b/Source/WebCore/Modules/indexeddb/IDBRequest.cpp >index a2461fc3f71a24ae9c828d88b78702c47f60dd6e..d81a0569308ad191c629f5402a7527f04d0a38ed 100644 >--- a/Source/WebCore/Modules/indexeddb/IDBRequest.cpp >+++ b/Source/WebCore/Modules/indexeddb/IDBRequest.cpp >@@ -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()); >diff --git a/Source/WebCore/Modules/indexeddb/IDBRequest.h b/Source/WebCore/Modules/indexeddb/IDBRequest.h >index 2a0744b97f76f6b5d818b18df815ec592143021f..278501ba60e9de030281d8cb2f110678b0c9b8b3 100644 >--- a/Source/WebCore/Modules/indexeddb/IDBRequest.h >+++ b/Source/WebCore/Modules/indexeddb/IDBRequest.h >@@ -157,7 +157,6 @@ private: > 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 f08c2ea07c3e4b376e3da80e51c6ecbcd2a317c6..64e1e8909de2c49f0a7956c2283cd34cf0701fde 100644 >--- a/Source/WebCore/Modules/indexeddb/IDBTransaction.cpp >+++ b/Source/WebCore/Modules/indexeddb/IDBTransaction.cpp >@@ -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()); >diff --git a/Source/WebCore/Modules/indexeddb/IDBTransaction.h b/Source/WebCore/Modules/indexeddb/IDBTransaction.h >index 3e6840711ba8493a0a0b71879aae6a6a0512b46f..179e15b7ea042295e44ffa6d504539825d55f510 100644 >--- a/Source/WebCore/Modules/indexeddb/IDBTransaction.h >+++ b/Source/WebCore/Modules/indexeddb/IDBTransaction.h >@@ -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; > >diff --git a/Source/WebCore/Modules/mediarecorder/MediaRecorder.cpp b/Source/WebCore/Modules/mediarecorder/MediaRecorder.cpp >index 6c16fbc92dca82071f22dc5b60ff936dd1e8164b..bc665aeb8898c02a8be5569d4571a71718a9b1d1 100644 >--- a/Source/WebCore/Modules/mediarecorder/MediaRecorder.cpp >+++ b/Source/WebCore/Modules/mediarecorder/MediaRecorder.cpp >@@ -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) >diff --git a/Source/WebCore/Modules/mediarecorder/MediaRecorder.h b/Source/WebCore/Modules/mediarecorder/MediaRecorder.h >index 5ff5d82c1d47e68d2e61576cb6699c5dd189dea1..8496f5aaf642dcf7cd33beff0db5dfa23466a232 100644 >--- a/Source/WebCore/Modules/mediarecorder/MediaRecorder.h >+++ b/Source/WebCore/Modules/mediarecorder/MediaRecorder.h >@@ -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(); > >diff --git a/Source/WebCore/Modules/mediasource/MediaSource.cpp b/Source/WebCore/Modules/mediasource/MediaSource.cpp >index 8edd77cd5bde020a4e2bf6098cb7a8f546592334..f4558c7319329b3d444c2dc34bc4b80775746be0 100644 >--- a/Source/WebCore/Modules/mediasource/MediaSource.cpp >+++ b/Source/WebCore/Modules/mediasource/MediaSource.cpp >@@ -987,11 +987,6 @@ void MediaSource::stop() > 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 8a1efca228f1d95c8607fc3e89b399082eeca0c5..9278d7a265afd11ca8eb96350a37162069286dae 100644 >--- a/Source/WebCore/Modules/mediasource/MediaSource.h >+++ b/Source/WebCore/Modules/mediasource/MediaSource.h >@@ -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; >diff --git a/Source/WebCore/Modules/mediasource/SourceBuffer.cpp b/Source/WebCore/Modules/mediasource/SourceBuffer.cpp >index 03368ee7fd246f3a67a4d7c3fa67568d211c6a6a..9e287e5ef7661bd4650fb099e5c5f4df794baf47 100644 >--- a/Source/WebCore/Modules/mediasource/SourceBuffer.cpp >+++ b/Source/WebCore/Modules/mediasource/SourceBuffer.cpp >@@ -538,11 +538,6 @@ void SourceBuffer::stop() > 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 7d951222877a4f5a28ff9302268ea82107f3ba43..119ffc8bc01ee2e8047f6e55b72dd79368524272 100644 >--- a/Source/WebCore/Modules/mediasource/SourceBuffer.h >+++ b/Source/WebCore/Modules/mediasource/SourceBuffer.h >@@ -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; >diff --git a/Source/WebCore/Modules/mediasource/SourceBufferList.cpp b/Source/WebCore/Modules/mediasource/SourceBufferList.cpp >index 49a7c3b20ce00ef29f1d97942a71b7d0d30c9122..2c478c598515be28c4662d8c6176853880a1bbc9 100644 >--- a/Source/WebCore/Modules/mediasource/SourceBufferList.cpp >+++ b/Source/WebCore/Modules/mediasource/SourceBufferList.cpp >@@ -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"; >diff --git a/Source/WebCore/Modules/mediasource/SourceBufferList.h b/Source/WebCore/Modules/mediasource/SourceBufferList.h >index b41003a3b42662de8b296b90fa3172804361c6a0..9c8aaa2ebb22080908de22517717ebeec5f8831e 100644 >--- a/Source/WebCore/Modules/mediasource/SourceBufferList.h >+++ b/Source/WebCore/Modules/mediasource/SourceBufferList.h >@@ -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; >diff --git a/Source/WebCore/Modules/mediastream/MediaDevices.cpp b/Source/WebCore/Modules/mediastream/MediaDevices.cpp >index 06f17546c7e0d41a3b3a0473160e23d4c5c5134e..31b4565329b6be738a12bf819ef9c63654dd7ca9 100644 >--- a/Source/WebCore/Modules/mediastream/MediaDevices.cpp >+++ b/Source/WebCore/Modules/mediastream/MediaDevices.cpp >@@ -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)) >diff --git a/Source/WebCore/Modules/mediastream/MediaDevices.h b/Source/WebCore/Modules/mediastream/MediaDevices.h >index e54c5b3b73fb22d88101476bdd1c5bb10ac4ff08..5395eb8482f8c74d5dc0d6c5930d49a226720a3f 100644 >--- a/Source/WebCore/Modules/mediastream/MediaDevices.h >+++ b/Source/WebCore/Modules/mediastream/MediaDevices.h >@@ -100,7 +100,6 @@ private: > > // 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 8296f321bb49eece657ca77ac70b46dbb565e7b6..504d11771a646cc02cc83eb704df710e4da1373f 100644 >--- a/Source/WebCore/Modules/mediastream/MediaStream.cpp >+++ b/Source/WebCore/Modules/mediastream/MediaStream.cpp >@@ -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 >diff --git a/Source/WebCore/Modules/mediastream/MediaStream.h b/Source/WebCore/Modules/mediastream/MediaStream.h >index 665f109a1b10fe083fba241125293123c7af5fa3..41da762e5448dcd160c5e39f1401acaa2b119c03 100644 >--- a/Source/WebCore/Modules/mediastream/MediaStream.h >+++ b/Source/WebCore/Modules/mediastream/MediaStream.h >@@ -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(); >diff --git a/Source/WebCore/Modules/mediastream/MediaStreamTrack.cpp b/Source/WebCore/Modules/mediastream/MediaStreamTrack.cpp >index 955294edcf43f3094914f87e3e1e774a1502bb29..44bfa9b16eef82336995717cb46a1818171a49d4 100644 >--- a/Source/WebCore/Modules/mediastream/MediaStreamTrack.cpp >+++ b/Source/WebCore/Modules/mediastream/MediaStreamTrack.cpp >@@ -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 >diff --git a/Source/WebCore/Modules/mediastream/MediaStreamTrack.h b/Source/WebCore/Modules/mediastream/MediaStreamTrack.h >index 6b1669d2623d40b2a2a999ed74202ac9fb7f9338..692f083b9ec16b2a07ecf22d7a756fc50fd6cb59 100644 >--- a/Source/WebCore/Modules/mediastream/MediaStreamTrack.h >+++ b/Source/WebCore/Modules/mediastream/MediaStreamTrack.h >@@ -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(); } >diff --git a/Source/WebCore/Modules/mediastream/RTCDTMFSender.cpp b/Source/WebCore/Modules/mediastream/RTCDTMFSender.cpp >index 6ff4aa5e77f97ddf923d3bfb9a6e6f71c5ff584f..683bbba02a230933bf111fc8bb2dd1c1ad189fcb 100644 >--- a/Source/WebCore/Modules/mediastream/RTCDTMFSender.cpp >+++ b/Source/WebCore/Modules/mediastream/RTCDTMFSender.cpp >@@ -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 >diff --git a/Source/WebCore/Modules/mediastream/RTCDTMFSender.h b/Source/WebCore/Modules/mediastream/RTCDTMFSender.h >index 345954d2bd1b95b60ef3aad4ee14cbc226855d85..719a99d519524c8148d21376ce423ee4da14b457 100644 >--- a/Source/WebCore/Modules/mediastream/RTCDTMFSender.h >+++ b/Source/WebCore/Modules/mediastream/RTCDTMFSender.h >@@ -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(); } >diff --git a/Source/WebCore/Modules/mediastream/RTCDataChannel.h b/Source/WebCore/Modules/mediastream/RTCDataChannel.h >index 4d3662d5fbb96f82ee70812140a891e9f952c2f1..e39eed3418a31ba05ebdd0ee24ef43d04034da18 100644 >--- a/Source/WebCore/Modules/mediastream/RTCDataChannel.h >+++ b/Source/WebCore/Modules/mediastream/RTCDataChannel.h >@@ -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; >diff --git a/Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp b/Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp >index fd120fa92b4be27cfd64521cd876aa44303deba4..09b0396769f599db9909416dc4a57cd613c286f3 100644 >--- a/Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp >+++ b/Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp >@@ -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) >diff --git a/Source/WebCore/Modules/mediastream/RTCPeerConnection.h b/Source/WebCore/Modules/mediastream/RTCPeerConnection.h >index 6087366f71be1288a969c3f014a2c80a2c4bb28f..1872065b83584bf99e3ea320e2786cdb7283597e 100644 >--- a/Source/WebCore/Modules/mediastream/RTCPeerConnection.h >+++ b/Source/WebCore/Modules/mediastream/RTCPeerConnection.h >@@ -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; > >diff --git a/Source/WebCore/Modules/mediastream/UserMediaRequest.cpp b/Source/WebCore/Modules/mediastream/UserMediaRequest.cpp >index 77a52da6d5faad7330f7db1f08919309dac87ebe..5d2c6f24889b2c0f01aaed527234d3219721e99f 100644 >--- a/Source/WebCore/Modules/mediastream/UserMediaRequest.cpp >+++ b/Source/WebCore/Modules/mediastream/UserMediaRequest.cpp >@@ -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 >diff --git a/Source/WebCore/Modules/mediastream/UserMediaRequest.h b/Source/WebCore/Modules/mediastream/UserMediaRequest.h >index f2c0efcb2d562d251239d2801d4261d7908c8232..46f1d4788a0338ae533dd9804530e4269bd98996 100644 >--- a/Source/WebCore/Modules/mediastream/UserMediaRequest.h >+++ b/Source/WebCore/Modules/mediastream/UserMediaRequest.h >@@ -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); > >diff --git a/Source/WebCore/Modules/notifications/Notification.cpp b/Source/WebCore/Modules/notifications/Notification.cpp >index f29a1249a132c9d77c064c3b7cafe5f14cf30ada..36b997fe90f3ec70c2578114d479e1cff35d2f38 100644 >--- a/Source/WebCore/Modules/notifications/Notification.cpp >+++ b/Source/WebCore/Modules/notifications/Notification.cpp >@@ -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() >diff --git a/Source/WebCore/Modules/notifications/Notification.h b/Source/WebCore/Modules/notifications/Notification.h >index 7ff98d4e54c58fa224ad2e45ac508f9d31af0ee1..e9d2d68c12742d7806712c406e961d8b094e517c 100644 >--- a/Source/WebCore/Modules/notifications/Notification.h >+++ b/Source/WebCore/Modules/notifications/Notification.h >@@ -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(); } >diff --git a/Source/WebCore/Modules/paymentrequest/PaymentRequest.cpp b/Source/WebCore/Modules/paymentrequest/PaymentRequest.cpp >index cc0774bc57104ff20725cc6360cb25dd91882d88..00f1493c7d363f9d9c62f230315fa0d72ad24a6a 100644 >--- a/Source/WebCore/Modules/paymentrequest/PaymentRequest.cpp >+++ b/Source/WebCore/Modules/paymentrequest/PaymentRequest.cpp >@@ -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) >diff --git a/Source/WebCore/Modules/paymentrequest/PaymentRequest.h b/Source/WebCore/Modules/paymentrequest/PaymentRequest.h >index 7f1b52fa02d4e3f8b2a4a5b92e4611e3e86551a0..40a5ea2f8df1e77b1f5e6c0eb8e811f2266c4b1f 100644 >--- a/Source/WebCore/Modules/paymentrequest/PaymentRequest.h >+++ b/Source/WebCore/Modules/paymentrequest/PaymentRequest.h >@@ -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 >diff --git a/Source/WebCore/Modules/paymentrequest/PaymentResponse.cpp b/Source/WebCore/Modules/paymentrequest/PaymentResponse.cpp >index 98b5d6cf24097a0cc8e18e1ccdd0b319682fddfd..1692dc062c24194890b03c5c7f8ba415140fa523 100644 >--- a/Source/WebCore/Modules/paymentrequest/PaymentResponse.cpp >+++ b/Source/WebCore/Modules/paymentrequest/PaymentResponse.cpp >@@ -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() >diff --git a/Source/WebCore/Modules/paymentrequest/PaymentResponse.h b/Source/WebCore/Modules/paymentrequest/PaymentResponse.h >index 9ae9f85c331bf1831bce2075d65c7de8aeb732cb..fe79a6d79ca96a8f0052e96fb4ad7ed4b017ebc3 100644 >--- a/Source/WebCore/Modules/paymentrequest/PaymentResponse.h >+++ b/Source/WebCore/Modules/paymentrequest/PaymentResponse.h >@@ -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 >diff --git a/Source/WebCore/Modules/pictureinpicture/PictureInPictureWindow.cpp b/Source/WebCore/Modules/pictureinpicture/PictureInPictureWindow.cpp >index 49ec74748504fe8a2b682f9829381657c16ff985..a000f1734eddc5efe2f0167915b02f4e2b2ad8f1 100644 >--- a/Source/WebCore/Modules/pictureinpicture/PictureInPictureWindow.cpp >+++ b/Source/WebCore/Modules/pictureinpicture/PictureInPictureWindow.cpp >@@ -54,11 +54,6 @@ const char* PictureInPictureWindow::activeDOMObjectName() const > 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 7ae5a6bd8be5c1234e04b70ba1895a532a52f613..231bf53d0bfa4d8b41ae4e6db8ca9318a29b2f13 100644 >--- a/Source/WebCore/Modules/pictureinpicture/PictureInPictureWindow.h >+++ b/Source/WebCore/Modules/pictureinpicture/PictureInPictureWindow.h >@@ -48,7 +48,6 @@ public: > > // 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 dd2e5ce370d0f025f461fa1338dd5b8779ebd116..66f2208d8c87652a38042388fd11af5bfffb2aad 100644 >--- a/Source/WebCore/Modules/webaudio/AudioContext.cpp >+++ b/Source/WebCore/Modules/webaudio/AudioContext.cpp >@@ -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 >diff --git a/Source/WebCore/Modules/webaudio/AudioContext.h b/Source/WebCore/Modules/webaudio/AudioContext.h >index e466f452809024f36066d3259cf739b63a14cbba..762c13badabdec261fe952c24b5f3f3c65940f2d 100644 >--- a/Source/WebCore/Modules/webaudio/AudioContext.h >+++ b/Source/WebCore/Modules/webaudio/AudioContext.h >@@ -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. >diff --git a/Source/WebCore/Modules/webdatabase/DatabaseContext.cpp b/Source/WebCore/Modules/webdatabase/DatabaseContext.cpp >index 2012f75d3e2d2fc2db3445a64fdf599d83b47587..1fb061f8b37af2ddab03c963609c901b6d0f9d96 100644 >--- a/Source/WebCore/Modules/webdatabase/DatabaseContext.cpp >+++ b/Source/WebCore/Modules/webdatabase/DatabaseContext.cpp >@@ -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() >diff --git a/Source/WebCore/Modules/webdatabase/DatabaseContext.h b/Source/WebCore/Modules/webdatabase/DatabaseContext.h >index 7dd4b9e3fc40a81b22e6c2a67c13117226f9e591..bef552081a4e882349e5a2174135dfe6470c1f28 100644 >--- a/Source/WebCore/Modules/webdatabase/DatabaseContext.h >+++ b/Source/WebCore/Modules/webdatabase/DatabaseContext.h >@@ -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; >diff --git a/Source/WebCore/Modules/webgpu/GPUCanvasContext.h b/Source/WebCore/Modules/webgpu/GPUCanvasContext.h >index cd818ce095853ae84ecfb41023c7286c46124686..1bb270bcb017997cf74df4d2a3dd1dedbd3077f6 100644 >--- a/Source/WebCore/Modules/webgpu/GPUCanvasContext.h >+++ b/Source/WebCore/Modules/webgpu/GPUCanvasContext.h >@@ -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; > }; >diff --git a/Source/WebCore/Modules/websockets/WebSocket.cpp b/Source/WebCore/Modules/websockets/WebSocket.cpp >index b32bf98b258dcec3988ea5a8a34b7bec5833f397..94403f25b76a164627d5a4986875337826b39704 100644 >--- a/Source/WebCore/Modules/websockets/WebSocket.cpp >+++ b/Source/WebCore/Modules/websockets/WebSocket.cpp >@@ -495,11 +495,6 @@ void WebSocket::contextDestroyed() > 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 86efff76b677b6e22192f6ad86a9338124733552..abd225be58fc98d2629d6697cbdd8daef856f3b3 100644 >--- a/Source/WebCore/Modules/websockets/WebSocket.h >+++ b/Source/WebCore/Modules/websockets/WebSocket.h >@@ -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; >diff --git a/Source/WebCore/Modules/webvr/VRDisplay.cpp b/Source/WebCore/Modules/webvr/VRDisplay.cpp >index 806a7ab9a40623c032adf27e35256c07124b4f85..cf588edfebc78640b06a4fa9a874213821ebf2b9 100644 >--- a/Source/WebCore/Modules/webvr/VRDisplay.cpp >+++ b/Source/WebCore/Modules/webvr/VRDisplay.cpp >@@ -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() >diff --git a/Source/WebCore/Modules/webvr/VRDisplay.h b/Source/WebCore/Modules/webvr/VRDisplay.h >index 1cd75d893fc254696c484c796c9cf1727f6d6da1..e088cd1e32215c4e709ca283635b74cf13392328 100644 >--- a/Source/WebCore/Modules/webvr/VRDisplay.h >+++ b/Source/WebCore/Modules/webvr/VRDisplay.h >@@ -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(); >diff --git a/Source/WebCore/animation/WebAnimation.cpp b/Source/WebCore/animation/WebAnimation.cpp >index 5f0c9003dff77e0717d6d8f5be6968620fb52aaf..39f6b344c7b445e6447f892d6631ffe2e5111a37 100644 >--- a/Source/WebCore/animation/WebAnimation.cpp >+++ b/Source/WebCore/animation/WebAnimation.cpp >@@ -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() >diff --git a/Source/WebCore/animation/WebAnimation.h b/Source/WebCore/animation/WebAnimation.h >index 20b4cca6c7a54965b600bfeba7075dc31abd4519..d4159dfad218a18df0c152a6a0514555c6d0e6e4 100644 >--- a/Source/WebCore/animation/WebAnimation.h >+++ b/Source/WebCore/animation/WebAnimation.h >@@ -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; } >diff --git a/Source/WebCore/css/FontFaceSet.cpp b/Source/WebCore/css/FontFaceSet.cpp >index def3a94beb97e2f02bc7d763700e3f3611f3be2d..c625fbea7393b9afaa07df0809050edd66f57cea 100644 >--- a/Source/WebCore/css/FontFaceSet.cpp >+++ b/Source/WebCore/css/FontFaceSet.cpp >@@ -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. >diff --git a/Source/WebCore/css/FontFaceSet.h b/Source/WebCore/css/FontFaceSet.h >index 9f728efc3663698dfc81527d113b53e44e929f1e..a102f803de9ddbca8352487b1109a079e2094063 100644 >--- a/Source/WebCore/css/FontFaceSet.h >+++ b/Source/WebCore/css/FontFaceSet.h >@@ -105,7 +105,6 @@ private: > > // 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 6b8b986f3796c7489d0af2c95753cbb690dc267c..5aa5954f7fcb1f2145fdce89eaf7ce333ea48041 100644 >--- a/Source/WebCore/dom/ActiveDOMObject.h >+++ b/Source/WebCore/dom/ActiveDOMObject.h >@@ -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(); > >diff --git a/Source/WebCore/dom/GenericEventQueue.cpp b/Source/WebCore/dom/GenericEventQueue.cpp >index 2211b9b62771641d359cc0f5566c9f04983cdea0..82c2b8fbd1bb0c25664747aea00f3080ff15d24c 100644 >--- a/Source/WebCore/dom/GenericEventQueue.cpp >+++ b/Source/WebCore/dom/GenericEventQueue.cpp >@@ -132,12 +132,6 @@ void GenericEventQueueBase<T>::setPaused(bool shouldPause) > rescheduleAllEventsIfNeeded(); > } > >-template<typename T> >-bool GenericEventQueueBase<T>::canSuspendForDocumentSuspension() const >-{ >- return true; >-} >- > template<typename T> > void GenericEventQueueBase<T>::suspend(ReasonForSuspension) > { >diff --git a/Source/WebCore/dom/GenericEventQueue.h b/Source/WebCore/dom/GenericEventQueue.h >index ccd10649bcd9dbc72e4d4b8b3d1df96a0dcf864d..5375d55c535e5fc38d4f0bed235771196f956d36 100644 >--- a/Source/WebCore/dom/GenericEventQueue.h >+++ b/Source/WebCore/dom/GenericEventQueue.h >@@ -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; >diff --git a/Source/WebCore/dom/MessagePort.cpp b/Source/WebCore/dom/MessagePort.cpp >index 1d50402d77c51a020f4350f8f9faf6b492041d6d..369562c91275be4143caa20fec8bcf63581e621b 100644 >--- a/Source/WebCore/dom/MessagePort.cpp >+++ b/Source/WebCore/dom/MessagePort.cpp >@@ -413,9 +413,4 @@ const char* MessagePort::activeDOMObjectName() const > 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 0b5f3d87c015845562bc929c7cf8f8eb74df4977..a136a56dbe05004feb1de4a72bfe2d93b5eb1e09 100644 >--- a/Source/WebCore/dom/MessagePort.h >+++ b/Source/WebCore/dom/MessagePort.h >@@ -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; >diff --git a/Source/WebCore/dom/ScriptExecutionContext.cpp b/Source/WebCore/dom/ScriptExecutionContext.cpp >index 3ea9b38dd233805e7654f444c129b27c7efb30dc..ca5c5a2d0891679b8470601d62b72dce03bd1405 100644 >--- a/Source/WebCore/dom/ScriptExecutionContext.cpp >+++ b/Source/WebCore/dom/ScriptExecutionContext.cpp >@@ -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); >diff --git a/Source/WebCore/fileapi/FileReader.cpp b/Source/WebCore/fileapi/FileReader.cpp >index 99a7b5c6f987a14ba1909458987ae84ecfc4f080..62438cd8903de3d8de48c847fb9f08840a835480 100644 >--- a/Source/WebCore/fileapi/FileReader.cpp >+++ b/Source/WebCore/fileapi/FileReader.cpp >@@ -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 >diff --git a/Source/WebCore/fileapi/FileReader.h b/Source/WebCore/fileapi/FileReader.h >index effdb290f3f043ee7f6888be84fc6212988b367e..c0b7df7aac6771a1e277a7b064fb15dde790b22a 100644 >--- a/Source/WebCore/fileapi/FileReader.h >+++ b/Source/WebCore/fileapi/FileReader.h >@@ -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; } >diff --git a/Source/WebCore/html/HTMLMarqueeElement.cpp b/Source/WebCore/html/HTMLMarqueeElement.cpp >index 1679e9b22d8f52166eca94fdaf764c4002b6c474..0adf7d164e2e4e2b0fb113f03a1bd3a73c271275 100644 >--- a/Source/WebCore/html/HTMLMarqueeElement.cpp >+++ b/Source/WebCore/html/HTMLMarqueeElement.cpp >@@ -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()) >diff --git a/Source/WebCore/html/HTMLMarqueeElement.h b/Source/WebCore/html/HTMLMarqueeElement.h >index 05818a56a20ba836ccf21c9e59c87591026063fd..a2f2e544e95bb469741d4b344e136272d5ca8a04 100644 >--- a/Source/WebCore/html/HTMLMarqueeElement.h >+++ b/Source/WebCore/html/HTMLMarqueeElement.h >@@ -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"; } >diff --git a/Source/WebCore/html/HTMLMediaElement.cpp b/Source/WebCore/html/HTMLMediaElement.cpp >index 9fa738abc71106d76ac494b8d6e5f8b077ee0709..fdecb87eccee129fe33357c1c3a583e814a3ffdc 100644 >--- a/Source/WebCore/html/HTMLMediaElement.cpp >+++ b/Source/WebCore/html/HTMLMediaElement.cpp >@@ -5663,11 +5663,6 @@ void HTMLMediaElement::clearMediaPlayer() > 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 32a240a09c96451478adc207d3d900018ee65567..f482d21b4e4dd48d61b7372e9f4f7d8eeeb02ffe 100644 >--- a/Source/WebCore/html/HTMLMediaElement.h >+++ b/Source/WebCore/html/HTMLMediaElement.h >@@ -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; >diff --git a/Source/WebCore/html/HTMLSourceElement.cpp b/Source/WebCore/html/HTMLSourceElement.cpp >index dd5d85c54b91ffbcfb204ecfd6b74b4b423f3abc..4216e976b4820b78c1345b364f8ed40727be010f 100644 >--- a/Source/WebCore/html/HTMLSourceElement.cpp >+++ b/Source/WebCore/html/HTMLSourceElement.cpp >@@ -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? >diff --git a/Source/WebCore/html/HTMLSourceElement.h b/Source/WebCore/html/HTMLSourceElement.h >index 8765871c12a67089c0efa22387e5a3f4a3578194..4df0af542d353c4211b0388a82563d45bf12cd46 100644 >--- a/Source/WebCore/html/HTMLSourceElement.h >+++ b/Source/WebCore/html/HTMLSourceElement.h >@@ -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; >diff --git a/Source/WebCore/html/ImageBitmap.cpp b/Source/WebCore/html/ImageBitmap.cpp >index ba4bf1edc16c2fe5d4a7068acd1b6210d5b36956..f2e634019cae8ed42056663518ccb1f0b666813a 100644 >--- a/Source/WebCore/html/ImageBitmap.cpp >+++ b/Source/WebCore/html/ImageBitmap.cpp >@@ -561,11 +561,6 @@ private: > 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 d2f96d4f5d7f4534ed2355d9a7ee9edce1ef86f4..8f5fcf5f6246ba7bd266a319cc9ed82ef45fac26 100644 >--- a/Source/WebCore/html/PublicURLManager.cpp >+++ b/Source/WebCore/html/PublicURLManager.cpp >@@ -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"; >diff --git a/Source/WebCore/html/PublicURLManager.h b/Source/WebCore/html/PublicURLManager.h >index 9bfe73e6280b944c65d0ddd811c6f17a74219fd7..0ecb7ede12089cc18060fe0106389d9c6f9cc1bd 100644 >--- a/Source/WebCore/html/PublicURLManager.h >+++ b/Source/WebCore/html/PublicURLManager.h >@@ -50,7 +50,6 @@ public: > 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 de47ae74d7d59db095c437c4e9d5977a86dde086..626246f23430c92331c690de17578ea04119dd4a 100644 >--- a/Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp >+++ b/Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp >@@ -5208,11 +5208,6 @@ const char* WebGLRenderingContextBase::activeDOMObjectName() const > 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 b1725385f9e9d3877cbdb91465dc5e3a15a76f58..6ca2ac68b548534140a0e28bb8fcb0c0f0207204 100644 >--- a/Source/WebCore/html/canvas/WebGLRenderingContextBase.h >+++ b/Source/WebCore/html/canvas/WebGLRenderingContextBase.h >@@ -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; > >diff --git a/Source/WebCore/html/track/TrackListBase.cpp b/Source/WebCore/html/track/TrackListBase.cpp >index 9003e9c1b22d2d3ee3791502589c3f2687e8219f..4518d7f8d3eb7cce6b2ece8da3803eb47e40335c 100644 >--- a/Source/WebCore/html/track/TrackListBase.cpp >+++ b/Source/WebCore/html/track/TrackListBase.cpp >@@ -178,11 +178,6 @@ bool TrackListBase::isAnyTrackEnabled() const > 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 4255bc16095c8220904b143c8d967839e5415d2c..a3b1aa7310f33ee00629278fb7dff4e32fdd32a4 100644 >--- a/Source/WebCore/html/track/TrackListBase.h >+++ b/Source/WebCore/html/track/TrackListBase.h >@@ -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(); } >diff --git a/Source/WebCore/page/EventSource.cpp b/Source/WebCore/page/EventSource.cpp >index f1f5b32b0667703f21343afc8f52757461aedf56..757765c3b4872d5a6f92b34e3f2ac67eaaf2dd82 100644 >--- a/Source/WebCore/page/EventSource.cpp >+++ b/Source/WebCore/page/EventSource.cpp >@@ -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) >diff --git a/Source/WebCore/page/EventSource.h b/Source/WebCore/page/EventSource.h >index 3559144f7ed229aac50f07a4b54b5748ceeb3707..ce2530fc13e9fa2411b92be1d7a6f0ce4831510a 100644 >--- a/Source/WebCore/page/EventSource.h >+++ b/Source/WebCore/page/EventSource.h >@@ -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; > >diff --git a/Source/WebCore/page/IntersectionObserver.cpp b/Source/WebCore/page/IntersectionObserver.cpp >index f9fb287e679edd846e75b37912c15a38e4123368..cea487fe9142ca78589493d46157d1fbfa2e5724 100644 >--- a/Source/WebCore/page/IntersectionObserver.cpp >+++ b/Source/WebCore/page/IntersectionObserver.cpp >@@ -279,11 +279,6 @@ const char* IntersectionObserver::activeDOMObjectName() const > 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 7c9854b8a5db46cf05544cf987b96b8e1d0185db..d4b902e745082408fd849eba829db1d2989334ba 100644 >--- a/Source/WebCore/page/IntersectionObserver.h >+++ b/Source/WebCore/page/IntersectionObserver.h >@@ -101,7 +101,6 @@ public: > // 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 cbe5168e8b7fdbf88044637bd498b6b3bcc72d4a..cf61f8cfc60d2090a0c332043206fc7d36684185 100644 >--- a/Source/WebCore/page/ResizeObserver.cpp >+++ b/Source/WebCore/page/ResizeObserver.cpp >@@ -171,11 +171,6 @@ const char* ResizeObserver::activeDOMObjectName() const > 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 eeebf9b9e61bd588fd3ba99fab150191cc8f670e..69cac88c8c1aea4ac142a4febbfa39dd61dcc1cb 100644 >--- a/Source/WebCore/page/ResizeObserver.h >+++ b/Source/WebCore/page/ResizeObserver.h >@@ -67,7 +67,6 @@ public: > // 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 e7e517b33aa615cafb752eb9085c209d11824d55..844e001aca6c46f7ef5c4d739f805209fb097132 100644 >--- a/Source/WebCore/page/SuspendableTimer.cpp >+++ b/Source/WebCore/page/SuspendableTimer.cpp >@@ -78,11 +78,6 @@ void SuspendableTimerBase::resume() > 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 f3ef12300e5a5659d885181fc08365689b061d28..3be62e4f0a5bec73ff2757849fe05ee367c111d6 100644 >--- a/Source/WebCore/page/SuspendableTimer.h >+++ b/Source/WebCore/page/SuspendableTimer.h >@@ -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; > >diff --git a/Source/WebCore/platform/SuspendableTaskQueue.cpp b/Source/WebCore/platform/SuspendableTaskQueue.cpp >index 9cee4f47fedbda276f11aece1b3c455f1b04c491..046aaab0efdb23827c61b06636408ab75b870001 100644 >--- a/Source/WebCore/platform/SuspendableTaskQueue.cpp >+++ b/Source/WebCore/platform/SuspendableTaskQueue.cpp >@@ -81,11 +81,6 @@ const char* SuspendableTaskQueue::activeDOMObjectName() const > 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 b1289917e16ca89a905292a10a907d25db903102..b3260f433e5179cb924587cd182dfddd8c18d729 100644 >--- a/Source/WebCore/platform/SuspendableTaskQueue.h >+++ b/Source/WebCore/platform/SuspendableTaskQueue.h >@@ -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; >diff --git a/Source/WebCore/testing/Internals.cpp b/Source/WebCore/testing/Internals.cpp >index f3c7e3e42f1b79042ec8934aed5446e27db7e712..97389d35c30a2de91d37064a70e64509c27ad7a5 100644 >--- a/Source/WebCore/testing/Internals.cpp >+++ b/Source/WebCore/testing/Internals.cpp >@@ -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"; } > }; > >diff --git a/Source/WebCore/workers/Worker.cpp b/Source/WebCore/workers/Worker.cpp >index e38eee357fea9533196467a4bc60087708096cbe..0f5078e882ea470f15514d82f96a2166971e883a 100644 >--- a/Source/WebCore/workers/Worker.cpp >+++ b/Source/WebCore/workers/Worker.cpp >@@ -150,11 +150,6 @@ void Worker::terminate() > 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 8e3bfa87ec58f068a3298409aa56b14f9c0060d9..4c54139af8d54562c504b3f2fe13616075cd77ad 100644 >--- a/Source/WebCore/workers/Worker.h >+++ b/Source/WebCore/workers/Worker.h >@@ -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; > >diff --git a/Source/WebCore/workers/service/ServiceWorker.cpp b/Source/WebCore/workers/service/ServiceWorker.cpp >index d401a5d1c0b7b0588acef6865076baaa9e21265d..42a5ab038c5ed9e77d42920600b883328920b192 100644 >--- a/Source/WebCore/workers/service/ServiceWorker.cpp >+++ b/Source/WebCore/workers/service/ServiceWorker.cpp >@@ -144,11 +144,6 @@ const char* ServiceWorker::activeDOMObjectName() const > 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 47ec0cac58cbc7f0b50eae299abca3a1aae4af83..67567e5408c3614fecc94ba2fad0d5789204216f 100644 >--- a/Source/WebCore/workers/service/ServiceWorker.h >+++ b/Source/WebCore/workers/service/ServiceWorker.h >@@ -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; >diff --git a/Source/WebCore/workers/service/ServiceWorkerContainer.cpp b/Source/WebCore/workers/service/ServiceWorkerContainer.cpp >index ea23fe9bf816322a20c9cfd155723340ff65d9ee..ef9ff3e0ab4919b4783aff2bd5a4655726ab244a 100644 >--- a/Source/WebCore/workers/service/ServiceWorkerContainer.cpp >+++ b/Source/WebCore/workers/service/ServiceWorkerContainer.cpp >@@ -513,11 +513,6 @@ const char* ServiceWorkerContainer::activeDOMObjectName() const > 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 461e70eb3d33eccd788e93695262b62e46d2c71d..d11db4eac72158c0203c9d80698f84da1991ee36 100644 >--- a/Source/WebCore/workers/service/ServiceWorkerContainer.h >+++ b/Source/WebCore/workers/service/ServiceWorkerContainer.h >@@ -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; } >diff --git a/Source/WebCore/workers/service/ServiceWorkerRegistration.cpp b/Source/WebCore/workers/service/ServiceWorkerRegistration.cpp >index 4d3bc6f64ecdef861dfc199c4f2cae39366c3102..f2189070eab78d8c52791b3b5de304c0f53d23c7 100644 >--- a/Source/WebCore/workers/service/ServiceWorkerRegistration.cpp >+++ b/Source/WebCore/workers/service/ServiceWorkerRegistration.cpp >@@ -238,11 +238,6 @@ const char* ServiceWorkerRegistration::activeDOMObjectName() const > 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 052665c6888f93e1718d0fe798f9d5dbfa31d854..191fa40b8fa77d292b13dcd1f2ad5df71ac4f70e 100644 >--- a/Source/WebCore/workers/service/ServiceWorkerRegistration.h >+++ b/Source/WebCore/workers/service/ServiceWorkerRegistration.h >@@ -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; >diff --git a/Source/WebCore/xml/XMLHttpRequest.cpp b/Source/WebCore/xml/XMLHttpRequest.cpp >index 53c48071be95dc15b8cd80178c807a928e32a376..67ad293bd72f5d5b1f04b4786f1004bd1bf2edc4 100644 >--- a/Source/WebCore/xml/XMLHttpRequest.cpp >+++ b/Source/WebCore/xml/XMLHttpRequest.cpp >@@ -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 >diff --git a/Source/WebCore/xml/XMLHttpRequest.h b/Source/WebCore/xml/XMLHttpRequest.h >index d70d3e9c5d489b213e6af97351e4d62b8ff06934..52008c7eb7a40f32150e93660de0deda3b76a374 100644 >--- a/Source/WebCore/xml/XMLHttpRequest.h >+++ b/Source/WebCore/xml/XMLHttpRequest.h >@@ -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;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 203086
: 381196