Bug 1362944 - Part 2: Set proper event target to MutableBlobStorage when created from XMLHttpRequestMainThread. r=baku

Use the event target provided from XMLHttpRequestMainThread for the runnable dipsatching inside MutableBlobStorage.
This commit is contained in:
Bevis Tseng 2017-05-10 11:45:54 +08:00
parent 32c0a177ae
commit 8ad7fc3ed8

View File

@ -3785,7 +3785,12 @@ XMLHttpRequestMainThread::MaybeCreateBlobStorage()
? MutableBlobStorage::eCouldBeInTemporaryFile
: MutableBlobStorage::eOnlyInMemory;
mBlobStorage = new MutableBlobStorage(storageType);
nsCOMPtr<nsIEventTarget> eventTarget;
if (nsCOMPtr<nsIGlobalObject> global = GetOwnerGlobal()) {
eventTarget = global->EventTargetFor(TaskCategory::Other);
}
mBlobStorage = new MutableBlobStorage(storageType, eventTarget);
}
void