[WGPUFuture] Implements mapAsync and use futures in wire.

- Extend TrackedEvents for different events so that we can properly
  pass around data that needs to be returned.
- We implement mapAsync and use futures in the wire for WorkDone in the
  same change because those two need to be on the same code path to
  ensure ordering.
- Removes a test that is no longer relevant since `signalValue` is to be
  deprecated, and was failing since the new path does not provide it.
- Note for the wire we just use Spontaneous for the old path for now
  because that's effectively what it was doing before.

Bug: dawn:2052, dawn:2060
Change-Id: I2ab2d8e65f09d2685625b8bfa6a633c907eab49d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/152621
Commit-Queue: Loko Kung <lokokung@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
diff --git a/dawn_wire.json b/dawn_wire.json
index 9137f2d..3f334d6 100644
--- a/dawn_wire.json
+++ b/dawn_wire.json
@@ -20,7 +20,7 @@
     "commands": {
         "buffer map async": [
             { "name": "buffer id", "type": "ObjectId", "id_type": "buffer" },
-            { "name": "request serial", "type": "uint64_t" },
+            { "name": "future", "type": "future" },
             { "name": "mode", "type": "map mode" },
             { "name": "offset", "type": "uint64_t"},
             { "name": "size", "type": "uint64_t"}
@@ -64,7 +64,7 @@
         "queue on submitted work done": [
             { "name": "queue id", "type": "ObjectId", "id_type": "queue" },
             { "name": "signal value", "type": "uint64_t" },
-            { "name": "request serial", "type": "uint64_t" }
+            { "name": "future", "type": "future" }
         ],
         "queue write buffer": [
             {"name": "queue id", "type": "ObjectId", "id_type": "queue" },
@@ -101,7 +101,7 @@
     "return commands": {
         "buffer map async callback": [
             { "name": "buffer", "type": "ObjectHandle", "handle_type": "buffer" },
-            { "name": "request serial", "type": "uint64_t" },
+            { "name": "future", "type": "future" },
             { "name": "status", "type": "uint32_t" },
             { "name": "read data update info length", "type": "uint64_t" },
             { "name": "read data update info", "type": "uint8_t", "annotation": "const*", "length": "read data update info length", "skip_serialize": true }
@@ -141,7 +141,7 @@
         ],
         "queue work done callback": [
             { "name": "queue", "type": "ObjectHandle", "handle_type": "queue" },
-            { "name": "request serial", "type": "uint64_t" },
+	    { "name": "future", "type": "future" },
             { "name": "status", "type": "queue work done status" }
         ],
         "shader module get compilation info callback": [
@@ -188,6 +188,7 @@
             "AdapterEnumerateFeatures",
             "AdapterRequestDevice",
             "BufferMapAsync",
+            "BufferMapAsyncF",
             "BufferGetConstMappedRange",
             "BufferGetMappedRange",
             "BufferGetMapState",