Index: Source/modules/serviceworkers/ServiceWorkerError.h |
diff --git a/Source/platform/Task.h b/Source/modules/serviceworkers/ServiceWorkerError.h |
similarity index 70% |
copy from Source/platform/Task.h |
copy to Source/modules/serviceworkers/ServiceWorkerError.h |
index 8ef2339b1b4f4c80816774bb5b2b0bb19228bdd8..6aa5363f00f3a909ab428ae52285ad4445b7e9df 100644 |
--- a/Source/platform/Task.h |
+++ b/Source/modules/serviceworkers/ServiceWorkerError.h |
@@ -28,30 +28,34 @@ |
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
-#ifndef Task_h |
-#define Task_h |
+#ifndef ServiceWorkerError_h |
+#define ServiceWorkerError_h |
-#include "public/platform/WebThread.h" |
-#include "wtf/Functional.h" |
+#include "core/dom/DOMError.h" |
+#include "public/platform/WebServiceWorkerError.h" |
namespace WebCore { |
-class Task : public WebKit::WebThread::Task { |
+class ServiceWorkerError : public DOMError { |
public: |
- explicit Task(const Closure& closure) |
- : m_closure(closure) |
+ static PassRefPtr<ServiceWorkerError> create(const String& name, const String& message) |
{ |
+ return adoptRef(new ServiceWorkerError(name, message)); |
} |
- virtual void run() OVERRIDE |
+ // For CallbackPromiseAdapter |
+ typedef WebKit::WebServiceWorkerError WebType; |
+ static PassRefPtr<DOMError> from(WebType* worker) |
michaeln
2013/10/15 01:28:48
looks like this should be returning a PassRefPtr<S
|
{ |
- m_closure(); |
+ return create(worker->name(), worker->message()); |
kinuko
2013/10/15 01:43:09
I'm a bit confused; does this imply WebServiceWork
|
} |
+ ~ServiceWorkerError() { } |
+ |
private: |
- Closure m_closure; |
+ ServiceWorkerError(const String& name, const String& message) : DOMError(name, message) { } |
}; |
} // namespace WebCore |
-#endif // Task_h |
+#endif // ServiceWorkerError_h |