Exemple #1
0
void
AddFeatureToStreamChild(const nsTArray<PCacheResponse>& aResponses,
                         Feature* aFeature)
{
  for (uint32_t i = 0; i < aResponses.Length(); ++i) {
    AddFeatureToStreamChild(aResponses[i], aFeature);
  }
}
Exemple #2
0
void
AddFeatureToStreamChild(const PCacheResponse& aResponse,
                        Feature* aFeature)
{
  if (aResponse.body().type() == PCacheReadStreamOrVoid::Tvoid_t) {
    return;
  }

  AddFeatureToStreamChild(aResponse.body().get_PCacheReadStream(), aFeature);
}
Exemple #3
0
void
AddFeatureToStreamChild(const PCacheResponseOrVoid& aResponseOrVoid,
                        Feature* aFeature)
{
  if (aResponseOrVoid.type() == PCacheResponseOrVoid::Tvoid_t) {
    return;
  }

  AddFeatureToStreamChild(aResponseOrVoid.get_PCacheResponse(), aFeature);
}
Exemple #4
0
void
AddFeatureToStreamChild(const nsTArray<PCacheRequest>& aRequests,
                         Feature* aFeature)
{
  for (uint32_t i = 0; i < aRequests.Length(); ++i) {
    if (aRequests[i].body().type() == PCacheReadStreamOrVoid::Tvoid_t) {
      continue;
    }
    AddFeatureToStreamChild(aRequests[i].body().get_PCacheReadStream(),
                            aFeature);
  }
}
Exemple #5
0
bool
CacheChild::RecvMatchResponse(const RequestId& requestId, const nsresult& aRv,
                              const PCacheResponseOrVoid& aResponse)
{
  NS_ASSERT_OWNINGTHREAD(CacheChild);

  AddFeatureToStreamChild(aResponse, GetFeature());

  nsRefPtr<Cache> listener = mListener;
  if (!listener) {
    StartDestroyStreamChild(aResponse);
    return true;
  }

  listener->RecvMatchResponse(requestId, aRv, aResponse);
  return true;
}
Exemple #6
0
bool
CacheChild::RecvKeysResponse(const RequestId& requestId, const nsresult& aRv,
                             nsTArray<PCacheRequest>&& aRequests)
{
  NS_ASSERT_OWNINGTHREAD(CacheChild);

  AddFeatureToStreamChild(aRequests, GetFeature());

  nsRefPtr<Cache> listener = mListener;
  if (!listener) {
    StartDestroyStreamChild(aRequests);
    return true;
  }

  listener->RecvKeysResponse(requestId, aRv, aRequests);
  return true;
}