| 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" |
| 11 #include "core/dom/DOMArrayBuffer.h" | 11 #include "core/dom/DOMArrayBuffer.h" |
| 12 #include "core/dom/Document.h" | 12 #include "core/dom/Document.h" |
| 13 #include "core/dom/TaskRunnerHelper.h" |
| 13 #include "core/fetch/FetchUtils.h" | 14 #include "core/fetch/FetchUtils.h" |
| 14 #include "core/fileapi/Blob.h" | 15 #include "core/fileapi/Blob.h" |
| 15 #include "core/frame/Frame.h" | 16 #include "core/frame/Frame.h" |
| 16 #include "core/frame/SubresourceIntegrity.h" | 17 #include "core/frame/SubresourceIntegrity.h" |
| 17 #include "core/frame/csp/ContentSecurityPolicy.h" | 18 #include "core/frame/csp/ContentSecurityPolicy.h" |
| 18 #include "core/inspector/ConsoleMessage.h" | 19 #include "core/inspector/ConsoleMessage.h" |
| 19 #include "core/inspector/InspectorInstrumentation.h" | 20 #include "core/inspector/InspectorInstrumentation.h" |
| 20 #include "core/loader/ThreadableLoader.h" | 21 #include "core/loader/ThreadableLoader.h" |
| 21 #include "core/loader/ThreadableLoaderClient.h" | 22 #include "core/loader/ThreadableLoaderClient.h" |
| 22 #include "core/page/ChromeClient.h" | 23 #include "core/page/ChromeClient.h" |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 // all must have the lifetime of the give loader. | 83 // all must have the lifetime of the give loader. |
| 83 SRIVerifier(std::unique_ptr<WebDataConsumerHandle> handle, CompositeData
ConsumerHandle::Updater* updater, Response* response, FetchManager::Loader* load
er, String integrityMetadata, const KURL& url) | 84 SRIVerifier(std::unique_ptr<WebDataConsumerHandle> handle, CompositeData
ConsumerHandle::Updater* updater, Response* response, FetchManager::Loader* load
er, String integrityMetadata, const KURL& url) |
| 84 : m_handle(std::move(handle)) | 85 : m_handle(std::move(handle)) |
| 85 , m_updater(updater) | 86 , m_updater(updater) |
| 86 , m_response(response) | 87 , m_response(response) |
| 87 , m_loader(loader) | 88 , m_loader(loader) |
| 88 , m_integrityMetadata(integrityMetadata) | 89 , m_integrityMetadata(integrityMetadata) |
| 89 , m_url(url) | 90 , m_url(url) |
| 90 , m_finished(false) | 91 , m_finished(false) |
| 91 { | 92 { |
| 92 m_reader = m_handle->obtainReader(this); | 93 m_reader = m_handle->obtainReader(this, TaskRunnerHelper::getUnthrot
tledTaskRunner(loader->m_executionContext)->clone()); |
| 93 } | 94 } |
| 94 | 95 |
| 95 void didGetReadable() override | 96 void didGetReadable() override |
| 96 { | 97 { |
| 97 ASSERT(m_reader); | 98 ASSERT(m_reader); |
| 98 ASSERT(m_loader); | 99 ASSERT(m_loader); |
| 99 ASSERT(m_response); | 100 ASSERT(m_response); |
| 100 | 101 |
| 101 WebDataConsumerHandle::Result r = WebDataConsumerHandle::Ok; | 102 WebDataConsumerHandle::Result r = WebDataConsumerHandle::Ok; |
| 102 while (r == WebDataConsumerHandle::Ok) { | 103 while (r == WebDataConsumerHandle::Ok) { |
| (...skipping 638 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 741 loader->dispose(); | 742 loader->dispose(); |
| 742 } | 743 } |
| 743 | 744 |
| 744 DEFINE_TRACE(FetchManager) | 745 DEFINE_TRACE(FetchManager) |
| 745 { | 746 { |
| 746 visitor->trace(m_loaders); | 747 visitor->trace(m_loaders); |
| 747 ContextLifecycleObserver::trace(visitor); | 748 ContextLifecycleObserver::trace(visitor); |
| 748 } | 749 } |
| 749 | 750 |
| 750 } // namespace blink | 751 } // namespace blink |
| OLD | NEW |