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

Unified Diff: sky/engine/bindings-dart/core/dart/DartExceptionState.h

Issue 875013003: Import Dart bindings as of Blink r188698. This merely copies the files over and does not attach any… (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 11 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: sky/engine/bindings-dart/core/dart/DartExceptionState.h
diff --git a/sky/engine/core/css/CSSToLengthConversionData.h b/sky/engine/bindings-dart/core/dart/DartExceptionState.h
similarity index 57%
copy from sky/engine/core/css/CSSToLengthConversionData.h
copy to sky/engine/bindings-dart/core/dart/DartExceptionState.h
index 2e52af6209a76f4449418d22531c22b33273cb73..a197aec543ecd7042d00f1e973d5b0fb80a9a1ee 100644
--- a/sky/engine/core/css/CSSToLengthConversionData.h
+++ b/sky/engine/bindings-dart/core/dart/DartExceptionState.h
@@ -28,39 +28,43 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef SKY_ENGINE_CORE_CSS_CSSTOLENGTHCONVERSIONDATA_H_
-#define SKY_ENGINE_CORE_CSS_CSSTOLENGTHCONVERSIONDATA_H_
+#ifndef DartExceptionState_h
+#define DartExceptionState_h
-#include "sky/engine/wtf/Assertions.h"
-#include "sky/engine/wtf/Noncopyable.h"
+#include "bindings/common/ExceptionState.h"
+#include <dart_api.h>
namespace blink {
-class RenderStyle;
-class RenderView;
-
-class CSSToLengthConversionData {
+class DartExceptionState : public ExceptionState {
+ WTF_MAKE_NONCOPYABLE(DartExceptionState);
public:
- CSSToLengthConversionData(const RenderStyle* currStyle, const RenderView*, bool computingFontSize = false);
+ DartExceptionState() : ExceptionState(), m_exception(0) { }
- const RenderStyle& style() const { return *m_style; }
- bool computingFontSize() const { return m_computingFontSize; }
+ ~DartExceptionState()
+ {
+ ASSERT(!m_exception);
+ clearException();
+ }
- // Accessing these marks the style as having viewport units
- double viewportWidthPercent() const;
- double viewportHeightPercent() const;
- double viewportMinPercent() const;
- double viewportMaxPercent() const;
+ virtual void throwDOMException(const ExceptionCode&, const String& message = String());
+ virtual void throwTypeError(const String& message = String());
+ virtual void throwSecurityError(const String& sanitizedMessage, const String& unsanitizedMessage = String());
+ virtual void rethrowV8Exception(v8::Handle<v8::Value> value);
+ virtual void clearException();
+ virtual void throwException();
+ virtual void throwRangeError(const String& message = String()) OVERRIDE;
+ virtual ScriptPromise reject(ScriptState*) OVERRIDE FINAL;
- void setStyle(const RenderStyle* style) { m_style = style; }
+ Dart_Handle toDart(Dart_NativeArguments args, bool autoDartScope = false);
private:
- const RenderStyle* m_style;
- float m_viewportWidth;
- float m_viewportHeight;
- bool m_computingFontSize;
+ void throwDartCoreError(const String& className, const String& message, const ExceptionCode& ec);
+ void setException(const ExceptionCode&, const String& message = String());
+
+ Dart_PersistentHandle m_exception;
};
} // namespace blink
-#endif // SKY_ENGINE_CORE_CSS_CSSTOLENGTHCONVERSIONDATA_H_
+#endif // DartExceptionState_h
« no previous file with comments | « sky/engine/bindings-dart/core/dart/DartEventListener.cpp ('k') | sky/engine/bindings-dart/core/dart/DartExceptionState.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698