Rename ActiveDOMObject/DOMWindow PageCacheSuspension code to support more reasons...
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 1 Dec 2015 01:55:43 +0000 (01:55 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 1 Dec 2015 01:55:43 +0000 (01:55 +0000)
https://bugs.webkit.org/show_bug.cgi?id=151677

Patch by Katlyn Graff <kgraff@apple.com> on 2015-11-30
Reviewed by Ryosuke Niwa.

Source/WebCore:

Simply a refactoring patch, so no new tests.

* Modules/encryptedmedia/MediaKeySession.cpp:
(WebCore::MediaKeySession::canSuspendForDocumentSuspension):
(WebCore::MediaKeySession::canSuspendForPageCache): Deleted.
* Modules/encryptedmedia/MediaKeySession.h:
* Modules/geolocation/Geolocation.cpp:
(WebCore::Geolocation::canSuspendForDocumentSuspension):
(WebCore::Geolocation::canSuspendForPageCache): Deleted.
* Modules/geolocation/Geolocation.h:
* Modules/indexeddb/DOMWindowIndexedDatabase.cpp:
(WebCore::DOMWindowIndexedDatabase::disconnectFrameForDocumentSuspension):
(WebCore::DOMWindowIndexedDatabase::reconnectFrameFromDocumentSuspension):
(WebCore::DOMWindowIndexedDatabase::disconnectFrameForPageCache): Deleted.
(WebCore::DOMWindowIndexedDatabase::reconnectFrameFromPageCache): Deleted.
* Modules/indexeddb/DOMWindowIndexedDatabase.h:
* Modules/indexeddb/client/IDBDatabaseImpl.cpp:
(WebCore::IDBClient::IDBDatabase::canSuspendForDocumentSuspension):
(WebCore::IDBClient::IDBDatabase::canSuspendForPageCache): Deleted.
* Modules/indexeddb/client/IDBDatabaseImpl.h:
* Modules/indexeddb/client/IDBRequestImpl.cpp:
(WebCore::IDBClient::IDBRequest::canSuspendForDocumentSuspension):
(WebCore::IDBClient::IDBRequest::canSuspendForPageCache): Deleted.
* Modules/indexeddb/client/IDBRequestImpl.h:
* Modules/indexeddb/client/IDBTransactionImpl.cpp:
(WebCore::IDBClient::IDBTransaction::canSuspendForDocumentSuspension):
(WebCore::IDBClient::IDBTransaction::canSuspendForPageCache): Deleted.
* Modules/indexeddb/client/IDBTransactionImpl.h:
* Modules/indexeddb/legacy/LegacyDatabase.cpp:
(WebCore::LegacyDatabase::canSuspendForDocumentSuspension):
(WebCore::LegacyDatabase::canSuspendForPageCache): Deleted.
* Modules/indexeddb/legacy/LegacyDatabase.h:
* Modules/indexeddb/legacy/LegacyRequest.cpp:
(WebCore::LegacyRequest::canSuspendForDocumentSuspension):
(WebCore::LegacyRequest::canSuspendForPageCache): Deleted.
* Modules/indexeddb/legacy/LegacyRequest.h:
* Modules/indexeddb/legacy/LegacyTransaction.cpp:
(WebCore::LegacyTransaction::canSuspendForDocumentSuspension):
(WebCore::LegacyTransaction::canSuspendForPageCache): Deleted.
* Modules/indexeddb/legacy/LegacyTransaction.h:
* Modules/mediasource/MediaSource.cpp:
(WebCore::MediaSource::canSuspendForDocumentSuspension):
(WebCore::MediaSource::canSuspendForPageCache): Deleted.
* Modules/mediasource/MediaSource.h:
* Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::canSuspendForDocumentSuspension):
(WebCore::SourceBuffer::canSuspendForPageCache): Deleted.
* Modules/mediasource/SourceBuffer.h:
* Modules/mediastream/MediaStreamTrack.cpp:
(WebCore::MediaStreamTrack::canSuspendForDocumentSuspension):
(WebCore::MediaStreamTrack::canSuspendForPageCache): Deleted.
* Modules/mediastream/MediaStreamTrack.h:
* Modules/mediastream/RTCDTMFSender.cpp:
(WebCore::RTCDTMFSender::canSuspendForDocumentSuspension):
(WebCore::RTCDTMFSender::canSuspendForPageCache): Deleted.
* Modules/mediastream/RTCDTMFSender.h:
* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::RTCPeerConnection::canSuspendForDocumentSuspension):
(WebCore::RTCPeerConnection::canSuspendForPageCache): Deleted.
* Modules/mediastream/RTCPeerConnection.h:
* Modules/notifications/DOMWindowNotifications.cpp:
(WebCore::DOMWindowNotifications::disconnectFrameForDocumentSuspension):
(WebCore::DOMWindowNotifications::reconnectFrameFromDocumentSuspension):
(WebCore::DOMWindowNotifications::disconnectFrameForPageCache): Deleted.
(WebCore::DOMWindowNotifications::reconnectFrameFromPageCache): Deleted.
* Modules/notifications/DOMWindowNotifications.h:
* Modules/notifications/Notification.cpp:
(WebCore::Notification::canSuspendForDocumentSuspension):
(WebCore::Notification::canSuspendForPageCache): Deleted.
* Modules/notifications/Notification.h:
* Modules/notifications/NotificationCenter.cpp:
(WebCore::NotificationCenter::canSuspendForDocumentSuspension):
(WebCore::NotificationCenter::canSuspendForPageCache): Deleted.
* Modules/notifications/NotificationCenter.h:
* Modules/webaudio/AudioContext.cpp:
(WebCore::AudioContext::canSuspendForDocumentSuspension):
(WebCore::AudioContext::canSuspendForPageCache): Deleted.
* Modules/webaudio/AudioContext.h:
* Modules/webdatabase/DatabaseContext.cpp:
(WebCore::DatabaseContext::canSuspendForDocumentSuspension):
(WebCore::DatabaseContext::canSuspendForPageCache): Deleted.
* Modules/webdatabase/DatabaseContext.h:
* Modules/websockets/WebSocket.cpp:
(WebCore::WebSocket::canSuspendForDocumentSuspension):
(WebCore::WebSocket::canSuspendForPageCache): Deleted.
* Modules/websockets/WebSocket.h:
* css/FontLoader.cpp:
(WebCore::FontLoader::canSuspendForDocumentSuspension):
(WebCore::FontLoader::canSuspendForPageCache): Deleted.
* css/FontLoader.h:
* dom/ActiveDOMObject.cpp:
(WebCore::ActiveDOMObject::canSuspendForDocumentSuspension):
(WebCore::ActiveDOMObject::canSuspendForPageCache): Deleted.
* dom/ActiveDOMObject.h:
* dom/Document.cpp:
(WebCore::Document::~Document):
* dom/ScriptExecutionContext.cpp:
(WebCore::ScriptExecutionContext::canSuspendActiveDOMObjectsForTabSuspension):
(WebCore::ScriptExecutionContext::canSuspendActiveDOMObjectsForPageCache): Deleted.
* dom/ScriptExecutionContext.h:
* fileapi/FileReader.cpp:
(WebCore::FileReader::canSuspendForDocumentSuspension):
(WebCore::FileReader::canSuspendForPageCache): Deleted.
* fileapi/FileReader.h:
* history/CachedFrame.cpp:
(WebCore::CachedFrame::CachedFrame):
* history/PageCache.cpp:
(WebCore::canCacheFrame):
* html/HTMLMarqueeElement.cpp:
(WebCore::HTMLMarqueeElement::canSuspendForDocumentSuspension):
(WebCore::HTMLMarqueeElement::canSuspendForPageCache): Deleted.
* html/HTMLMarqueeElement.h:
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::canSuspendForDocumentSuspension):
(WebCore::HTMLMediaElement::canSuspendForPageCache): Deleted.
* html/HTMLMediaElement.h:
* html/HTMLSourceElement.cpp:
(WebCore::HTMLSourceElement::canSuspendForDocumentSuspension):
(WebCore::HTMLSourceElement::canSuspendForPageCache): Deleted.
* html/HTMLSourceElement.h:
* html/PublicURLManager.cpp:
(WebCore::PublicURLManager::canSuspendForDocumentSuspension):
(WebCore::PublicURLManager::canSuspendForPageCache): Deleted.
* html/PublicURLManager.h:
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::canSuspendForDocumentSuspension):
(WebCore::WebGLRenderingContextBase::canSuspendForPageCache): Deleted.
* html/canvas/WebGLRenderingContextBase.h:
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::clear):
(WebCore::FrameLoader::open):
* loader/appcache/DOMApplicationCache.cpp:
(WebCore::DOMApplicationCache::disconnectFrameForDocumentSuspension):
(WebCore::DOMApplicationCache::reconnectFrameFromDocumentSuspension):
(WebCore::DOMApplicationCache::disconnectFrameForPageCache): Deleted.
(WebCore::DOMApplicationCache::reconnectFrameFromPageCache): Deleted.
* loader/appcache/DOMApplicationCache.h:
* page/DOMWindow.cpp:
(WebCore::DOMWindow::DOMWindow):
(WebCore::DOMWindow::~DOMWindow):
(WebCore::DOMWindow::resetUnlessSuspendedForDocumentSuspension):
(WebCore::DOMWindow::suspendForDocumentSuspension):
(WebCore::DOMWindow::resumeFromDocumentSuspension):
(WebCore::DOMWindow::disconnectDOMWindowProperties):
(WebCore::DOMWindow::reconnectDOMWindowProperties):
(WebCore::DOMWindow::resetUnlessSuspendedForPageCache): Deleted.
(WebCore::DOMWindow::suspendForPageCache): Deleted.
(WebCore::DOMWindow::resumeFromPageCache): Deleted.
* page/DOMWindow.h:
* page/DOMWindowExtension.cpp:
(WebCore::DOMWindowExtension::disconnectFrameForDocumentSuspension):
(WebCore::DOMWindowExtension::reconnectFrameFromDocumentSuspension):
(WebCore::DOMWindowExtension::disconnectFrameForPageCache): Deleted.
(WebCore::DOMWindowExtension::reconnectFrameFromPageCache): Deleted.
* page/DOMWindowExtension.h:
* page/DOMWindowProperty.cpp:
(WebCore::DOMWindowProperty::disconnectFrameForDocumentSuspension):
(WebCore::DOMWindowProperty::reconnectFrameFromDocumentSuspension):
(WebCore::DOMWindowProperty::disconnectFrameForPageCache): Deleted.
(WebCore::DOMWindowProperty::reconnectFrameFromPageCache): Deleted.
* page/DOMWindowProperty.h:
* page/EventSource.cpp:
(WebCore::EventSource::canSuspendForDocumentSuspension):
(WebCore::EventSource::canSuspendForPageCache): Deleted.
* page/EventSource.h:
* page/SuspendableTimer.cpp:
(WebCore::SuspendableTimer::canSuspendForDocumentSuspension):
(WebCore::SuspendableTimer::canSuspendForPageCache): Deleted.
* page/SuspendableTimer.h:
* workers/Worker.cpp:
(WebCore::Worker::canSuspendForDocumentSuspension):
(WebCore::Worker::canSuspendForPageCache): Deleted.
* workers/Worker.h:
* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::canSuspendForDocumentSuspension):
(WebCore::XMLHttpRequest::canSuspendForPageCache): Deleted.
* xml/XMLHttpRequest.h:

Source/WebKit/mac:

* WebView/WebFrame.mm:
(-[WebFrame _cacheabilityDictionary]):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@192848 268f45cc-cd09-0410-ab3c-d52691b4dbfc

81 files changed:
Source/WebCore/ChangeLog
Source/WebCore/Modules/encryptedmedia/MediaKeySession.cpp
Source/WebCore/Modules/encryptedmedia/MediaKeySession.h
Source/WebCore/Modules/geolocation/Geolocation.cpp
Source/WebCore/Modules/geolocation/Geolocation.h
Source/WebCore/Modules/indexeddb/DOMWindowIndexedDatabase.cpp
Source/WebCore/Modules/indexeddb/DOMWindowIndexedDatabase.h
Source/WebCore/Modules/indexeddb/client/IDBDatabaseImpl.cpp
Source/WebCore/Modules/indexeddb/client/IDBDatabaseImpl.h
Source/WebCore/Modules/indexeddb/client/IDBRequestImpl.cpp
Source/WebCore/Modules/indexeddb/client/IDBRequestImpl.h
Source/WebCore/Modules/indexeddb/client/IDBTransactionImpl.cpp
Source/WebCore/Modules/indexeddb/client/IDBTransactionImpl.h
Source/WebCore/Modules/indexeddb/legacy/LegacyDatabase.cpp
Source/WebCore/Modules/indexeddb/legacy/LegacyDatabase.h
Source/WebCore/Modules/indexeddb/legacy/LegacyRequest.cpp
Source/WebCore/Modules/indexeddb/legacy/LegacyRequest.h
Source/WebCore/Modules/indexeddb/legacy/LegacyTransaction.cpp
Source/WebCore/Modules/indexeddb/legacy/LegacyTransaction.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/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/RTCPeerConnection.cpp
Source/WebCore/Modules/mediastream/RTCPeerConnection.h
Source/WebCore/Modules/notifications/DOMWindowNotifications.cpp
Source/WebCore/Modules/notifications/DOMWindowNotifications.h
Source/WebCore/Modules/notifications/Notification.cpp
Source/WebCore/Modules/notifications/Notification.h
Source/WebCore/Modules/notifications/NotificationCenter.cpp
Source/WebCore/Modules/notifications/NotificationCenter.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/websockets/WebSocket.cpp
Source/WebCore/Modules/websockets/WebSocket.h
Source/WebCore/css/FontLoader.cpp
Source/WebCore/css/FontLoader.h
Source/WebCore/dom/ActiveDOMObject.cpp
Source/WebCore/dom/ActiveDOMObject.h
Source/WebCore/dom/Document.cpp
Source/WebCore/dom/ScriptExecutionContext.cpp
Source/WebCore/dom/ScriptExecutionContext.h
Source/WebCore/fileapi/FileReader.cpp
Source/WebCore/fileapi/FileReader.h
Source/WebCore/history/CachedFrame.cpp
Source/WebCore/history/PageCache.cpp
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/PublicURLManager.cpp
Source/WebCore/html/PublicURLManager.h
Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp
Source/WebCore/html/canvas/WebGLRenderingContextBase.h
Source/WebCore/loader/FrameLoader.cpp
Source/WebCore/loader/appcache/DOMApplicationCache.cpp
Source/WebCore/loader/appcache/DOMApplicationCache.h
Source/WebCore/page/DOMWindow.cpp
Source/WebCore/page/DOMWindow.h
Source/WebCore/page/DOMWindowExtension.cpp
Source/WebCore/page/DOMWindowExtension.h
Source/WebCore/page/DOMWindowProperty.cpp
Source/WebCore/page/DOMWindowProperty.h
Source/WebCore/page/EventSource.cpp
Source/WebCore/page/EventSource.h
Source/WebCore/page/SuspendableTimer.cpp
Source/WebCore/page/SuspendableTimer.h
Source/WebCore/workers/Worker.cpp
Source/WebCore/workers/Worker.h
Source/WebCore/xml/XMLHttpRequest.cpp
Source/WebCore/xml/XMLHttpRequest.h
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/WebView/WebFrame.mm

index b84744b..1117fe9 100644 (file)
@@ -1,3 +1,188 @@
+2015-11-30  Katlyn Graff  <kgraff@apple.com>
+
+        Rename ActiveDOMObject/DOMWindow PageCacheSuspension code to support more reasons for suspension
+        https://bugs.webkit.org/show_bug.cgi?id=151677
+
+        Reviewed by Ryosuke Niwa.
+
+        Simply a refactoring patch, so no new tests.
+
+        * Modules/encryptedmedia/MediaKeySession.cpp:
+        (WebCore::MediaKeySession::canSuspendForDocumentSuspension):
+        (WebCore::MediaKeySession::canSuspendForPageCache): Deleted.
+        * Modules/encryptedmedia/MediaKeySession.h:
+        * Modules/geolocation/Geolocation.cpp:
+        (WebCore::Geolocation::canSuspendForDocumentSuspension):
+        (WebCore::Geolocation::canSuspendForPageCache): Deleted.
+        * Modules/geolocation/Geolocation.h:
+        * Modules/indexeddb/DOMWindowIndexedDatabase.cpp:
+        (WebCore::DOMWindowIndexedDatabase::disconnectFrameForDocumentSuspension):
+        (WebCore::DOMWindowIndexedDatabase::reconnectFrameFromDocumentSuspension):
+        (WebCore::DOMWindowIndexedDatabase::disconnectFrameForPageCache): Deleted.
+        (WebCore::DOMWindowIndexedDatabase::reconnectFrameFromPageCache): Deleted.
+        * Modules/indexeddb/DOMWindowIndexedDatabase.h:
+        * Modules/indexeddb/client/IDBDatabaseImpl.cpp:
+        (WebCore::IDBClient::IDBDatabase::canSuspendForDocumentSuspension):
+        (WebCore::IDBClient::IDBDatabase::canSuspendForPageCache): Deleted.
+        * Modules/indexeddb/client/IDBDatabaseImpl.h:
+        * Modules/indexeddb/client/IDBRequestImpl.cpp:
+        (WebCore::IDBClient::IDBRequest::canSuspendForDocumentSuspension):
+        (WebCore::IDBClient::IDBRequest::canSuspendForPageCache): Deleted.
+        * Modules/indexeddb/client/IDBRequestImpl.h:
+        * Modules/indexeddb/client/IDBTransactionImpl.cpp:
+        (WebCore::IDBClient::IDBTransaction::canSuspendForDocumentSuspension):
+        (WebCore::IDBClient::IDBTransaction::canSuspendForPageCache): Deleted.
+        * Modules/indexeddb/client/IDBTransactionImpl.h:
+        * Modules/indexeddb/legacy/LegacyDatabase.cpp:
+        (WebCore::LegacyDatabase::canSuspendForDocumentSuspension):
+        (WebCore::LegacyDatabase::canSuspendForPageCache): Deleted.
+        * Modules/indexeddb/legacy/LegacyDatabase.h:
+        * Modules/indexeddb/legacy/LegacyRequest.cpp:
+        (WebCore::LegacyRequest::canSuspendForDocumentSuspension):
+        (WebCore::LegacyRequest::canSuspendForPageCache): Deleted.
+        * Modules/indexeddb/legacy/LegacyRequest.h:
+        * Modules/indexeddb/legacy/LegacyTransaction.cpp:
+        (WebCore::LegacyTransaction::canSuspendForDocumentSuspension):
+        (WebCore::LegacyTransaction::canSuspendForPageCache): Deleted.
+        * Modules/indexeddb/legacy/LegacyTransaction.h:
+        * Modules/mediasource/MediaSource.cpp:
+        (WebCore::MediaSource::canSuspendForDocumentSuspension):
+        (WebCore::MediaSource::canSuspendForPageCache): Deleted.
+        * Modules/mediasource/MediaSource.h:
+        * Modules/mediasource/SourceBuffer.cpp:
+        (WebCore::SourceBuffer::canSuspendForDocumentSuspension):
+        (WebCore::SourceBuffer::canSuspendForPageCache): Deleted.
+        * Modules/mediasource/SourceBuffer.h:
+        * Modules/mediastream/MediaStreamTrack.cpp:
+        (WebCore::MediaStreamTrack::canSuspendForDocumentSuspension):
+        (WebCore::MediaStreamTrack::canSuspendForPageCache): Deleted.
+        * Modules/mediastream/MediaStreamTrack.h:
+        * Modules/mediastream/RTCDTMFSender.cpp:
+        (WebCore::RTCDTMFSender::canSuspendForDocumentSuspension):
+        (WebCore::RTCDTMFSender::canSuspendForPageCache): Deleted.
+        * Modules/mediastream/RTCDTMFSender.h:
+        * Modules/mediastream/RTCPeerConnection.cpp:
+        (WebCore::RTCPeerConnection::canSuspendForDocumentSuspension):
+        (WebCore::RTCPeerConnection::canSuspendForPageCache): Deleted.
+        * Modules/mediastream/RTCPeerConnection.h:
+        * Modules/notifications/DOMWindowNotifications.cpp:
+        (WebCore::DOMWindowNotifications::disconnectFrameForDocumentSuspension):
+        (WebCore::DOMWindowNotifications::reconnectFrameFromDocumentSuspension):
+        (WebCore::DOMWindowNotifications::disconnectFrameForPageCache): Deleted.
+        (WebCore::DOMWindowNotifications::reconnectFrameFromPageCache): Deleted.
+        * Modules/notifications/DOMWindowNotifications.h:
+        * Modules/notifications/Notification.cpp:
+        (WebCore::Notification::canSuspendForDocumentSuspension):
+        (WebCore::Notification::canSuspendForPageCache): Deleted.
+        * Modules/notifications/Notification.h:
+        * Modules/notifications/NotificationCenter.cpp:
+        (WebCore::NotificationCenter::canSuspendForDocumentSuspension):
+        (WebCore::NotificationCenter::canSuspendForPageCache): Deleted.
+        * Modules/notifications/NotificationCenter.h:
+        * Modules/webaudio/AudioContext.cpp:
+        (WebCore::AudioContext::canSuspendForDocumentSuspension):
+        (WebCore::AudioContext::canSuspendForPageCache): Deleted.
+        * Modules/webaudio/AudioContext.h:
+        * Modules/webdatabase/DatabaseContext.cpp:
+        (WebCore::DatabaseContext::canSuspendForDocumentSuspension):
+        (WebCore::DatabaseContext::canSuspendForPageCache): Deleted.
+        * Modules/webdatabase/DatabaseContext.h:
+        * Modules/websockets/WebSocket.cpp:
+        (WebCore::WebSocket::canSuspendForDocumentSuspension):
+        (WebCore::WebSocket::canSuspendForPageCache): Deleted.
+        * Modules/websockets/WebSocket.h:
+        * css/FontLoader.cpp:
+        (WebCore::FontLoader::canSuspendForDocumentSuspension):
+        (WebCore::FontLoader::canSuspendForPageCache): Deleted.
+        * css/FontLoader.h:
+        * dom/ActiveDOMObject.cpp:
+        (WebCore::ActiveDOMObject::canSuspendForDocumentSuspension):
+        (WebCore::ActiveDOMObject::canSuspendForPageCache): Deleted.
+        * dom/ActiveDOMObject.h:
+        * dom/Document.cpp:
+        (WebCore::Document::~Document):
+        * dom/ScriptExecutionContext.cpp:
+        (WebCore::ScriptExecutionContext::canSuspendActiveDOMObjectsForTabSuspension):
+        (WebCore::ScriptExecutionContext::canSuspendActiveDOMObjectsForPageCache): Deleted.
+        * dom/ScriptExecutionContext.h:
+        * fileapi/FileReader.cpp:
+        (WebCore::FileReader::canSuspendForDocumentSuspension):
+        (WebCore::FileReader::canSuspendForPageCache): Deleted.
+        * fileapi/FileReader.h:
+        * history/CachedFrame.cpp:
+        (WebCore::CachedFrame::CachedFrame):
+        * history/PageCache.cpp:
+        (WebCore::canCacheFrame):
+        * html/HTMLMarqueeElement.cpp:
+        (WebCore::HTMLMarqueeElement::canSuspendForDocumentSuspension):
+        (WebCore::HTMLMarqueeElement::canSuspendForPageCache): Deleted.
+        * html/HTMLMarqueeElement.h:
+        * html/HTMLMediaElement.cpp:
+        (WebCore::HTMLMediaElement::canSuspendForDocumentSuspension):
+        (WebCore::HTMLMediaElement::canSuspendForPageCache): Deleted.
+        * html/HTMLMediaElement.h:
+        * html/HTMLSourceElement.cpp:
+        (WebCore::HTMLSourceElement::canSuspendForDocumentSuspension):
+        (WebCore::HTMLSourceElement::canSuspendForPageCache): Deleted.
+        * html/HTMLSourceElement.h:
+        * html/PublicURLManager.cpp:
+        (WebCore::PublicURLManager::canSuspendForDocumentSuspension):
+        (WebCore::PublicURLManager::canSuspendForPageCache): Deleted.
+        * html/PublicURLManager.h:
+        * html/canvas/WebGLRenderingContextBase.cpp:
+        (WebCore::WebGLRenderingContextBase::canSuspendForDocumentSuspension):
+        (WebCore::WebGLRenderingContextBase::canSuspendForPageCache): Deleted.
+        * html/canvas/WebGLRenderingContextBase.h:
+        * loader/FrameLoader.cpp:
+        (WebCore::FrameLoader::clear):
+        (WebCore::FrameLoader::open):
+        * loader/appcache/DOMApplicationCache.cpp:
+        (WebCore::DOMApplicationCache::disconnectFrameForDocumentSuspension):
+        (WebCore::DOMApplicationCache::reconnectFrameFromDocumentSuspension):
+        (WebCore::DOMApplicationCache::disconnectFrameForPageCache): Deleted.
+        (WebCore::DOMApplicationCache::reconnectFrameFromPageCache): Deleted.
+        * loader/appcache/DOMApplicationCache.h:
+        * page/DOMWindow.cpp:
+        (WebCore::DOMWindow::DOMWindow):
+        (WebCore::DOMWindow::~DOMWindow):
+        (WebCore::DOMWindow::resetUnlessSuspendedForDocumentSuspension):
+        (WebCore::DOMWindow::suspendForDocumentSuspension):
+        (WebCore::DOMWindow::resumeFromDocumentSuspension):
+        (WebCore::DOMWindow::disconnectDOMWindowProperties):
+        (WebCore::DOMWindow::reconnectDOMWindowProperties):
+        (WebCore::DOMWindow::resetUnlessSuspendedForPageCache): Deleted.
+        (WebCore::DOMWindow::suspendForPageCache): Deleted.
+        (WebCore::DOMWindow::resumeFromPageCache): Deleted.
+        * page/DOMWindow.h:
+        * page/DOMWindowExtension.cpp:
+        (WebCore::DOMWindowExtension::disconnectFrameForDocumentSuspension):
+        (WebCore::DOMWindowExtension::reconnectFrameFromDocumentSuspension):
+        (WebCore::DOMWindowExtension::disconnectFrameForPageCache): Deleted.
+        (WebCore::DOMWindowExtension::reconnectFrameFromPageCache): Deleted.
+        * page/DOMWindowExtension.h:
+        * page/DOMWindowProperty.cpp:
+        (WebCore::DOMWindowProperty::disconnectFrameForDocumentSuspension):
+        (WebCore::DOMWindowProperty::reconnectFrameFromDocumentSuspension):
+        (WebCore::DOMWindowProperty::disconnectFrameForPageCache): Deleted.
+        (WebCore::DOMWindowProperty::reconnectFrameFromPageCache): Deleted.
+        * page/DOMWindowProperty.h:
+        * page/EventSource.cpp:
+        (WebCore::EventSource::canSuspendForDocumentSuspension):
+        (WebCore::EventSource::canSuspendForPageCache): Deleted.
+        * page/EventSource.h:
+        * page/SuspendableTimer.cpp:
+        (WebCore::SuspendableTimer::canSuspendForDocumentSuspension):
+        (WebCore::SuspendableTimer::canSuspendForPageCache): Deleted.
+        * page/SuspendableTimer.h:
+        * workers/Worker.cpp:
+        (WebCore::Worker::canSuspendForDocumentSuspension):
+        (WebCore::Worker::canSuspendForPageCache): Deleted.
+        * workers/Worker.h:
+        * xml/XMLHttpRequest.cpp:
+        (WebCore::XMLHttpRequest::canSuspendForDocumentSuspension):
+        (WebCore::XMLHttpRequest::canSuspendForPageCache): Deleted.
+        * xml/XMLHttpRequest.h:
+
 2015-11-30  Brady Eidson  <beidson@apple.com>
 
         Modern IDB: "prevunique" cursors should point at the lowest primary key that matches, not the highest.
index 1e4286c..b218104 100644 (file)
@@ -265,7 +265,7 @@ const char* MediaKeySession::activeDOMObjectName() const
     return "MediaKeySession";
 }
 
-bool MediaKeySession::canSuspendForPageCache() const
+bool MediaKeySession::canSuspendForDocumentSuspension() const
 {
     // FIXME: We should try and do better here.
     return false;
index 3f58a34..a46dba4 100644 (file)
@@ -113,7 +113,7 @@ private:
 
     // ActiveDOMObject API.
     void stop() override;
-    bool canSuspendForPageCache() const override;
+    bool canSuspendForDocumentSuspension() const override;
     const char* activeDOMObjectName() const override;
 };
 
index dc4726a..f923737 100644 (file)
@@ -161,7 +161,7 @@ Page* Geolocation::page() const
     return document() ? document()->page() : nullptr;
 }
 
-bool Geolocation::canSuspendForPageCache() const
+bool Geolocation::canSuspendForDocumentSuspension() const
 {
     return true;
 }
index e5feec5..088352f 100644 (file)
@@ -79,7 +79,7 @@ private:
 
     // ActiveDOMObject
     void stop() override;
-    bool canSuspendForPageCache() const override;
+    bool canSuspendForDocumentSuspension() const override;
     void suspend(ReasonForSuspension) override;
     void resume() override;
     const char* activeDOMObjectName() const override;
index 7c31415..cc19f41 100644 (file)
@@ -64,15 +64,15 @@ DOMWindowIndexedDatabase* DOMWindowIndexedDatabase::from(DOMWindow* window)
     return supplement;
 }
 
-void DOMWindowIndexedDatabase::disconnectFrameForPageCache()
+void DOMWindowIndexedDatabase::disconnectFrameForDocumentSuspension()
 {
     m_suspendedIDBFactory = m_idbFactory.release();
-    DOMWindowProperty::disconnectFrameForPageCache();
+    DOMWindowProperty::disconnectFrameForDocumentSuspension();
 }
 
-void DOMWindowIndexedDatabase::reconnectFrameFromPageCache(Frame* frame)
+void DOMWindowIndexedDatabase::reconnectFrameFromDocumentSuspension(Frame* frame)
 {
-    DOMWindowProperty::reconnectFrameFromPageCache(frame);
+    DOMWindowProperty::reconnectFrameFromDocumentSuspension(frame);
     m_idbFactory = m_suspendedIDBFactory.release();
 }
 
index a0be850..3ffb71c 100644 (file)
@@ -46,8 +46,8 @@ public:
 
     static IDBFactory* indexedDB(DOMWindow*);
 
-    virtual void disconnectFrameForPageCache() override;
-    virtual void reconnectFrameFromPageCache(Frame*) override;
+    virtual void disconnectFrameForDocumentSuspension() override;
+    virtual void reconnectFrameFromDocumentSuspension(Frame*) override;
     virtual void willDestroyGlobalObjectInCachedFrame() override;
     virtual void willDestroyGlobalObjectInFrame() override;
     virtual void willDetachGlobalObjectFromFrame() override;
index 7f0500d..3095e98 100644 (file)
@@ -234,7 +234,7 @@ const char* IDBDatabase::activeDOMObjectName() const
     return "IDBDatabase";
 }
 
-bool IDBDatabase::canSuspendForPageCache() const
+bool IDBDatabase::canSuspendForDocumentSuspension() const
 {
     // FIXME: This value will sometimes be false when database operations are actually in progress.
     // Such database operations do not yet exist.
index fdc0bf8..b13f60a 100644 (file)
@@ -67,7 +67,7 @@ public:
     virtual void derefEventTarget() override final { deref(); }
 
     virtual const char* activeDOMObjectName() const override final;
-    virtual bool canSuspendForPageCache() const override final;
+    virtual bool canSuspendForDocumentSuspension() const override final;
 
     const IDBDatabaseInfo& info() const { return m_info; }
     uint64_t databaseConnectionIdentifier() const { return m_databaseConnectionIdentifier; }
index 1daec00..d87b442 100644 (file)
@@ -216,7 +216,7 @@ const char* IDBRequest::activeDOMObjectName() const
     return "IDBRequest";
 }
 
-bool IDBRequest::canSuspendForPageCache() const
+bool IDBRequest::canSuspendForDocumentSuspension() const
 {
     return false;
 }
index e23fd83..1e72d0e 100644 (file)
@@ -108,7 +108,7 @@ protected:
 
     // ActiveDOMObject.
     virtual const char* activeDOMObjectName() const override final;
-    virtual bool canSuspendForPageCache() const override final;
+    virtual bool canSuspendForDocumentSuspension() const override final;
     virtual bool hasPendingActivity() const override final;
     
     // EventTarget.
index f57c8e3..9482058 100644 (file)
@@ -206,7 +206,7 @@ const char* IDBTransaction::activeDOMObjectName() const
     return "IDBTransaction";
 }
 
-bool IDBTransaction::canSuspendForPageCache() const
+bool IDBTransaction::canSuspendForDocumentSuspension() const
 {
     return false;
 }
index b5374f3..48ac296 100644 (file)
@@ -79,7 +79,7 @@ public:
     virtual bool dispatchEvent(Event&) override final;
 
     virtual const char* activeDOMObjectName() const override final;
-    virtual bool canSuspendForPageCache() const override final;
+    virtual bool canSuspendForDocumentSuspension() const override final;
     virtual bool hasPendingActivity() const override final;
 
     const IDBTransactionInfo info() const { return m_info; }
index d03f128..865c9f2 100644 (file)
@@ -393,7 +393,7 @@ const char* LegacyDatabase::activeDOMObjectName() const
     return "LegacyDatabase";
 }
 
-bool LegacyDatabase::canSuspendForPageCache() const
+bool LegacyDatabase::canSuspendForDocumentSuspension() const
 {
     return m_isClosed;
 }
index ea1eb5f..651ecb4 100644 (file)
@@ -110,7 +110,7 @@ private:
     // ActiveDOMObject API.
     void stop() override;
     const char* activeDOMObjectName() const override;
-    bool canSuspendForPageCache() const override;
+    bool canSuspendForDocumentSuspension() const override;
 
     // EventTarget
     virtual void refEventTarget() override final { ref(); }
index 2c747a5..c18447d 100644 (file)
@@ -451,7 +451,7 @@ void LegacyRequest::stop()
         markEarlyDeath();
 }
 
-bool LegacyRequest::canSuspendForPageCache() const
+bool LegacyRequest::canSuspendForDocumentSuspension() const
 {
     return !m_hasPendingActivity;
 }
index eb1fbae..2816914 100644 (file)
@@ -126,7 +126,7 @@ private:
     // ActiveDOMObject API.
     void stop() override;
     const char* activeDOMObjectName() const override;
-    bool canSuspendForPageCache() const override;
+    bool canSuspendForDocumentSuspension() const override;
 
     // EventTarget API.
     virtual void refEventTarget() override final { ref(); }
index ce849fd..2e9497f 100644 (file)
@@ -340,7 +340,7 @@ bool LegacyTransaction::dispatchEvent(Event& event)
     return returnValue;
 }
 
-bool LegacyTransaction::canSuspendForPageCache() const
+bool LegacyTransaction::canSuspendForDocumentSuspension() const
 {
     // FIXME: Technically we can suspend before the first request is schedule
     //        and after the complete/abort event is enqueued.
index f79dec3..9f7750e 100644 (file)
@@ -111,7 +111,7 @@ private:
     void unregisterOpenCursor(LegacyCursor*);
 
     // ActiveDOMObject API.
-    bool canSuspendForPageCache() const override;
+    bool canSuspendForDocumentSuspension() const override;
     void stop() override;
     const char* activeDOMObjectName() const override;
 
index 23c37bf..24cb0e5 100644 (file)
@@ -814,7 +814,7 @@ void MediaSource::stop()
     m_private = nullptr;
 }
 
-bool MediaSource::canSuspendForPageCache() const
+bool MediaSource::canSuspendForDocumentSuspension() const
 {
     return isClosed() && !m_asyncEventQueue.hasPendingEvents();
 }
index 0599ef0..a4f4a5c 100644 (file)
@@ -119,7 +119,7 @@ protected:
 
     // ActiveDOMObject API.
     void stop() override;
-    bool canSuspendForPageCache() const override;
+    bool canSuspendForDocumentSuspension() const override;
     const char* activeDOMObjectName() const override;
 
     void onReadyStateChange(const AtomicString& oldState, const AtomicString& newState);
index c86e820..8d64616 100644 (file)
@@ -510,7 +510,7 @@ void SourceBuffer::stop()
     m_removeTimer.stop();
 }
 
-bool SourceBuffer::canSuspendForPageCache() const
+bool SourceBuffer::canSuspendForDocumentSuspension() const
 {
     return !hasPendingActivity();
 }
index eda4399..8f3d034 100644 (file)
@@ -139,7 +139,7 @@ private:
     // ActiveDOMObject API.
     void stop() override;
     const char* activeDOMObjectName() const override;
-    bool canSuspendForPageCache() const override;
+    bool canSuspendForDocumentSuspension() const override;
 
     // SourceBufferPrivateClient
     virtual void sourceBufferPrivateDidEndStream(SourceBufferPrivate*, const WTF::AtomicString&) override;
index d7a2a5e..61d06ea 100644 (file)
@@ -264,7 +264,7 @@ const char* MediaStreamTrack::activeDOMObjectName() const
     return "MediaStreamTrack";
 }
 
-bool MediaStreamTrack::canSuspendForPageCache() const
+bool MediaStreamTrack::canSuspendForDocumentSuspension() const
 {
     // FIXME: We should try and do better here.
     return false;
index 72e75a6..8d78bdd 100644 (file)
@@ -108,7 +108,7 @@ private:
     // ActiveDOMObject API.
     void stop() override final;
     const char* activeDOMObjectName() const override final;
-    bool canSuspendForPageCache() const override final;
+    bool canSuspendForDocumentSuspension() const override final;
 
     // EventTarget
     virtual void refEventTarget() override final { ref(); }
index c9e2cca..ac2b84f 100644 (file)
@@ -139,7 +139,7 @@ const char* RTCDTMFSender::activeDOMObjectName() const
     return "RTCDTMFSender";
 }
 
-bool RTCDTMFSender::canSuspendForPageCache() const
+bool RTCDTMFSender::canSuspendForDocumentSuspension() const
 {
     // FIXME: We should try and do better here.
     return false;
index aa5dda9..9992ce0 100644 (file)
@@ -69,7 +69,7 @@ private:
     // ActiveDOMObject
     void stop() override;
     const char* activeDOMObjectName() const override;
-    bool canSuspendForPageCache() const override;
+    bool canSuspendForDocumentSuspension() const override;
 
     void scheduleDispatchEvent(Ref<Event>&&);
     void scheduledEventTimerFired();
index 1cc66a2..0352b01 100644 (file)
@@ -398,7 +398,7 @@ const char* RTCPeerConnection::activeDOMObjectName() const
     return "RTCPeerConnection";
 }
 
-bool RTCPeerConnection::canSuspendForPageCache() const
+bool RTCPeerConnection::canSuspendForDocumentSuspension() const
 {
     // FIXME: We should try and do better here.
     return false;
index dea2ccc..a4f9025 100644 (file)
@@ -117,7 +117,7 @@ private:
     // ActiveDOMObject
     void stop() override;
     const char* activeDOMObjectName() const override;
-    bool canSuspendForPageCache() const override;
+    bool canSuspendForDocumentSuspension() const override;
 
     // PeerConnectionBackendClient
     void setSignalingState(PeerConnectionStates::SignalingState) override;
index bd2a1a3..83b99ae 100644 (file)
@@ -68,15 +68,15 @@ NotificationCenter* DOMWindowNotifications::webkitNotifications(DOMWindow* windo
     return DOMWindowNotifications::from(window)->webkitNotifications();
 }
 
-void DOMWindowNotifications::disconnectFrameForPageCache()
+void DOMWindowNotifications::disconnectFrameForDocumentSuspension()
 {
     m_suspendedNotificationCenter = m_notificationCenter.release();
-    DOMWindowProperty::disconnectFrameForPageCache();
+    DOMWindowProperty::disconnectFrameForDocumentSuspension();
 }
 
-void DOMWindowNotifications::reconnectFrameFromPageCache(Frame* frame)
+void DOMWindowNotifications::reconnectFrameFromDocumentSuspension(Frame* frame)
 {
-    DOMWindowProperty::reconnectFrameFromPageCache(frame);
+    DOMWindowProperty::reconnectFrameFromDocumentSuspension(frame);
     m_notificationCenter = m_suspendedNotificationCenter.release();
 }
 
index 7e99728..e9d1bfe 100644 (file)
@@ -46,8 +46,8 @@ public:
     static NotificationCenter* webkitNotifications(DOMWindow*);
     static DOMWindowNotifications* from(DOMWindow*);
 
-    virtual void disconnectFrameForPageCache() override;
-    virtual void reconnectFrameFromPageCache(Frame*) override;
+    virtual void disconnectFrameForDocumentSuspension() override;
+    virtual void reconnectFrameFromDocumentSuspension(Frame*) override;
     virtual void willDestroyGlobalObjectInCachedFrame() override;
     virtual void willDestroyGlobalObjectInFrame() override;
     virtual void willDetachGlobalObjectFromFrame() override;
index 8f70fe1..bfeaab9 100644 (file)
@@ -175,7 +175,7 @@ const char* Notification::activeDOMObjectName() const
     return "Notification";
 }
 
-bool Notification::canSuspendForPageCache() const
+bool Notification::canSuspendForDocumentSuspension() const
 {
     // We can suspend if the Notification is not shown yet or after it is closed.
     return m_state == Idle || m_state == Closed;
index db69339..3c4d46b 100644 (file)
@@ -140,7 +140,7 @@ private:
     // ActiveDOMObject API.
     void contextDestroyed() override;
     const char* activeDOMObjectName() const override;
-    bool canSuspendForPageCache() const override;
+    bool canSuspendForDocumentSuspension() const override;
 
     // EventTarget API.
     virtual void refEventTarget() override { ref(); }
index 18b0093..c7f06d1 100644 (file)
@@ -137,7 +137,7 @@ const char* NotificationCenter::activeDOMObjectName() const
     return "NotificationCenter";
 }
 
-bool NotificationCenter::canSuspendForPageCache() const
+bool NotificationCenter::canSuspendForDocumentSuspension() const
 {
     // We don't need to worry about Notifications because those are ActiveDOMObject too.
     // The NotificationCenter can safely be suspended if there are no pending permission requests.
index 3581f45..ffec9ab 100644 (file)
@@ -65,7 +65,7 @@ private:
 
     void stop() override;
     const char* activeDOMObjectName() const override;
-    bool canSuspendForPageCache() const override;
+    bool canSuspendForDocumentSuspension() const override;
 
     void timerFired();
 
index 40a40b1..19cf7cc 100644 (file)
@@ -355,7 +355,7 @@ void AudioContext::stop()
     });
 }
 
-bool AudioContext::canSuspendForPageCache() const
+bool AudioContext::canSuspendForDocumentSuspension() 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;
index 37bac49..1531151 100644 (file)
@@ -308,7 +308,7 @@ private:
 
     // ActiveDOMObject API.
     void stop() override;
-    bool canSuspendForPageCache() const override;
+    bool canSuspendForDocumentSuspension() const override;
     const char* activeDOMObjectName() const override;
 
     // When the context goes away, there might still be some sources which haven't finished playing.
index 6030cc1..42be91b 100644 (file)
@@ -142,7 +142,7 @@ void DatabaseContext::stop()
     stopDatabases();
 }
 
-bool DatabaseContext::canSuspendForPageCache() const
+bool DatabaseContext::canSuspendForDocumentSuspension() const
 {
     if (!hasOpenDatabases() || !m_databaseThread)
         return true;
index 54d54e0..d5b912c 100644 (file)
@@ -71,7 +71,7 @@ private:
 
     void contextDestroyed() override;
     void stop() override;
-    bool canSuspendForPageCache() const override;
+    bool canSuspendForDocumentSuspension() const override;
     const char* activeDOMObjectName() const override { return "DatabaseContext"; }
 
     RefPtr<DatabaseThread> m_databaseThread;
index 41eb109..0f47681 100644 (file)
@@ -475,7 +475,7 @@ void WebSocket::contextDestroyed()
     ActiveDOMObject::contextDestroyed();
 }
 
-bool WebSocket::canSuspendForPageCache() const
+bool WebSocket::canSuspendForDocumentSuspension() const
 {
     return true;
 }
index 1200454..e07f408 100644 (file)
@@ -115,7 +115,7 @@ private:
 
     // ActiveDOMObject API.
     void contextDestroyed() override;
-    bool canSuspendForPageCache() const override;
+    bool canSuspendForDocumentSuspension() const override;
     void suspend(ReasonForSuspension) override;
     void resume() override;
     void stop() override;
index c907460..933b4a3 100644 (file)
@@ -161,7 +161,7 @@ const char* FontLoader::activeDOMObjectName() const
     return "FontLoader";
 }
 
-bool FontLoader::canSuspendForPageCache() const
+bool FontLoader::canSuspendForDocumentSuspension() const
 {
     return !m_numLoadingFromCSS && !m_numLoadingFromJS;
 }
index 3344594..e1008fa 100644 (file)
@@ -89,7 +89,7 @@ private:
 
     // ActiveDOMObject API.
     const char* activeDOMObjectName() const override;
-    bool canSuspendForPageCache() const override;
+    bool canSuspendForDocumentSuspension() const override;
 
     void scheduleEvent(PassRefPtr<Event>);
     void firePendingEvents();
index bd27cac..d6cfe29 100644 (file)
@@ -90,7 +90,7 @@ bool ActiveDOMObject::hasPendingActivity() const
     return m_pendingActivityCount;
 }
 
-bool ActiveDOMObject::canSuspendForPageCache() const
+bool ActiveDOMObject::canSuspendForDocumentSuspension() const
 {
     return false;
 }
index 463c98b..fb1c04e 100644 (file)
@@ -42,11 +42,11 @@ public:
 
     virtual bool hasPendingActivity() const;
 
-    // The canSuspendForPageCache() function is used by the caller if there is a choice between suspending
+    // 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 canSuspendForPageCache() returns false.
+    // 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.
 
@@ -62,7 +62,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 canSuspendForPageCache() const = 0; // Returning false in canSuspendForPageCache() will prevent the page from entering the PageCache.
+    virtual bool canSuspendForDocumentSuspension() const = 0; // Returning false in canSuspendForDocumentSuspension() will prevent the page from entering the PageCache.
     virtual void suspend(ReasonForSuspension);
     virtual void resume();
 
index 519ffb0..4c9e369 100644 (file)
@@ -604,7 +604,7 @@ Document::~Document()
 
     // FIXME: Should we reset m_domWindow when we detach from the Frame?
     if (m_domWindow)
-        m_domWindow->resetUnlessSuspendedForPageCache();
+        m_domWindow->resetUnlessSuspendedForDocumentSuspension();
 
     m_scriptRunner = nullptr;
     m_moduleLoader = nullptr;
index f052d86..366e16e 100644 (file)
@@ -176,7 +176,7 @@ void ScriptExecutionContext::didLoadResourceSynchronously(const ResourceRequest&
 {
 }
 
-bool ScriptExecutionContext::canSuspendActiveDOMObjectsForPageCache(Vector<ActiveDOMObject*>* unsuspendableObjects)
+bool ScriptExecutionContext::canSuspendActiveDOMObjectsForDocumentSuspension(Vector<ActiveDOMObject*>* unsuspendableObjects)
 {
     checkConsistency();
 
@@ -193,7 +193,7 @@ bool ScriptExecutionContext::canSuspendActiveDOMObjectsForPageCache(Vector<Activ
     // canSuspend functions so it will not happen!
     NoEventDispatchAssertion assertNoEventDispatch;
     for (auto* activeDOMObject : m_activeDOMObjects) {
-        if (!activeDOMObject->canSuspendForPageCache()) {
+        if (!activeDOMObject->canSuspendForDocumentSuspension()) {
             canSuspend = false;
             if (unsuspendableObjects)
                 unsuspendableObjects->append(activeDOMObject);
index 14030f8..9d0058c 100644 (file)
@@ -85,9 +85,9 @@ public:
     PublicURLManager& publicURLManager();
 
     // Active objects are not garbage collected even if inaccessible, e.g. because their activity may result in callbacks being invoked.
-    WEBCORE_EXPORT bool canSuspendActiveDOMObjectsForPageCache(Vector<ActiveDOMObject*>* unsuspendableObjects = nullptr);
+    WEBCORE_EXPORT bool canSuspendActiveDOMObjectsForDocumentSuspension(Vector<ActiveDOMObject*>* unsuspendableObjects = nullptr);
 
-    // Active objects can be asked to suspend even if canSuspendActiveDOMObjectsForPageCache() returns 'false' -
+    // Active objects can be asked to suspend even if canSuspendActiveDOMObjectsForDocumentSuspension() returns 'false' -
     // step-by-step JS debugging is one example.
     virtual void suspendActiveDOMObjects(ActiveDOMObject::ReasonForSuspension);
     virtual void resumeActiveDOMObjects(ActiveDOMObject::ReasonForSuspension);
index a071018..1d9a095 100644 (file)
@@ -65,7 +65,7 @@ FileReader::~FileReader()
     terminate();
 }
 
-bool FileReader::canSuspendForPageCache() const
+bool FileReader::canSuspendForDocumentSuspension() const
 {
     // FIXME: It is not currently possible to suspend a FileReader, so pages with FileReader can not go into page cache.
     return false;
index 98ccf62..27f4b61 100644 (file)
@@ -97,7 +97,7 @@ private:
 
     // ActiveDOMObject API.
     const char* activeDOMObjectName() const override;
-    bool canSuspendForPageCache() const override;
+    bool canSuspendForDocumentSuspension() const override;
     void stop() override;
 
     // EventTarget
index 45e64ba..260fdb3 100644 (file)
@@ -170,7 +170,7 @@ CachedFrame::CachedFrame(Frame& frame)
     m_document->suspendActiveDOMObjects(ActiveDOMObject::PageCache);
     m_cachedFrameScriptData = std::make_unique<ScriptCachedFrameData>(frame);
 
-    m_document->domWindow()->suspendForPageCache();
+    m_document->domWindow()->suspendForDocumentSuspension();
 
     frame.loader().client().savePlatformDataToCachedFrame(this);
 
index b854302..523cb10 100644 (file)
@@ -149,7 +149,7 @@ static bool canCacheFrame(Frame& frame, DiagnosticLoggingClient& diagnosticLoggi
     }
 
     Vector<ActiveDOMObject*> unsuspendableObjects;
-    if (!frame.document()->canSuspendActiveDOMObjectsForPageCache(&unsuspendableObjects)) {
+    if (!frame.document()->canSuspendActiveDOMObjectsForDocumentSuspension(&unsuspendableObjects)) {
         PCLOG("   -The document cannot suspend its active DOM Objects");
         for (auto* activeDOMObject : unsuspendableObjects) {
             PCLOG("    - Unsuspendable: ", activeDOMObject->activeDOMObjectName());
index 23ffbb0..9958ba1 100644 (file)
@@ -166,7 +166,7 @@ void HTMLMarqueeElement::setLoop(int loop, ExceptionCode& ec)
         setIntegralAttribute(loopAttr, loop);
 }
 
-bool HTMLMarqueeElement::canSuspendForPageCache() const
+bool HTMLMarqueeElement::canSuspendForDocumentSuspension() const
 {
     return true;
 }
index eba3f79..394a163 100644 (file)
@@ -57,7 +57,7 @@ private:
     virtual void collectStyleForPresentationAttribute(const QualifiedName&, const AtomicString&, MutableStyleProperties&) override;
 
     // ActiveDOMObject
-    virtual bool canSuspendForPageCache() const override;
+    virtual bool canSuspendForDocumentSuspension() const override;
     virtual void suspend(ReasonForSuspension) override;
     virtual void resume() override;
     virtual const char* activeDOMObjectName() const override { return "HTMLMarqueeElement"; }
index 4daf4a6..e0cdb89 100644 (file)
@@ -4946,7 +4946,7 @@ void HTMLMediaElement::clearMediaPlayer(int flags)
     updateSleepDisabling();
 }
 
-bool HTMLMediaElement::canSuspendForPageCache() const
+bool HTMLMediaElement::canSuspendForDocumentSuspension() const
 {
     return true; 
 }
index d4e38d0..d4cc796 100644 (file)
@@ -504,7 +504,7 @@ private:
 
     // ActiveDOMObject API.
     const char* activeDOMObjectName() const override;
-    bool canSuspendForPageCache() const override;
+    bool canSuspendForDocumentSuspension() const override;
     void suspend(ReasonForSuspension) override;
     void resume() override;
     void stop() override;
index 2931ce0..1fec4fe 100644 (file)
@@ -129,7 +129,7 @@ const char* HTMLSourceElement::activeDOMObjectName() const
     return "HTMLSourceElement";
 }
 
-bool HTMLSourceElement::canSuspendForPageCache() const
+bool HTMLSourceElement::canSuspendForDocumentSuspension() const
 {
     return true;
 }
index f373fb9..5eaf135 100644 (file)
@@ -54,7 +54,7 @@ private:
 
     // ActiveDOMObject.
     const char* activeDOMObjectName() const override;
-    bool canSuspendForPageCache() const override;
+    bool canSuspendForDocumentSuspension() const override;
     void suspend(ReasonForSuspension) override;
     void resume() override;
     void stop() override;
index 417f97c..468d83f 100644 (file)
@@ -80,7 +80,7 @@ void PublicURLManager::stop()
     m_registryToURL.clear();
 }
 
-bool PublicURLManager::canSuspendForPageCache() const
+bool PublicURLManager::canSuspendForDocumentSuspension() const
 {
     // Suspending an PublicURLManager is safe as it does not cause any JS to be executed.
     return true;
index 500054e..4f94fc1 100644 (file)
@@ -53,7 +53,7 @@ public:
 private:
     // ActiveDOMObject API.
     void stop() override;
-    bool canSuspendForPageCache() const override;
+    bool canSuspendForDocumentSuspension() const override;
     const char* activeDOMObjectName() const override;
     
     typedef HashSet<String> URLSet;
index 61ba366..f6fca9d 100644 (file)
@@ -3927,7 +3927,7 @@ const char* WebGLRenderingContextBase::activeDOMObjectName() const
     return "WebGLRenderingContext";
 }
 
-bool WebGLRenderingContextBase::canSuspendForPageCache() const
+bool WebGLRenderingContextBase::canSuspendForDocumentSuspension() const
 {
     // FIXME: We should try and do better here.
     return false;
index ca058b1..82902ac 100644 (file)
@@ -384,7 +384,7 @@ protected:
     virtual bool hasPendingActivity() const override;
     virtual void stop() override;
     virtual const char* activeDOMObjectName() const override;
-    bool canSuspendForPageCache() const override;
+    bool canSuspendForDocumentSuspension() const override;
 
     void addSharedObject(WebGLSharedObject*);
     void addContextObject(WebGLContextObject*);
index 523b30d..48150a0 100644 (file)
@@ -584,7 +584,7 @@ void FrameLoader::clear(Document* newDocument, bool clearWindowProperties, bool
     // Do this after detaching the document so that the unload event works.
     if (clearWindowProperties) {
         InspectorInstrumentation::frameWindowDiscarded(&m_frame, m_frame.document()->domWindow());
-        m_frame.document()->domWindow()->resetUnlessSuspendedForPageCache();
+        m_frame.document()->domWindow()->resetUnlessSuspendedForDocumentSuspension();
         m_frame.script().clearWindowShell(newDocument->domWindow(), m_frame.document()->inPageCache());
     }
 
@@ -2074,7 +2074,7 @@ void FrameLoader::open(CachedFrameBase& cachedFrame)
         view->setFrameRect(previousViewFrameRect.value());
     
     m_frame.setDocument(document);
-    document->domWindow()->resumeFromPageCache();
+    document->domWindow()->resumeFromDocumentSuspension();
 
     updateFirstPartyForCookies();
 
index e58e279..a7c0777 100644 (file)
@@ -46,16 +46,16 @@ DOMApplicationCache::DOMApplicationCache(Frame* frame)
         cacheHost->setDOMApplicationCache(this);
 }
 
-void DOMApplicationCache::disconnectFrameForPageCache()
+void DOMApplicationCache::disconnectFrameForDocumentSuspension()
 {
     if (ApplicationCacheHost* cacheHost = applicationCacheHost())
         cacheHost->setDOMApplicationCache(nullptr);
-    DOMWindowProperty::disconnectFrameForPageCache();
+    DOMWindowProperty::disconnectFrameForDocumentSuspension();
 }
 
-void DOMApplicationCache::reconnectFrameFromPageCache(Frame* frame)
+void DOMApplicationCache::reconnectFrameFromDocumentSuspension(Frame* frame)
 {
-    DOMWindowProperty::reconnectFrameFromPageCache(frame);
+    DOMWindowProperty::reconnectFrameFromDocumentSuspension(frame);
     if (ApplicationCacheHost* cacheHost = applicationCacheHost())
         cacheHost->setDOMApplicationCache(this);
 }
index 44f1218..08101f4 100644 (file)
@@ -46,8 +46,8 @@ public:
     static Ref<DOMApplicationCache> create(Frame* frame) { return adoptRef(*new DOMApplicationCache(frame)); }
     virtual ~DOMApplicationCache() { ASSERT(!m_frame); }
 
-    virtual void disconnectFrameForPageCache() override;
-    virtual void reconnectFrameFromPageCache(Frame*) override;
+    virtual void disconnectFrameForDocumentSuspension() override;
+    virtual void reconnectFrameFromDocumentSuspension(Frame*) override;
     virtual void willDestroyGlobalObjectInFrame() override;
 
     unsigned short status() const;
index a34a1ed..1e9c708 100644 (file)
@@ -393,7 +393,7 @@ DOMWindow::DOMWindow(Document* document)
     : ContextDestructionObserver(document)
     , FrameDestructionObserver(document->frame())
     , m_shouldPrintWhenFinishedLoading(false)
-    , m_suspendedForPageCache(false)
+    , m_suspendedForDocumentSuspension(false)
     , m_lastPageStatus(PageStatusNone)
     , m_weakPtrFactory(this)
 #if PLATFORM(IOS)
@@ -418,7 +418,7 @@ void DOMWindow::didSecureTransitionTo(Document* document)
 DOMWindow::~DOMWindow()
 {
 #ifndef NDEBUG
-    if (!m_suspendedForPageCache) {
+    if (!m_suspendedForDocumentSuspension) {
         ASSERT(!m_screen);
         ASSERT(!m_history);
         ASSERT(!m_crypto);
@@ -440,7 +440,7 @@ DOMWindow::~DOMWindow()
     }
 #endif
 
-    if (m_suspendedForPageCache)
+    if (m_suspendedForDocumentSuspension)
         willDestroyCachedFrame();
     else
         willDestroyDocumentInFrame();
@@ -542,45 +542,45 @@ void DOMWindow::unregisterProperty(DOMWindowProperty* property)
     m_properties.remove(property);
 }
 
-void DOMWindow::resetUnlessSuspendedForPageCache()
+void DOMWindow::resetUnlessSuspendedForDocumentSuspension()
 {
-    if (m_suspendedForPageCache)
+    if (m_suspendedForDocumentSuspension)
         return;
     willDestroyDocumentInFrame();
     resetDOMWindowProperties();
 }
 
-void DOMWindow::suspendForPageCache()
+void DOMWindow::suspendForDocumentSuspension()
 {
     disconnectDOMWindowProperties();
-    m_suspendedForPageCache = true;
+    m_suspendedForDocumentSuspension = true;
 }
 
-void DOMWindow::resumeFromPageCache()
+void DOMWindow::resumeFromDocumentSuspension()
 {
     reconnectDOMWindowProperties();
-    m_suspendedForPageCache = false;
+    m_suspendedForDocumentSuspension = false;
 }
 
 void DOMWindow::disconnectDOMWindowProperties()
 {
     // It is necessary to copy m_properties to a separate vector because the DOMWindowProperties may
-    // unregister themselves from the DOMWindow as a result of the call to disconnectFrameForPageCache.
+    // unregister themselves from the DOMWindow as a result of the call to disconnectFrameForDocumentSuspension.
     Vector<DOMWindowProperty*> properties;
     copyToVector(m_properties, properties);
     for (auto& property : properties)
-        property->disconnectFrameForPageCache();
+        property->disconnectFrameForDocumentSuspension();
 }
 
 void DOMWindow::reconnectDOMWindowProperties()
 {
-    ASSERT(m_suspendedForPageCache);
+    ASSERT(m_suspendedForDocumentSuspension);
     // It is necessary to copy m_properties to a separate vector because the DOMWindowProperties may
     // unregister themselves from the DOMWindow as a result of the call to reconnectFromPageCache.
     Vector<DOMWindowProperty*> properties;
     copyToVector(m_properties, properties);
     for (auto& property : properties)
-        property->reconnectFrameFromPageCache(m_frame);
+        property->reconnectFrameFromDocumentSuspension(m_frame);
 }
 
 void DOMWindow::resetDOMWindowProperties()
index b5001bc..19474fb 100644 (file)
@@ -119,9 +119,9 @@ namespace WebCore {
         void registerProperty(DOMWindowProperty*);
         void unregisterProperty(DOMWindowProperty*);
 
-        void resetUnlessSuspendedForPageCache();
-        void suspendForPageCache();
-        void resumeFromPageCache();
+        void resetUnlessSuspendedForDocumentSuspension();
+        void suspendForDocumentSuspension();
+        void resumeFromDocumentSuspension();
 
         PassRefPtr<MediaQueryList> matchMedia(const String&);
 
@@ -369,7 +369,7 @@ namespace WebCore {
 #endif
 
         bool m_shouldPrintWhenFinishedLoading;
-        bool m_suspendedForPageCache;
+        bool m_suspendedForDocumentSuspension;
 
         HashSet<DOMWindowProperty*> m_properties;
 
index 3356100..0e62b34 100644 (file)
@@ -43,7 +43,7 @@ DOMWindowExtension::DOMWindowExtension(Frame* frame, DOMWrapperWorld& world)
     ASSERT(this->frame());
 }
 
-void DOMWindowExtension::disconnectFrameForPageCache()
+void DOMWindowExtension::disconnectFrameForDocumentSuspension()
 {
     // Calling out to the client might result in this DOMWindowExtension being destroyed
     // while there is still work to do.
@@ -54,14 +54,14 @@ void DOMWindowExtension::disconnectFrameForPageCache()
 
     m_disconnectedFrame = frame;
 
-    DOMWindowProperty::disconnectFrameForPageCache();
+    DOMWindowProperty::disconnectFrameForDocumentSuspension();
 }
 
-void DOMWindowExtension::reconnectFrameFromPageCache(Frame* frame)
+void DOMWindowExtension::reconnectFrameFromDocumentSuspension(Frame* frame)
 {
     ASSERT(m_disconnectedFrame == frame);
     
-    DOMWindowProperty::reconnectFrameFromPageCache(frame);
+    DOMWindowProperty::reconnectFrameFromDocumentSuspension(frame);
     m_disconnectedFrame = nullptr;
 
     this->frame()->loader().client().dispatchDidReconnectDOMWindowExtensionToGlobalObject(this);
index a978ffc..36218d1 100644 (file)
@@ -43,8 +43,8 @@ public:
         return adoptRef(*new DOMWindowExtension(frame, world));
     }
 
-    virtual void disconnectFrameForPageCache() override;
-    virtual void reconnectFrameFromPageCache(Frame*) override;
+    virtual void disconnectFrameForDocumentSuspension() override;
+    virtual void reconnectFrameFromDocumentSuspension(Frame*) override;
     virtual void willDestroyGlobalObjectInCachedFrame() override;
     virtual void willDestroyGlobalObjectInFrame() override;
     virtual void willDetachGlobalObjectFromFrame() override;
index e17e53f..a3770e8 100644 (file)
@@ -55,7 +55,7 @@ DOMWindowProperty::~DOMWindowProperty()
     m_frame = nullptr;
 }
 
-void DOMWindowProperty::disconnectFrameForPageCache()
+void DOMWindowProperty::disconnectFrameForDocumentSuspension()
 {
     // If this property is being disconnected from its Frame to enter the PageCache, it must have
     // been created with a Frame in the first place.
@@ -65,7 +65,7 @@ void DOMWindowProperty::disconnectFrameForPageCache()
     m_frame = nullptr;
 }
 
-void DOMWindowProperty::reconnectFrameFromPageCache(Frame* frame)
+void DOMWindowProperty::reconnectFrameFromDocumentSuspension(Frame* frame)
 {
     // If this property is being reconnected to its Frame to enter the PageCache, it must have
     // been disconnected from its Frame in the first place and it should still have an associated DOMWindow.
index e2dcc44..f6624ad 100644 (file)
@@ -35,8 +35,8 @@ class DOMWindowProperty {
 public:
     explicit DOMWindowProperty(Frame*);
 
-    virtual void disconnectFrameForPageCache();
-    virtual void reconnectFrameFromPageCache(Frame*);
+    virtual void disconnectFrameForDocumentSuspension();
+    virtual void reconnectFrameFromDocumentSuspension(Frame*);
     virtual void willDestroyGlobalObjectInCachedFrame();
     virtual void willDestroyGlobalObjectInFrame();
     virtual void willDetachGlobalObjectFromFrame();
index 4a10151..b8341e6 100644 (file)
@@ -404,7 +404,7 @@ const char* EventSource::activeDOMObjectName() const
     return "EventSource";
 }
 
-bool EventSource::canSuspendForPageCache() const
+bool EventSource::canSuspendForDocumentSuspension() const
 {
     // FIXME: We should try and do better here.
     return false;
index 1d25458..9e81a2a 100644 (file)
@@ -90,7 +90,7 @@ private:
     // ActiveDOMObject API.
     void stop() override;
     const char* activeDOMObjectName() const override;
-    bool canSuspendForPageCache() const override;
+    bool canSuspendForDocumentSuspension() const override;
 
     void connect();
     void networkRequestEnded();
index 79b04fd..76583c1 100644 (file)
@@ -84,7 +84,7 @@ void SuspendableTimer::resume()
         start(m_savedNextFireInterval, m_savedRepeatInterval);
 }
 
-bool SuspendableTimer::canSuspendForPageCache() const
+bool SuspendableTimer::canSuspendForDocumentSuspension() const
 {
     return true;
 }
index 578fc3b..a01dd5e 100644 (file)
@@ -60,7 +60,7 @@ private:
     // ActiveDOMObject API.
     bool hasPendingActivity() const override final;
     void stop() override final;
-    bool canSuspendForPageCache() const override final;
+    bool canSuspendForDocumentSuspension() const override final;
     void suspend(ReasonForSuspension) override final;
     void resume() override final;
 
index e868906..de3d4e1 100644 (file)
@@ -124,7 +124,7 @@ void Worker::terminate()
     m_contextProxy->terminateWorkerGlobalScope();
 }
 
-bool Worker::canSuspendForPageCache() const
+bool Worker::canSuspendForDocumentSuspension() const
 {
     // FIXME: It is not currently possible to suspend a worker, so pages with workers can not go into page cache.
     return false;
index d9dba4b..0985751 100644 (file)
@@ -75,7 +75,7 @@ namespace WebCore {
         virtual void notifyFinished() override;
 
         // ActiveDOMObject API.
-        bool canSuspendForPageCache() const override;
+        bool canSuspendForDocumentSuspension() const override;
         void stop() override;
         const char* activeDOMObjectName() const override;
 
index 804b708..4c48c94 100644 (file)
@@ -1246,7 +1246,7 @@ void XMLHttpRequest::didReachTimeout()
     dispatchErrorEvents(eventNames().timeoutEvent);
 }
 
-bool XMLHttpRequest::canSuspendForPageCache() const
+bool XMLHttpRequest::canSuspendForDocumentSuspension() 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.
index a5d130b..32c712f 100644 (file)
@@ -148,7 +148,7 @@ private:
 
     // ActiveDOMObject
     void contextDestroyed() override;
-    bool canSuspendForPageCache() const override;
+    bool canSuspendForDocumentSuspension() const override;
     void suspend(ReasonForSuspension) override;
     void resume() override;
     void stop() override;
index 821ad59..883eb41 100644 (file)
@@ -1,3 +1,13 @@
+2015-11-30  Katlyn Graff  <kgraff@apple.com>
+
+        Rename ActiveDOMObject/DOMWindow PageCacheSuspension code to support more reasons for suspension
+        https://bugs.webkit.org/show_bug.cgi?id=151677
+
+        Reviewed by Ryosuke Niwa.
+
+        * WebView/WebFrame.mm:
+        (-[WebFrame _cacheabilityDictionary]):
+
 2015-11-30  Jiewen Tan  <jiewen_tan@apple.com>
 
         Null dereference loading Blink layout test http/tests/misc/detach-during-notifyDone.html
index f219060..7973800 100644 (file)
@@ -2053,7 +2053,7 @@ static WebFrameLoadType toWebFrameLoadType(FrameLoadType frameLoadType)
     if (Document* document = _private->coreFrame->document()) {
         if (DatabaseManager::singleton().hasOpenDatabases(document))
             [result setObject:[NSNumber numberWithBool:YES] forKey:WebFrameUsesDatabases];
-        if (!document->canSuspendActiveDOMObjectsForPageCache())
+        if (!document->canSuspendActiveDOMObjectsForDocumentSuspension())
             [result setObject:[NSNumber numberWithBool:YES] forKey:WebFrameCanSuspendActiveDOMObjects];
     }