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