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

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

Issue 2657443005: Migrate WTF::HashSet::add() to ::insert() [part 1 of N] (Closed)
Patch Set: Created 3 years, 10 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 "modules/fetch/BodyStreamBuffer.h" 9 #include "modules/fetch/BodyStreamBuffer.h"
10 #include "modules/fetch/FetchHeaderList.h" 10 #include "modules/fetch/FetchHeaderList.h"
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 new FetchResponseData(CORSType, m_status, m_statusMessage); 119 new FetchResponseData(CORSType, m_status, m_statusMessage);
120 response->setURLList(m_urlList); 120 response->setURLList(m_urlList);
121 for (size_t i = 0; i < m_headerList->size(); ++i) { 121 for (size_t i = 0; i < m_headerList->size(); ++i) {
122 const FetchHeaderList::Header* header = m_headerList->list()[i].get(); 122 const FetchHeaderList::Header* header = m_headerList->list()[i].get();
123 const String& name = header->first; 123 const String& name = header->first;
124 const bool explicitlyExposed = exposedHeaders.contains(name); 124 const bool explicitlyExposed = exposedHeaders.contains(name);
125 if (isOnAccessControlResponseHeaderWhitelist(name) || 125 if (isOnAccessControlResponseHeaderWhitelist(name) ||
126 (explicitlyExposed && 126 (explicitlyExposed &&
127 !FetchUtils::isForbiddenResponseHeaderName(name))) { 127 !FetchUtils::isForbiddenResponseHeaderName(name))) {
128 if (explicitlyExposed) 128 if (explicitlyExposed)
129 response->m_corsExposedHeaderNames.add(name); 129 response->m_corsExposedHeaderNames.insert(name);
130 response->m_headerList->append(name, header->second); 130 response->m_headerList->append(name, header->second);
131 } 131 }
132 } 132 }
133 response->m_buffer = m_buffer; 133 response->m_buffer = m_buffer;
134 response->m_mimeType = m_mimeType; 134 response->m_mimeType = m_mimeType;
135 response->m_internalResponse = const_cast<FetchResponseData*>(this); 135 response->m_internalResponse = const_cast<FetchResponseData*>(this);
136 return response; 136 return response;
137 } 137 }
138 138
139 FetchResponseData* FetchResponseData::createOpaqueFilteredResponse() const { 139 FetchResponseData* FetchResponseData::createOpaqueFilteredResponse() const {
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
296 } 296 }
297 } 297 }
298 298
299 DEFINE_TRACE(FetchResponseData) { 299 DEFINE_TRACE(FetchResponseData) {
300 visitor->trace(m_headerList); 300 visitor->trace(m_headerList);
301 visitor->trace(m_internalResponse); 301 visitor->trace(m_internalResponse);
302 visitor->trace(m_buffer); 302 visitor->trace(m_buffer);
303 } 303 }
304 304
305 } // namespace blink 305 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698