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

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: Fix windows Created 7 years, 1 month 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/core/html/ime/Composition.h b/Source/modules/serviceworkers/ServiceWorkerError.h
similarity index 69%
copy from Source/core/html/ime/Composition.h
copy to Source/modules/serviceworkers/ServiceWorkerError.h
index 43054668f0d17b4911e7af24a0db6f0606a7e868..1c29ea5e6db1d1b5459ab751ed7441e10195238b 100644
--- a/Source/core/html/ime/Composition.h
+++ b/Source/modules/serviceworkers/ServiceWorkerError.h
@@ -28,36 +28,32 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef Composition_h
-#define Composition_h
+#ifndef ServiceWorkerError_h
+#define ServiceWorkerError_h
-#include "bindings/v8/ScriptWrappable.h"
+#include "core/dom/DOMError.h"
+#include "public/platform/WebServiceWorkerError.h"
#include "wtf/PassOwnPtr.h"
-#include "wtf/text/WTFString.h"
namespace WebCore {
-class InputMethodContext;
-
-class Composition : public ScriptWrappable {
+class ServiceWorkerError {
public:
- static PassOwnPtr<Composition> create(InputMethodContext*);
- ~Composition();
-
- void ref();
- void deref();
-
- String text() const;
- int selectionStart() const;
- int selectionEnd() const;
- const Vector<unsigned>& getSegments() const;
+ // For CallbackPromiseAdapter
+ typedef WebKit::WebServiceWorkerError WebType;
+ static PassRefPtr<DOMError> from(WebType* webErrorRaw)
+ {
+ OwnPtr<WebType> webError = adoptPtr(webErrorRaw);
+ RefPtr<DOMError> error = DOMError::create(errorString(webError->errorType), webError->message);
+ return error.release();
+ }
private:
- explicit Composition(InputMethodContext*);
-
- InputMethodContext* m_inputMethodContext;
+ static String errorString(WebKit::WebServiceWorkerError::ErrorType);
+ WTF_MAKE_NONCOPYABLE(ServiceWorkerError);
+ ServiceWorkerError() WTF_DELETED_FUNCTION;
};
} // namespace WebCore
-#endif // Composition_h
+#endif // ServiceWorkerError_h
« no previous file with comments | « Source/modules/serviceworkers/NavigatorServiceWorker.cpp ('k') | Source/modules/serviceworkers/ServiceWorkerError.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698