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

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

Issue 2080623002: Revert "Remove OwnPtr from Blink." (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 "bindings/core/v8/ScriptState.h" 7 #include "bindings/core/v8/ScriptState.h"
8 #include "core/dom/DOMArrayBuffer.h" 8 #include "core/dom/DOMArrayBuffer.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"
11 #include "modules/fetch/DataConsumerHandleUtil.h" 11 #include "modules/fetch/DataConsumerHandleUtil.h"
12 #include "modules/fetch/FetchHeaderList.h" 12 #include "modules/fetch/FetchHeaderList.h"
13 #include "public/platform/modules/serviceworker/WebServiceWorkerResponse.h" 13 #include "public/platform/modules/serviceworker/WebServiceWorkerResponse.h"
14 #include "wtf/PtrUtil.h"
15 14
16 namespace blink { 15 namespace blink {
17 16
18 namespace { 17 namespace {
19 18
20 WebServiceWorkerResponseType fetchTypeToWebType(FetchResponseData::Type fetchTyp e) 19 WebServiceWorkerResponseType fetchTypeToWebType(FetchResponseData::Type fetchTyp e)
21 { 20 {
22 WebServiceWorkerResponseType webType = WebServiceWorkerResponseTypeDefault; 21 WebServiceWorkerResponseType webType = WebServiceWorkerResponseTypeDefault;
23 switch (fetchType) { 22 switch (fetchType) {
24 case FetchResponseData::BasicType: 23 case FetchResponseData::BasicType:
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 return m_internalResponse->mimeType(); 182 return m_internalResponse->mimeType();
184 } 183 }
185 return m_mimeType; 184 return m_mimeType;
186 } 185 }
187 186
188 FetchResponseData* FetchResponseData::clone(ScriptState* scriptState) 187 FetchResponseData* FetchResponseData::clone(ScriptState* scriptState)
189 { 188 {
190 FetchResponseData* newResponse = create(); 189 FetchResponseData* newResponse = create();
191 newResponse->m_type = m_type; 190 newResponse->m_type = m_type;
192 if (m_terminationReason) { 191 if (m_terminationReason) {
193 newResponse->m_terminationReason = wrapUnique(new TerminationReason); 192 newResponse->m_terminationReason = adoptPtr(new TerminationReason);
194 *newResponse->m_terminationReason = *m_terminationReason; 193 *newResponse->m_terminationReason = *m_terminationReason;
195 } 194 }
196 newResponse->m_url = m_url; 195 newResponse->m_url = m_url;
197 newResponse->m_status = m_status; 196 newResponse->m_status = m_status;
198 newResponse->m_statusMessage = m_statusMessage; 197 newResponse->m_statusMessage = m_statusMessage;
199 newResponse->m_headerList = m_headerList->clone(); 198 newResponse->m_headerList = m_headerList->clone();
200 newResponse->m_mimeType = m_mimeType; 199 newResponse->m_mimeType = m_mimeType;
201 newResponse->m_responseTime = m_responseTime; 200 newResponse->m_responseTime = m_responseTime;
202 newResponse->m_cacheStorageCacheName = m_cacheStorageCacheName; 201 newResponse->m_cacheStorageCacheName = m_cacheStorageCacheName;
203 newResponse->m_corsExposedHeaderNames = m_corsExposedHeaderNames; 202 newResponse->m_corsExposedHeaderNames = m_corsExposedHeaderNames;
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
282 } 281 }
283 282
284 DEFINE_TRACE(FetchResponseData) 283 DEFINE_TRACE(FetchResponseData)
285 { 284 {
286 visitor->trace(m_headerList); 285 visitor->trace(m_headerList);
287 visitor->trace(m_internalResponse); 286 visitor->trace(m_internalResponse);
288 visitor->trace(m_buffer); 287 visitor->trace(m_buffer);
289 } 288 }
290 289
291 } // namespace blink 290 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/modules/fetch/FetchResponseData.h ('k') | third_party/WebKit/Source/modules/fetch/GlobalFetch.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698