OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/FetchBlobDataConsumerHandle.h" | 5 #include "modules/fetch/FetchBlobDataConsumerHandle.h" |
6 | 6 |
7 #include "core/dom/ExecutionContext.h" | 7 #include "core/dom/ExecutionContext.h" |
8 #include "core/fetch/FetchInitiatorTypeNames.h" | 8 #include "core/fetch/FetchInitiatorTypeNames.h" |
9 #include "core/loader/ThreadableLoaderClient.h" | 9 #include "core/loader/ThreadableLoaderClient.h" |
10 #include "modules/fetch/CompositeDataConsumerHandle.h" | 10 #include "modules/fetch/CompositeDataConsumerHandle.h" |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 return; | 89 return; |
90 } | 90 } |
91 BlobRegistry::registerPublicBlobURL(executionContext->securityOrigin(),
url, m_blobDataHandle); | 91 BlobRegistry::registerPublicBlobURL(executionContext->securityOrigin(),
url, m_blobDataHandle); |
92 | 92 |
93 m_loader = createLoader(executionContext, this); | 93 m_loader = createLoader(executionContext, this); |
94 ASSERT(m_loader); | 94 ASSERT(m_loader); |
95 | 95 |
96 ResourceRequest request(url); | 96 ResourceRequest request(url); |
97 request.setRequestContext(WebURLRequest::RequestContextInternal); | 97 request.setRequestContext(WebURLRequest::RequestContextInternal); |
98 request.setUseStreamOnResponse(true); | 98 request.setUseStreamOnResponse(true); |
| 99 // We intentionally skip 'setExternalRequestStateFromRequestorAddressSpa
ce', as 'data:' can never be external. |
99 m_loader->start(request); | 100 m_loader->start(request); |
100 } | 101 } |
101 | 102 |
102 private: | 103 private: |
103 PassRefPtr<ThreadableLoader> createLoader(ExecutionContext* executionContext
, ThreadableLoaderClient* client) const | 104 PassRefPtr<ThreadableLoader> createLoader(ExecutionContext* executionContext
, ThreadableLoaderClient* client) const |
104 { | 105 { |
105 ThreadableLoaderOptions options; | 106 ThreadableLoaderOptions options; |
106 options.preflightPolicy = ConsiderPreflight; | 107 options.preflightPolicy = ConsiderPreflight; |
107 options.crossOriginRequestPolicy = DenyCrossOriginRequests; | 108 options.crossOriginRequestPolicy = DenyCrossOriginRequests; |
108 options.contentSecurityPolicyEnforcement = DoNotEnforceContentSecurityPo
licy; | 109 options.contentSecurityPolicyEnforcement = DoNotEnforceContentSecurityPo
licy; |
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
304 | 305 |
305 return adoptPtr(new FetchBlobDataConsumerHandle(executionContext, blobDataHa
ndle, new DefaultLoaderFactory)); | 306 return adoptPtr(new FetchBlobDataConsumerHandle(executionContext, blobDataHa
ndle, new DefaultLoaderFactory)); |
306 } | 307 } |
307 | 308 |
308 FetchDataConsumerHandle::Reader* FetchBlobDataConsumerHandle::obtainReaderIntern
al(Client* client) | 309 FetchDataConsumerHandle::Reader* FetchBlobDataConsumerHandle::obtainReaderIntern
al(Client* client) |
309 { | 310 { |
310 return m_readerContext->obtainReader(client).leakPtr(); | 311 return m_readerContext->obtainReader(client).leakPtr(); |
311 } | 312 } |
312 | 313 |
313 } // namespace blink | 314 } // namespace blink |
OLD | NEW |