forEachEntry(callback) {
    return new Promise((resolve, reject) => {
      const req = this.store_.openCursor();
      req.onerror = reject;
      req.onsuccess = async (event) => {
        // When we reach the end of the data that the cursor is iterating over,
        // |req.result| will be null to signal the end of the iteration.
        // https://developer.mozilla.org/en-US/docs/Web/API/IDBCursor/continue
        if (req.result == null) {
          resolve();
          return;
        }

        /** @type {!IDBCursorWithValue} */
        const cursor = req.result;
        await callback(cursor.key, cursor.value, cursor);
        cursor.continue();
      };
    });
  }
Calls the given callback for each entry in the database.

@param {function(!IDBKeyType, T, !IDBCursorWithValue=):
            (Promise|undefined)} callback
@return {!Promise}
@template T