Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 584 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 595 // header list." | 595 // header list." |
| 596 // We set Origin header in updateRequestForAccessControl() called from | 596 // We set Origin header in updateRequestForAccessControl() called from |
| 597 // DocumentThreadableLoader::makeCrossOriginAccessRequest | 597 // DocumentThreadableLoader::makeCrossOriginAccessRequest |
| 598 | 598 |
| 599 // "5. Let |credentials flag| be set if either |HTTPRequest|'s credentials | 599 // "5. Let |credentials flag| be set if either |HTTPRequest|'s credentials |
| 600 // mode is |include|, or |HTTPRequest|'s credentials mode is |same-origin| | 600 // mode is |include|, or |HTTPRequest|'s credentials mode is |same-origin| |
| 601 // and the |CORS flag| is unset, and unset otherwise. | 601 // and the |CORS flag| is unset, and unset otherwise. |
| 602 ResourceLoaderOptions resourceLoaderOptions; | 602 ResourceLoaderOptions resourceLoaderOptions; |
| 603 resourceLoaderOptions.dataBufferingPolicy = DoNotBufferData; | 603 resourceLoaderOptions.dataBufferingPolicy = DoNotBufferData; |
| 604 if (m_request->credentials() == WebURLRequest::FetchCredentialsModeInclude | 604 if (m_request->credentials() == WebURLRequest::FetchCredentialsModeInclude |
| 605 || m_request->credentials() == WebURLRequest::FetchCredentialsModePasswo rd | |
|
Mike West
2016/04/08 18:49:25
*sobs*
| |
| 605 || (m_request->credentials() == WebURLRequest::FetchCredentialsModeSameO rigin && !corsFlag)) { | 606 || (m_request->credentials() == WebURLRequest::FetchCredentialsModeSameO rigin && !corsFlag)) { |
| 606 resourceLoaderOptions.allowCredentials = AllowStoredCredentials; | 607 resourceLoaderOptions.allowCredentials = AllowStoredCredentials; |
| 607 } | 608 } |
| 608 if (m_request->credentials() == WebURLRequest::FetchCredentialsModeInclude) | 609 if (m_request->credentials() == WebURLRequest::FetchCredentialsModeInclude |
| 610 || m_request->credentials() == WebURLRequest::FetchCredentialsModePasswo rd) { | |
|
Mike West
2016/04/08 18:49:25
*more sobs*
| |
| 609 resourceLoaderOptions.credentialsRequested = ClientRequestedCredentials; | 611 resourceLoaderOptions.credentialsRequested = ClientRequestedCredentials; |
| 612 } | |
| 610 resourceLoaderOptions.securityOrigin = m_request->origin().get(); | 613 resourceLoaderOptions.securityOrigin = m_request->origin().get(); |
| 611 | 614 |
| 612 ThreadableLoaderOptions threadableLoaderOptions; | 615 ThreadableLoaderOptions threadableLoaderOptions; |
| 613 threadableLoaderOptions.contentSecurityPolicyEnforcement = ContentSecurityPo licy::shouldBypassMainWorld(m_executionContext) ? DoNotEnforceContentSecurityPol icy : EnforceContentSecurityPolicy; | 616 threadableLoaderOptions.contentSecurityPolicyEnforcement = ContentSecurityPo licy::shouldBypassMainWorld(m_executionContext) ? DoNotEnforceContentSecurityPol icy : EnforceContentSecurityPolicy; |
| 614 if (corsPreflightFlag) | 617 if (corsPreflightFlag) |
| 615 threadableLoaderOptions.preflightPolicy = ForcePreflight; | 618 threadableLoaderOptions.preflightPolicy = ForcePreflight; |
| 616 switch (m_request->mode()) { | 619 switch (m_request->mode()) { |
| 617 case WebURLRequest::FetchRequestModeSameOrigin: | 620 case WebURLRequest::FetchRequestModeSameOrigin: |
| 618 threadableLoaderOptions.crossOriginRequestPolicy = DenyCrossOriginReques ts; | 621 threadableLoaderOptions.crossOriginRequestPolicy = DenyCrossOriginReques ts; |
| 619 break; | 622 break; |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 736 loader->dispose(); | 739 loader->dispose(); |
| 737 } | 740 } |
| 738 | 741 |
| 739 DEFINE_TRACE(FetchManager) | 742 DEFINE_TRACE(FetchManager) |
| 740 { | 743 { |
| 741 visitor->trace(m_loaders); | 744 visitor->trace(m_loaders); |
| 742 ContextLifecycleObserver::trace(visitor); | 745 ContextLifecycleObserver::trace(visitor); |
| 743 } | 746 } |
| 744 | 747 |
| 745 } // namespace blink | 748 } // namespace blink |
| OLD | NEW |