Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1426)

Unified Diff: Source/modules/serviceworkers/ServiceWorkerError.h

Issue 27278002: Add an Error class for ServiceWorkers (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698