| Index: third_party/WebKit/Source/modules/fetch/FetchResponseData.cpp
|
| diff --git a/third_party/WebKit/Source/modules/fetch/FetchResponseData.cpp b/third_party/WebKit/Source/modules/fetch/FetchResponseData.cpp
|
| index d835e25e66235919548132294a8b438e201df6c9..34da2108bd242314bbb247acb520eebb5da2a3b5 100644
|
| --- a/third_party/WebKit/Source/modules/fetch/FetchResponseData.cpp
|
| +++ b/third_party/WebKit/Source/modules/fetch/FetchResponseData.cpp
|
| @@ -81,7 +81,7 @@ FetchResponseData* FetchResponseData::createBasicFilteredResponse() const {
|
| // name is `Set-Cookie` or `Set-Cookie2`."
|
| FetchResponseData* response =
|
| new FetchResponseData(BasicType, m_status, m_statusMessage);
|
| - response->m_url = m_url;
|
| + response->setURLList(m_urlList);
|
| for (size_t i = 0; i < m_headerList->size(); ++i) {
|
| const FetchHeaderList::Header* header = m_headerList->list()[i].get();
|
| if (FetchUtils::isForbiddenResponseHeaderName(header->first))
|
| @@ -117,7 +117,7 @@ FetchResponseData* FetchResponseData::createCORSFilteredResponse(
|
| // list."
|
| FetchResponseData* response =
|
| new FetchResponseData(CORSType, m_status, m_statusMessage);
|
| - response->m_url = m_url;
|
| + response->setURLList(m_urlList);
|
| for (size_t i = 0; i < m_headerList->size(); ++i) {
|
| const FetchHeaderList::Header* header = m_headerList->list()[i].get();
|
| const String& name = header->first;
|
| @@ -159,11 +159,19 @@ FetchResponseData* FetchResponseData::createOpaqueRedirectFilteredResponse()
|
| // https://fetch.spec.whatwg.org/#concept-filtered-response-opaque-redirect
|
| FetchResponseData* response =
|
| new FetchResponseData(OpaqueRedirectType, 0, "");
|
| - response->m_url = m_url;
|
| + response->setURLList(m_urlList);
|
| response->m_internalResponse = const_cast<FetchResponseData*>(this);
|
| return response;
|
| }
|
|
|
| +const KURL* FetchResponseData::url() const {
|
| + // "A response has an associated url. It is a pointer to the last response URL
|
| + // in response’s url list and null if response’s url list is the empty list."
|
| + if (m_urlList.isEmpty())
|
| + return nullptr;
|
| + return &m_urlList.back();
|
| +}
|
| +
|
| String FetchResponseData::mimeType() const {
|
| return m_mimeType;
|
| }
|
| @@ -182,6 +190,10 @@ String FetchResponseData::internalMIMEType() const {
|
| return m_mimeType;
|
| }
|
|
|
| +void FetchResponseData::setURLList(const Vector<KURL>& urlList) {
|
| + m_urlList = urlList;
|
| +}
|
| +
|
| FetchResponseData* FetchResponseData::clone(ScriptState* scriptState) {
|
| FetchResponseData* newResponse = create();
|
| newResponse->m_type = m_type;
|
| @@ -189,7 +201,7 @@ FetchResponseData* FetchResponseData::clone(ScriptState* scriptState) {
|
| newResponse->m_terminationReason = wrapUnique(new TerminationReason);
|
| *newResponse->m_terminationReason = *m_terminationReason;
|
| }
|
| - newResponse->m_url = m_url;
|
| + newResponse->setURLList(m_urlList);
|
| newResponse->m_status = m_status;
|
| newResponse->m_statusMessage = m_statusMessage;
|
| newResponse->m_headerList = m_headerList->clone();
|
| @@ -243,8 +255,7 @@ void FetchResponseData::populateWebServiceWorkerResponse(
|
| headerSetToWebVector(m_corsExposedHeaderNames));
|
| return;
|
| }
|
| -
|
| - response.setURL(url());
|
| + response.setURLList(m_urlList);
|
| response.setStatus(status());
|
| response.setStatusText(statusMessage());
|
| response.setResponseType(fetchTypeToWebType(m_type));
|
|
|