Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Source / core / loader / ThreadableLoader.h
index a1092d2..f562551 100644 (file)
@@ -34,6 +34,7 @@
 #include "core/fetch/ResourceLoaderOptions.h"
 #include "wtf/Noncopyable.h"
 #include "wtf/PassRefPtr.h"
+#include "wtf/RefCounted.h"
 #include "wtf/RefPtr.h"
 
 namespace WebCore {
@@ -77,21 +78,18 @@ 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