| Index: Source/modules/serviceworkers/ServiceWorkerError.h
|
| diff --git a/Source/modules/serviceworkers/ServiceWorker.h b/Source/modules/serviceworkers/ServiceWorkerError.h
|
| similarity index 67%
|
| copy from Source/modules/serviceworkers/ServiceWorker.h
|
| copy to Source/modules/serviceworkers/ServiceWorkerError.h
|
| index 068b75757f6e741159fed3e390068c21e527c100..55ee848344a70088ce7d23270ff97071a81c81e2 100644
|
| --- a/Source/modules/serviceworkers/ServiceWorker.h
|
| +++ b/Source/modules/serviceworkers/ServiceWorkerError.h
|
| @@ -28,43 +28,36 @@
|
| * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
| */
|
|
|
| -#ifndef ServiceWorker_h
|
| -#define ServiceWorker_h
|
| +#ifndef ServiceWorkerError_h
|
| +#define ServiceWorkerError_h
|
|
|
| -#include "public/platform/WebServiceWorker.h"
|
| -#include "wtf/OwnPtr.h"
|
| -#include "wtf/PassOwnPtr.h"
|
| -#include "wtf/PassRefPtr.h"
|
| -#include "wtf/RefCounted.h"
|
| -
|
| -namespace WebKit {
|
| -class WebServiceWorker;
|
| -}
|
| +#include "core/dom/DOMError.h"
|
| +#include "public/platform/WebServiceWorkerError.h"
|
|
|
| namespace WebCore {
|
|
|
| -class ServiceWorker : public RefCounted<ServiceWorker> {
|
| +class ServiceWorkerError : public DOMError {
|
| public:
|
| - static PassRefPtr<ServiceWorker> create(PassOwnPtr<WebKit::WebServiceWorker> worker)
|
| + static PassRefPtr<ServiceWorkerError> create(WebKit::WebServiceWorkerError::ErrorType type, const String& message)
|
| {
|
| - return adoptRef(new ServiceWorker(worker));
|
| + return adoptRef(new ServiceWorkerError(type, message));
|
| }
|
|
|
| // For CallbackPromiseAdapter
|
| - typedef WebKit::WebServiceWorker WebType;
|
| - static PassRefPtr<ServiceWorker> from(WebType* worker)
|
| + typedef WebKit::WebServiceWorkerError WebType;
|
| + static PassRefPtr<DOMError> from(WebType* webError)
|
| {
|
| - return create(adoptPtr(worker));
|
| + return create(webError->errorType, webError->message);
|
| }
|
|
|
| - ~ServiceWorker() { }
|
| + static const String& GetErrorString(WebKit::WebServiceWorkerError::ErrorType);
|
|
|
| -private:
|
| - explicit ServiceWorker(PassOwnPtr<WebKit::WebServiceWorker>);
|
| + ~ServiceWorkerError() { }
|
|
|
| - OwnPtr<WebKit::WebServiceWorker> m_outerWorker;
|
| +private:
|
| + ServiceWorkerError(WebKit::WebServiceWorkerError::ErrorType type, const String& message) : DOMError(GetErrorString(type), message) { }
|
| };
|
|
|
| } // namespace WebCore
|
|
|
| -#endif // ServiceWorker_h
|
| +#endif // ServiceWorkerError_h
|
|
|