queueData(groupId, queueData, estimateId, isInitSegment, onDownloaded) {
    this.destroyer_.ensureNotDestroyed();

    const group = this.groups_.get(groupId) || Promise.resolve();

    // Add another download to the group.
    const newPromise = group.then(() => {
      // Make sure we stop downloading if we have been destroyed.
      if (this.destroyer_.destroyed()) {
        throw new shaka.util.Error(
            shaka.util.Error.Severity.CRITICAL,
            shaka.util.Error.Category.STORAGE,
            shaka.util.Error.Code.OPERATION_ABORTED);
      }

      // Update initData
      if (isInitSegment) {
        const segmentBytes = shaka.util.BufferUtils.toUint8(queueData);
        const pssh = new shaka.util.Pssh(segmentBytes);
        for (const key in pssh.data) {
          const index = Number(key);
          const data = pssh.data[index];
          const systemId = pssh.systemIds[index];
          this.onInitData_(data, systemId);
        }
      }

      // Update all our internal stats.
      this.estimator_.close(estimateId, queueData.byteLength);
      this.onProgress_(
          this.estimator_.getEstimatedProgress(),
          this.estimator_.getTotalDownloaded());

      return onDownloaded(queueData);
    });

    this.groups_.set(groupId, newPromise);
    return newPromise;
  }
Add already-downloaded data to a group.

@param {number} groupId
   The group to add this segment to. If the group does not exist, a new
   group will be created.
@param {!BufferSource} queueData
@param {number} estimateId
@param {boolean} isInitSegment
@param {function(BufferSource):!Promise} onDownloaded
  The callback for when this request has been downloaded. Downloading for
  |group| will pause until the promise returned by |onDownloaded| resolves.
@return {!Promise} Resolved when this request is complete.