Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(100)

Unified Diff: Source/modules/fetch/FetchResponseData.cpp

Issue 1265133002: [1/3 blink] Support redirect option of Request and "opaqueredirect" response type. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebase Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/modules/fetch/FetchResponseData.h ('k') | Source/modules/fetch/Request.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/fetch/FetchResponseData.cpp
diff --git a/Source/modules/fetch/FetchResponseData.cpp b/Source/modules/fetch/FetchResponseData.cpp
index 4c5cac22455a9c501c5f6d0a8a9c431e2fadadfe..578193d1f4985436f71fa92088042547e718bdda 100644
--- a/Source/modules/fetch/FetchResponseData.cpp
+++ b/Source/modules/fetch/FetchResponseData.cpp
@@ -36,6 +36,9 @@ WebServiceWorkerResponseType fetchTypeToWebType(FetchResponseData::Type fetchTyp
case FetchResponseData::OpaqueType:
webType = WebServiceWorkerResponseTypeOpaque;
break;
+ case FetchResponseData::OpaqueRedirectType:
+ webType = WebServiceWorkerResponseTypeOpaqueRedirect;
+ break;
}
return webType;
}
@@ -120,6 +123,17 @@ FetchResponseData* FetchResponseData::createOpaqueFilteredResponse()
return response;
}
+FetchResponseData* FetchResponseData::createOpaqueRedirectFilteredResponse()
+{
+ // "An opaque-redirect filtered response is a filtered response whose type
+ // is |opaqueredirect|, status is 0, status message is the empty byte
+ // sequence, header list is the empty list, body is null, and cache state is
+ // |none|.
+ FetchResponseData* response = new FetchResponseData(OpaqueRedirectType, 0, "");
+ response->m_internalResponse = this;
+ return response;
+}
+
String FetchResponseData::mimeType() const
{
return m_mimeType;
@@ -183,6 +197,7 @@ FetchResponseData* FetchResponseData::clone(ExecutionContext* executionContext)
ASSERT(!m_buffer->hasBody());
break;
case OpaqueType:
+ case OpaqueRedirectType:
ASSERT(m_internalResponse);
ASSERT(!m_buffer->hasBody());
ASSERT(m_internalResponse->m_type == DefaultType);
« no previous file with comments | « Source/modules/fetch/FetchResponseData.h ('k') | Source/modules/fetch/Request.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698