Ejemplo n.º 1
0
void
CacheOpChild::HandleResponse(const CacheResponseOrVoid& aResponseOrVoid)
{
  if (aResponseOrVoid.type() == CacheResponseOrVoid::Tvoid_t) {
    mPromise->MaybeResolveWithUndefined();
    return;
  }

  const CacheResponse& cacheResponse = aResponseOrVoid.get_CacheResponse();

  AddWorkerHolderToStreamChild(cacheResponse, GetWorkerHolder());
  RefPtr<Response> response = ToResponse(cacheResponse);

  mPromise->MaybeResolve(response);
}
Ejemplo n.º 2
0
void
CacheOpChild::HandleResponse(const CacheResponseOrVoid& aResponseOrVoid)
{
  if (aResponseOrVoid.type() == CacheResponseOrVoid::Tvoid_t) {
    mPromise->MaybeResolve(JS::UndefinedHandleValue);
    return;
  }

  const CacheResponse& cacheResponse = aResponseOrVoid.get_CacheResponse();

  AddFeatureToStreamChild(cacheResponse, GetFeature());
  RefPtr<Response> response = ToResponse(cacheResponse);

  mPromise->MaybeResolve(response);
}