예제 #1
0
void FetchResponseData::populateWebServiceWorkerResponse(WebServiceWorkerResponse& response)
{
    if (m_internalResponse) {
        m_internalResponse->populateWebServiceWorkerResponse(response);
        response.setResponseType(fetchTypeToWebType(m_type));
        return;
    }

    response.setURL(url());
    response.setStatus(status());
    response.setStatusText(statusMessage());
    response.setResponseType(fetchTypeToWebType(m_type));
    for (size_t i = 0; i < headerList()->size(); ++i) {
        const FetchHeaderList::Header* header = headerList()->list()[i].get();
        response.appendHeader(header->first, header->second);
    }
}
예제 #2
0
void FetchResponseData::populateWebServiceWorkerResponse(
    WebServiceWorkerResponse& response) {
  if (m_internalResponse) {
    m_internalResponse->populateWebServiceWorkerResponse(response);
    response.setResponseType(fetchTypeToWebType(m_type));
    response.setCorsExposedHeaderNames(
        headerSetToWebVector(m_corsExposedHeaderNames));
    return;
  }
  response.setURLList(m_urlList);
  response.setStatus(status());
  response.setStatusText(statusMessage());
  response.setResponseType(fetchTypeToWebType(m_type));
  response.setResponseTime(responseTime());
  response.setCacheStorageCacheName(cacheStorageCacheName());
  response.setCorsExposedHeaderNames(
      headerSetToWebVector(m_corsExposedHeaderNames));
  for (size_t i = 0; i < headerList()->size(); ++i) {
    const FetchHeaderList::Header* header = headerList()->list()[i].get();
    response.appendHeader(header->first, header->second);
  }
}