mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 05:11:16 +00:00
Bug 1609797 - Ignore cursor responses after disconnecting from global. r=dom-workers-and-storage-reviewers,asuth
Differential Revision: https://phabricator.services.mozilla.com/D96171
This commit is contained in:
parent
8fe0338fd0
commit
acfbc6daac
@ -3355,9 +3355,18 @@ void BackgroundCursorChild<CursorType>::HandleResponse(
|
||||
nsTArray<ResponseType>&& aResponses) {
|
||||
AssertIsOnOwningThread();
|
||||
|
||||
if constexpr (CursorType == IDBCursorType::ObjectStore) {
|
||||
if constexpr (CursorType == IDBCursorType::ObjectStore ||
|
||||
CursorType == IDBCursorType::Index) {
|
||||
MOZ_ASSERT(mTransaction);
|
||||
|
||||
if (!mTransaction->Database()->GetOwnerGlobal()) {
|
||||
// Ignore the response, since we have already been disconnected from the
|
||||
// global.
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if constexpr (CursorType == IDBCursorType::ObjectStore) {
|
||||
HandleMultipleCursorResponses(
|
||||
std::move(aResponses), [this](const bool useAsCurrentResult,
|
||||
ObjectStoreCursorResponse&& response) {
|
||||
@ -3380,8 +3389,6 @@ void BackgroundCursorChild<CursorType>::HandleResponse(
|
||||
});
|
||||
}
|
||||
if constexpr (CursorType == IDBCursorType::Index) {
|
||||
MOZ_ASSERT(mTransaction);
|
||||
|
||||
HandleMultipleCursorResponses(
|
||||
std::move(aResponses),
|
||||
[this](const bool useAsCurrentResult, IndexCursorResponse&& response) {
|
||||
|
Loading…
Reference in New Issue
Block a user