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 527 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
538 } | 538 } |
539 request.setFetchRedirectMode(m_request->redirect()); | 539 request.setFetchRedirectMode(m_request->redirect()); |
540 request.setUseStreamOnResponse(true); | 540 request.setUseStreamOnResponse(true); |
541 | 541 |
542 // "2. Append `Referer`/empty byte sequence, if |HTTPRequest|'s |referrer| | 542 // "2. Append `Referer`/empty byte sequence, if |HTTPRequest|'s |referrer| |
543 // is none, and `Referer`/|HTTPRequest|'s referrer, serialized and utf-8 | 543 // is none, and `Referer`/|HTTPRequest|'s referrer, serialized and utf-8 |
544 // encoded, otherwise, to HTTPRequest's header list. | 544 // encoded, otherwise, to HTTPRequest's header list. |
545 // | 545 // |
546 // The following code also invokes "determine request's referrer" which is | 546 // The following code also invokes "determine request's referrer" which is |
547 // written in "Main fetch" operation. | 547 // written in "Main fetch" operation. |
548 ASSERT(m_request->referrerPolicy() == ReferrerPolicyDefault); | 548 ASSERT(m_request->getReferrerPolicy() == ReferrerPolicyDefault); |
549 // Request's referrer policy is always default, so use the client's one. | 549 // Request's referrer policy is always default, so use the client's one. |
550 // TODO(yhirano): Fix here when we introduce requet's referrer policy. | 550 // TODO(yhirano): Fix here when we introduce requet's referrer policy. |
551 ReferrerPolicy policy = executionContext()->getReferrerPolicy(); | 551 ReferrerPolicy policy = executionContext()->getReferrerPolicy(); |
552 if (m_request->referrerString() == FetchRequestData::clientReferrerString())
{ | 552 if (m_request->referrerString() == FetchRequestData::clientReferrerString())
{ |
553 String referrerURL; | 553 String referrerURL; |
554 if (executionContext()->isDocument()) { | 554 if (executionContext()->isDocument()) { |
555 Document* document = toDocument(executionContext()); | 555 Document* document = toDocument(executionContext()); |
556 referrerURL = document->outgoingReferrer(); | 556 referrerURL = document->outgoingReferrer(); |
557 } else if (executionContext()->isWorkerGlobalScope()) { | 557 } else if (executionContext()->isWorkerGlobalScope()) { |
558 referrerURL = executionContext()->url().strippedForUseAsReferrer(); | 558 referrerURL = executionContext()->url().strippedForUseAsReferrer(); |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
712 loader->dispose(); | 712 loader->dispose(); |
713 } | 713 } |
714 | 714 |
715 DEFINE_TRACE(FetchManager) | 715 DEFINE_TRACE(FetchManager) |
716 { | 716 { |
717 visitor->trace(m_executionContext); | 717 visitor->trace(m_executionContext); |
718 visitor->trace(m_loaders); | 718 visitor->trace(m_loaders); |
719 } | 719 } |
720 | 720 |
721 } // namespace blink | 721 } // namespace blink |
OLD | NEW |