mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 696591: Properly handle blocking databases from pages that are entering the bfcache. r=bent,bz
This commit is contained in:
parent
309e48cc08
commit
dc63804499
@ -464,8 +464,22 @@ public:
|
||||
return GetBFCacheEntry() ? nullptr : mPresShell;
|
||||
}
|
||||
|
||||
void DisallowBFCaching()
|
||||
{
|
||||
NS_ASSERTION(!mBFCacheEntry, "We're already in the bfcache!");
|
||||
mBFCacheDisallowed = true;
|
||||
}
|
||||
|
||||
bool IsBFCachingAllowed() const
|
||||
{
|
||||
return !mBFCacheDisallowed;
|
||||
}
|
||||
|
||||
void SetBFCacheEntry(nsIBFCacheEntry* aEntry)
|
||||
{
|
||||
NS_ASSERTION(IsBFCachingAllowed() || !aEntry,
|
||||
"You should have checked!");
|
||||
|
||||
mBFCacheEntry = aEntry;
|
||||
}
|
||||
|
||||
@ -1916,6 +1930,9 @@ protected:
|
||||
// True if a document has loaded Mixed Active Script (see nsMixedContentBlocker.cpp)
|
||||
bool mHasMixedActiveContentLoaded;
|
||||
|
||||
// True if DisallowBFCaching has been called on this document.
|
||||
bool mBFCacheDisallowed;
|
||||
|
||||
// The document's script global object, the object from which the
|
||||
// document can get its script context and scope. This is the
|
||||
// *inner* window object.
|
||||
|
@ -1511,6 +1511,23 @@ public:
|
||||
continue;
|
||||
}
|
||||
|
||||
// Next check if it's in the process of being bfcached.
|
||||
nsPIDOMWindow* owner = database->GetOwner();
|
||||
if (owner && owner->IsFrozen()) {
|
||||
// We can't kick the document out of the bfcache because it's not yet
|
||||
// fully in the bfcache. Instead we'll abort everything for the window
|
||||
// and mark it as not-bfcacheable.
|
||||
indexedDB::IndexedDatabaseManager* manager =
|
||||
indexedDB::IndexedDatabaseManager::Get();
|
||||
NS_ASSERTION(manager, "Huh?");
|
||||
manager->AbortCloseDatabasesForWindow(owner);
|
||||
|
||||
NS_ASSERTION(database->IsClosed(),
|
||||
"AbortCloseDatabasesForWindow should have closed database");
|
||||
ownerDoc->DisallowBFCaching();
|
||||
continue;
|
||||
}
|
||||
|
||||
// Otherwise fire a versionchange event.
|
||||
nsRefPtr<nsDOMEvent> event =
|
||||
IDBVersionChangeEvent::Create(mOldVersion, mNewVersion);
|
||||
|
@ -1542,7 +1542,7 @@ nsDocumentViewer::Destroy()
|
||||
mSHEntry->SetSticky(mIsSticky);
|
||||
mIsSticky = true;
|
||||
|
||||
bool savePresentation = true;
|
||||
bool savePresentation = mDocument ? mDocument->IsBFCachingAllowed() : true;
|
||||
|
||||
// Remove our root view from the view hierarchy.
|
||||
if (mPresShell) {
|
||||
|
Loading…
Reference in New Issue
Block a user