void AddFeatureToStreamChild(const nsTArray<PCacheResponse>& aResponses, Feature* aFeature) { for (uint32_t i = 0; i < aResponses.Length(); ++i) { AddFeatureToStreamChild(aResponses[i], aFeature); } }
void AddFeatureToStreamChild(const PCacheResponse& aResponse, Feature* aFeature) { if (aResponse.body().type() == PCacheReadStreamOrVoid::Tvoid_t) { return; } AddFeatureToStreamChild(aResponse.body().get_PCacheReadStream(), aFeature); }
void AddFeatureToStreamChild(const PCacheResponseOrVoid& aResponseOrVoid, Feature* aFeature) { if (aResponseOrVoid.type() == PCacheResponseOrVoid::Tvoid_t) { return; } AddFeatureToStreamChild(aResponseOrVoid.get_PCacheResponse(), aFeature); }
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); } }
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; }
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; }