| 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 689 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 700 { | 700 { |
| 701 return new FetchManager(executionContext); | 701 return new FetchManager(executionContext); |
| 702 } | 702 } |
| 703 | 703 |
| 704 FetchManager::FetchManager(ExecutionContext* executionContext) | 704 FetchManager::FetchManager(ExecutionContext* executionContext) |
| 705 : ContextLifecycleObserver(executionContext) | 705 : ContextLifecycleObserver(executionContext) |
| 706 , m_isStopped(false) | 706 , m_isStopped(false) |
| 707 { | 707 { |
| 708 } | 708 } |
| 709 | 709 |
| 710 FetchManager::~FetchManager() | |
| 711 { | |
| 712 } | |
| 713 | |
| 714 ScriptPromise FetchManager::fetch(ScriptState* scriptState, FetchRequestData* re
quest) | 710 ScriptPromise FetchManager::fetch(ScriptState* scriptState, FetchRequestData* re
quest) |
| 715 { | 711 { |
| 716 ScriptPromiseResolver* resolver = ScriptPromiseResolver::create(scriptState)
; | 712 ScriptPromiseResolver* resolver = ScriptPromiseResolver::create(scriptState)
; |
| 717 ScriptPromise promise = resolver->promise(); | 713 ScriptPromise promise = resolver->promise(); |
| 718 | 714 |
| 719 request->setContext(WebURLRequest::RequestContextFetch); | 715 request->setContext(WebURLRequest::RequestContextFetch); |
| 720 | 716 |
| 721 Loader* loader = Loader::create(getExecutionContext(), this, resolver, reque
st, scriptState->world().isIsolatedWorld()); | 717 Loader* loader = Loader::create(getExecutionContext(), this, resolver, reque
st, scriptState->world().isIsolatedWorld()); |
| 722 m_loaders.add(loader); | 718 m_loaders.add(loader); |
| 723 loader->start(); | 719 loader->start(); |
| (...skipping 14 matching lines...) Expand all Loading... |
| 738 loader->dispose(); | 734 loader->dispose(); |
| 739 } | 735 } |
| 740 | 736 |
| 741 DEFINE_TRACE(FetchManager) | 737 DEFINE_TRACE(FetchManager) |
| 742 { | 738 { |
| 743 visitor->trace(m_loaders); | 739 visitor->trace(m_loaders); |
| 744 ContextLifecycleObserver::trace(visitor); | 740 ContextLifecycleObserver::trace(visitor); |
| 745 } | 741 } |
| 746 | 742 |
| 747 } // namespace blink | 743 } // namespace blink |
| OLD | NEW |