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

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

Issue 1965013002: Implement headers attributes in ForeignFetchResponse (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: using instead of typedef Created 4 years, 7 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/FetchManager.h" 5 #include "modules/fetch/FetchManager.h"
6 6
7 #include "bindings/core/v8/ExceptionState.h" 7 #include "bindings/core/v8/ExceptionState.h"
8 #include "bindings/core/v8/ScriptPromiseResolver.h" 8 #include "bindings/core/v8/ScriptPromiseResolver.h"
9 #include "bindings/core/v8/ScriptState.h" 9 #include "bindings/core/v8/ScriptState.h"
10 #include "bindings/core/v8/V8ThrowException.h" 10 #include "bindings/core/v8/V8ThrowException.h"
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after
324 taintedResponse = responseData->createOpaqueRedirectFilteredResponse (); 324 taintedResponse = responseData->createOpaqueRedirectFilteredResponse ();
325 } 325 }
326 // When the location header doesn't exist, we don't treat the response 326 // When the location header doesn't exist, we don't treat the response
327 // as a redirect response, and execute tainting. 327 // as a redirect response, and execute tainting.
328 } 328 }
329 if (!taintedResponse) { 329 if (!taintedResponse) {
330 switch (tainting) { 330 switch (tainting) {
331 case FetchRequestData::BasicTainting: 331 case FetchRequestData::BasicTainting:
332 taintedResponse = responseData->createBasicFilteredResponse(); 332 taintedResponse = responseData->createBasicFilteredResponse();
333 break; 333 break;
334 case FetchRequestData::CORSTainting: 334 case FetchRequestData::CORSTainting: {
335 taintedResponse = responseData->createCORSFilteredResponse(); 335 HTTPHeaderSet headerNames;
336 extractCorsExposedHeaderNamesList(response, headerNames);
337 taintedResponse = responseData->createCORSFilteredResponse(headerNam es);
336 break; 338 break;
339 }
337 case FetchRequestData::OpaqueTainting: 340 case FetchRequestData::OpaqueTainting:
338 taintedResponse = responseData->createOpaqueFilteredResponse(); 341 taintedResponse = responseData->createOpaqueFilteredResponse();
339 break; 342 break;
340 } 343 }
341 } 344 }
342 345
343 Response* r = Response::create(m_resolver->getExecutionContext(), taintedRes ponse); 346 Response* r = Response::create(m_resolver->getExecutionContext(), taintedRes ponse);
344 if (response.url().protocolIsData()) { 347 if (response.url().protocolIsData()) {
345 // An "Access-Control-Allow-Origin" header is added for data: URLs 348 // An "Access-Control-Allow-Origin" header is added for data: URLs
346 // but no headers except for "Content-Type" should exist, 349 // but no headers except for "Content-Type" should exist,
(...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after
735 loader->dispose(); 738 loader->dispose();
736 } 739 }
737 740
738 DEFINE_TRACE(FetchManager) 741 DEFINE_TRACE(FetchManager)
739 { 742 {
740 visitor->trace(m_loaders); 743 visitor->trace(m_loaders);
741 ContextLifecycleObserver::trace(visitor); 744 ContextLifecycleObserver::trace(visitor);
742 } 745 }
743 746
744 } // namespace blink 747 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698