Fire map callback if map async operation fails

Bug: dawn:400
Change-Id: If656239714f2c088e52aff30ef27a20f2fc42ba8
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/21940
Commit-Queue: Natasha Lee <natlee@microsoft.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
diff --git a/src/dawn_native/Buffer.cpp b/src/dawn_native/Buffer.cpp
index b293b96..6da550b 100644
--- a/src/dawn_native/Buffer.cpp
+++ b/src/dawn_native/Buffer.cpp
@@ -271,7 +271,7 @@
         mState = BufferState::Mapped;
 
         if (GetDevice()->ConsumedError(MapReadAsyncImpl(mMapSerial))) {
-            // TODO(natlee@microsoft.com): if map op fails fire callback with DEVICE_LOST status
+            CallMapReadCallback(mMapSerial, WGPUBufferMapAsyncStatus_DeviceLost, nullptr, 0);
             return;
         }
 
@@ -312,7 +312,7 @@
         mState = BufferState::Mapped;
 
         if (GetDevice()->ConsumedError(MapWriteAsyncImpl(mMapSerial))) {
-            // TODO(natlee@microsoft.com): if map op fails fire callback with DEVICE_LOST status
+            CallMapWriteCallback(mMapSerial, WGPUBufferMapAsyncStatus_DeviceLost, nullptr, 0);
             return;
         }