| 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
|
|
|