#include "core/fetch/ResourceLoaderOptions.h"
#include "wtf/Noncopyable.h"
#include "wtf/PassRefPtr.h"
+#include "wtf/RefCounted.h"
#include "wtf/RefPtr.h"
namespace WebCore {
// Useful for doing loader operations from any thread (not threadsafe,
// just able to run on threads other than the main thread).
- class ThreadableLoader {
+ class ThreadableLoader : public RefCounted<ThreadableLoader> {
WTF_MAKE_NONCOPYABLE(ThreadableLoader);
public:
- static void loadResourceSynchronously(ExecutionContext*, const ResourceRequest&, ThreadableLoaderClient&, const ThreadableLoaderOptions&);
- static PassRefPtr<ThreadableLoader> create(ExecutionContext*, ThreadableLoaderClient*, const ResourceRequest&, const ThreadableLoaderOptions&);
+ static void loadResourceSynchronously(ExecutionContext&, const ResourceRequest&, ThreadableLoaderClient&, const ThreadableLoaderOptions&);
+ static PassRefPtr<ThreadableLoader> create(ExecutionContext&, ThreadableLoaderClient*, const ResourceRequest&, const ThreadableLoaderOptions&);
virtual void cancel() = 0;
- void ref() { refThreadableLoader(); }
- void deref() { derefThreadableLoader(); }
+
+ virtual ~ThreadableLoader() { }
protected:
ThreadableLoader() { }
- virtual ~ThreadableLoader() { }
- virtual void refThreadableLoader() = 0;
- virtual void derefThreadableLoader() = 0;
};
} // namespace WebCore