Bug 1637159 specify DOMEventTargetHelper owner for IDBFileHandle via constructor r=smaug

Differential Revision: https://phabricator.services.mozilla.com/D75037
This commit is contained in:
Karl Tomlinson 2020-05-14 05:28:36 +00:00
parent 4109b160c0
commit d07bf2b285

View File

@ -40,7 +40,8 @@ RefPtr<IDBFileRequest> GenerateFileRequest(IDBFileHandle* aFileHandle) {
} // namespace
IDBFileHandle::IDBFileHandle(IDBMutableFile* aMutableFile, FileMode aMode)
: mMutableFile(aMutableFile),
: DOMEventTargetHelper(aMutableFile),
mMutableFile(aMutableFile),
mBackgroundActor(nullptr),
mLocation(0),
mPendingRequestCount(0),
@ -83,8 +84,6 @@ RefPtr<IDBFileHandle> IDBFileHandle::Create(IDBMutableFile* aMutableFile,
RefPtr<IDBFileHandle> fileHandle = new IDBFileHandle(aMutableFile, aMode);
fileHandle->BindToOwner(aMutableFile);
// XXX Fix!
MOZ_ASSERT(NS_IsMainThread(), "This won't work on non-main threads!");