Index: Source/modules/serviceworkers/ServiceWorkerError.h |
diff --git a/Source/core/html/ime/Composition.h b/Source/modules/serviceworkers/ServiceWorkerError.h |
similarity index 70% |
copy from Source/core/html/ime/Composition.h |
copy to Source/modules/serviceworkers/ServiceWorkerError.h |
index 43054668f0d17b4911e7af24a0db6f0606a7e868..7918741631b85e03946fb196585b6468ae8e0670 100644 |
--- a/Source/core/html/ime/Composition.h |
+++ b/Source/modules/serviceworkers/ServiceWorkerError.h |
@@ -28,36 +28,33 @@ |
* 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(); |
+ // For CallbackPromiseAdapter |
+ typedef WebKit::WebServiceWorkerError WebType; |
+ static PassRefPtr<DOMError> from(WebType* webErrorRaw) |
+ { |
+ OwnPtr<WebType> webError = adoptPtr(webErrorRaw); |
+ RefPtr<DOMError> error = DOMError::create(getErrorString(webError->errorType), webError->message); |
+ return error; |
abarth-chromium
2013/10/25 15:37:16
error.release()
alecflett
2013/10/25 23:05:33
Done. (I was actually surprised to see the non-rel
|
+ } |
- String text() const; |
- int selectionStart() const; |
- int selectionEnd() const; |
- const Vector<unsigned>& getSegments() const; |
+ static String getErrorString(WebKit::WebServiceWorkerError::ErrorType); |
abarth-chromium
2013/10/25 15:37:16
getErrorString -> errorString
Can this function b
alecflett
2013/10/25 23:05:33
Done.
|
private: |
- explicit Composition(InputMethodContext*); |
- |
- InputMethodContext* m_inputMethodContext; |
+ WTF_MAKE_NONCOPYABLE(ServiceWorkerError); |
+ ServiceWorkerError() WTF_DELETED_FUNCTION; |
}; |
} // namespace WebCore |
-#endif // Composition_h |
+#endif // ServiceWorkerError_h |