blob: 521f05d8de6b40962ac56765e8f30f37ee40032f [file] [log] [blame]
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_FETCH_FETCH_MANAGER_H_
#define THIRD_PARTY_BLINK_RENDERER_CORE_FETCH_FETCH_MANAGER_H_
#include "third_party/blink/renderer/bindings/core/v8/script_promise.h"
#include "third_party/blink/renderer/core/core_export.h"
#include "third_party/blink/renderer/core/dom/context_lifecycle_observer.h"
#include "third_party/blink/renderer/platform/heap/handle.h"
namespace blink {
class AbortSignal;
class ExceptionState;
class ExecutionContext;
class FetchRequestData;
class ScriptState;
class CORE_EXPORT FetchManager final : public GarbageCollected<FetchManager>,
public ContextLifecycleObserver {
USING_GARBAGE_COLLECTED_MIXIN(FetchManager);
public:
static FetchManager* Create(ExecutionContext*);
explicit FetchManager(ExecutionContext*);
ScriptPromise Fetch(ScriptState*,
FetchRequestData*,
AbortSignal*,
ExceptionState&);
void ContextDestroyed(ExecutionContext*) override;
void Trace(blink::Visitor*) override;
private:
class Loader;
// Removes loader from |m_loaders|.
void OnLoaderFinished(Loader*);
HeapHashSet<Member<Loader>> loaders_;
};
} // namespace blink
#endif // THIRD_PARTY_BLINK_RENDERER_CORE_FETCH_FETCH_MANAGER_H_