#ifndef ExceptionStatePlaceholder_h
#define ExceptionStatePlaceholder_h
#include "bindings/v8/ExceptionState.h"
#include "wtf/Assertions.h"
#include "wtf/text/WTFString.h"
namespace WebCore {
class ExceptionState;
typedef int ExceptionCode;
class IgnorableExceptionState FINAL : public ExceptionState {
public:
IgnorableExceptionState(): ExceptionState(ExceptionState::UnknownContext, 0, 0, v8::Handle<v8::Object>(), 0) { }
ExceptionState& returnThis() { return *this; }
virtual void throwDOMException(const ExceptionCode&, const String& message = String()) OVERRIDE { }
virtual void throwTypeError(const String& message = String()) OVERRIDE { }
virtual void throwSecurityError(const String& sanitizedMessage, const String& unsanitizedMessage = String()) OVERRIDE { }
};
#define IGNORE_EXCEPTION (::WebCore::IgnorableExceptionState().returnThis())
#if ASSERT_DISABLED
#define ASSERT_NO_EXCEPTION (::WebCore::IgnorableExceptionState().returnThis())
#else
class NoExceptionStateAssertionChecker FINAL : public ExceptionState {
public:
NoExceptionStateAssertionChecker(const char* file, int line);
ExceptionState& returnThis() { return *this; }
virtual void throwDOMException(const ExceptionCode&, const String& message = String()) OVERRIDE;
virtual void throwTypeError(const String& message = String()) OVERRIDE;
virtual void throwSecurityError(const String& sanitizedMessage, const String& unsanitizedMessage = String()) OVERRIDE;
private:
const char* m_file;
int m_line;
};
#define ASSERT_NO_EXCEPTION (::WebCore::NoExceptionStateAssertionChecker(__FILE__, __LINE__).returnThis())
#endif
}
#endif