Commit 1d41ef06 authored by Adrienne Walker's avatar Adrienne Walker Committed by Commit Bot

indexeddb: fix getall crash with null receiver

When transactions are aborted, any get all operations should still send
an error with a valid receiver.  This avoids a dcheck (and probable
crash later) from mojo due to passing a null receiver.

Bug: 1110781
Change-Id: If142072cae93f29dc3d4c1ac388bc27a3f3939f3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2324525
Commit-Queue: Daniel Murphy <dmurph@chromium.org>
Reviewed-by: default avatarDaniel Murphy <dmurph@chromium.org>
Auto-Submit: enne <enne@chromium.org>
Cr-Commit-Position: refs/heads/master@{#792837}
parent 76cddaa8
...@@ -12,7 +12,14 @@ mojo::PendingReceiver<blink::mojom::IDBDatabaseGetAllResultSink> AbortCallback( ...@@ -12,7 +12,14 @@ mojo::PendingReceiver<blink::mojom::IDBDatabaseGetAllResultSink> AbortCallback(
base::WeakPtr<IndexedDBTransaction> transaction) { base::WeakPtr<IndexedDBTransaction> transaction) {
if (transaction) if (transaction)
transaction->IncrementNumErrorsSent(); transaction->IncrementNumErrorsSent();
return mojo::NullReceiver();
mojo::Remote<blink::mojom::IDBDatabaseGetAllResultSink> remote;
auto receiver = remote.BindNewPipeAndPassReceiver();
IndexedDBDatabaseError error(blink::mojom::IDBException::kIgnorableAbortError,
"Backend aborted error");
remote->OnError(blink::mojom::IDBError::New(error.code(), error.message()));
return receiver;
} }
} // namespace indexed_db_callback_helpers_internal } // namespace indexed_db_callback_helpers_internal
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment