blob: 74b38ee94d3e3f6a6a7c5035fc7ca5f0fc3c57a7 [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 FetchManager_h
#define FetchManager_h
#include "bindings/core/v8/ScriptPromise.h"
#include "platform/heap/Handle.h"
namespace blink {
class ExecutionContext;
class FetchRequestData;
class ScriptState;
class FetchManager final : public GarbageCollectedFinalized<FetchManager> {
public:
static FetchManager* create(ExecutionContext* executionContext)
{
return new FetchManager(executionContext);
}
~FetchManager();
ScriptPromise fetch(ScriptState*, FetchRequestData*);
void stop();
bool isStopped() const { return m_isStopped; }
DECLARE_TRACE();
private:
class Loader;
explicit FetchManager(ExecutionContext*);
// Removes loader from |m_loaders|.
void onLoaderFinished(Loader*);
RawPtrWillBeMember<ExecutionContext> m_executionContext;
HeapHashSet<Member<Loader>> m_loaders;
bool m_isStopped;
};
} // namespace blink
#endif // FetchManager_h