Merge remote-tracking branch 'origin/master' into custom

This commit is contained in:
Roy Tam 2019-10-25 12:02:58 +08:00
commit f55c7f6d89
11 changed files with 62 additions and 39 deletions

View file

@ -3224,6 +3224,12 @@ nsGlobalWindow::SetNewDocument(nsIDocument* aDocument,
newInnerWindow->mLocalStorage = nullptr;
newInnerWindow->mSessionStorage = nullptr;
newInnerWindow->mPerformance = nullptr;
// This must be called after nulling the internal objects because
// we might recreate them here by calling the getter methods, and
// store them into the JS slots. If we null them after, the slot
// values and the objects will be out of sync.
newInnerWindow->ClearDocumentDependentSlots(cx);
}
} else {
@ -3364,10 +3370,16 @@ nsGlobalWindow::InnerSetNewDocument(JSContext* aCx, nsIDocument* aDocument)
}
mDoc = aDocument;
ClearDocumentDependentSlots(aCx);
mFocusedNode = nullptr;
mLocalStorage = nullptr;
mSessionStorage = nullptr;
mPerformance = nullptr;
// This must be called after nulling the internal objects because we might
// recreate them here by calling the getter methods, and store them into the JS
// slots. If we null them after, the slot values and the objects will be
// out of sync.
ClearDocumentDependentSlots(aCx);
#ifdef DEBUG
mLastOpenedURI = aDocument->GetDocumentURI();

View file

@ -9,6 +9,8 @@
#include "WebGLBuffer.h"
#include "WebGLVertexArray.h"
#include "mozilla/CheckedInt.h"
namespace mozilla {
WebGLRefPtr<WebGLBuffer>*
@ -345,6 +347,16 @@ WebGLContext::BufferData(GLenum target, WebGLsizeiptr size, GLenum usage)
////
const auto checkedSize = CheckedInt<size_t>(size);
if (!checkedSize.isValid())
return ErrorOutOfMemory("%s: Size too large for platform.", funcName);
#if defined(XP_MACOSX)
if (gl->WorkAroundDriverBugs() && size > 1200000000) {
return ErrorOutOfMemory("Allocations larger than 1200000000 fail on MacOS.");
}
#endif
const UniqueBuffer zeroBuffer(calloc(size, 1));
if (!zeroBuffer)
return ErrorOutOfMemory("%s: Failed to allocate zeros.", funcName);

View file

@ -1257,6 +1257,9 @@ IDBDatabase::LastRelease()
AssertIsOnOwningThread();
CloseInternal();
// Make sure that file actors created after the database was closed are expired.
ExpireFileActors(/* aExpireAll */ true);
ExpireFileActors(/* aExpireAll */ true);