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

Side by Side Diff: third_party/WebKit/Source/modules/fetch/FetchResponseData.cpp

Issue 1857723002: Fetch: opaque redirect responses have a URL. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: this. Created 4 years, 8 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "modules/fetch/FetchResponseData.h" 5 #include "modules/fetch/FetchResponseData.h"
6 6
7 #include "core/dom/DOMArrayBuffer.h" 7 #include "core/dom/DOMArrayBuffer.h"
8 #include "core/fetch/CrossOriginAccessControl.h" 8 #include "core/fetch/CrossOriginAccessControl.h"
9 #include "core/fetch/FetchUtils.h" 9 #include "core/fetch/FetchUtils.h"
10 #include "modules/fetch/BodyStreamBuffer.h" 10 #include "modules/fetch/BodyStreamBuffer.h"
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 } 109 }
110 response->m_buffer = m_buffer; 110 response->m_buffer = m_buffer;
111 response->m_mimeType = m_mimeType; 111 response->m_mimeType = m_mimeType;
112 response->m_internalResponse = this; 112 response->m_internalResponse = this;
113 return response; 113 return response;
114 } 114 }
115 115
116 FetchResponseData* FetchResponseData::createOpaqueFilteredResponse() 116 FetchResponseData* FetchResponseData::createOpaqueFilteredResponse()
117 { 117 {
118 // "An opaque filtered response is a filtered response whose type is 118 // "An opaque filtered response is a filtered response whose type is
119 // |opaque|, status is 0, status message is the empty byte sequence, header 119 // 'opaque', url list is the empty list, status is 0, status message is the
120 // list is an empty list, and body is null." 120 // empty byte sequence, header list is the empty list, body is null, and
121 // cache state is 'none'."
122 //
123 // https://fetch.spec.whatwg.org/#concept-filtered-response-opaque
121 FetchResponseData* response = new FetchResponseData(OpaqueType, 0, ""); 124 FetchResponseData* response = new FetchResponseData(OpaqueType, 0, "");
122 response->m_internalResponse = this; 125 response->m_internalResponse = this;
123 return response; 126 return response;
124 } 127 }
125 128
126 FetchResponseData* FetchResponseData::createOpaqueRedirectFilteredResponse() 129 FetchResponseData* FetchResponseData::createOpaqueRedirectFilteredResponse()
127 { 130 {
128 // "An opaque-redirect filtered response is a filtered response whose type 131 // "An opaque filtered response is a filtered response whose type is
129 // is |opaqueredirect|, status is 0, status message is the empty byte 132 // 'opaqueredirect', status is 0, status message is the empty byte sequence,
130 // sequence, header list is the empty list, body is null, and cache state is 133 // header list is the empty list, body is null, and cache state is 'none'."
131 // |none|. 134 //
135 // https://fetch.spec.whatwg.org/#concept-filtered-response-opaque-redirect
132 FetchResponseData* response = new FetchResponseData(OpaqueRedirectType, 0, " "); 136 FetchResponseData* response = new FetchResponseData(OpaqueRedirectType, 0, " ");
137 response->m_url = m_url;
133 response->m_internalResponse = this; 138 response->m_internalResponse = this;
134 return response; 139 return response;
135 } 140 }
136 141
137 String FetchResponseData::mimeType() const 142 String FetchResponseData::mimeType() const
138 { 143 {
139 return m_mimeType; 144 return m_mimeType;
140 } 145 }
141 146
142 BodyStreamBuffer* FetchResponseData::internalBuffer() const 147 BodyStreamBuffer* FetchResponseData::internalBuffer() const
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
248 } 253 }
249 254
250 DEFINE_TRACE(FetchResponseData) 255 DEFINE_TRACE(FetchResponseData)
251 { 256 {
252 visitor->trace(m_headerList); 257 visitor->trace(m_headerList);
253 visitor->trace(m_internalResponse); 258 visitor->trace(m_internalResponse);
254 visitor->trace(m_buffer); 259 visitor->trace(m_buffer);
255 } 260 }
256 261
257 } // namespace blink 262 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698