onWebkitKeyMessage_(event) {
    shaka.log.debug('PatchedMediaKeysApple.onWebkitKeyMessage_', event);

    // We can now resolve this.generateRequestPromise, which should be non-null.
    goog.asserts.assert(this.generateRequestPromise_,
        'generateRequestPromise_ should be set before now!');
    if (this.generateRequestPromise_) {
      this.generateRequestPromise_.resolve();
      this.generateRequestPromise_ = null;
    }

    const isNew = this.keyStatuses.getStatus() == undefined;

    const data = new Map()
        .set('messageType', isNew ? 'license-request' : 'license-renewal')
        .set('message', shaka.util.BufferUtils.toArrayBuffer(event.message));
    const event2 = new shaka.util.FakeEvent('message', data);

    this.dispatchEvent(event2);
  }
Handler for the native keymessage event on WebKitMediaKeySession.

@param {!MediaKeyEvent} event
@private