Chromium Code Reviews| Index: Source/bindings/v8/ExceptionState.h |
| diff --git a/Source/bindings/v8/ExceptionState.h b/Source/bindings/v8/ExceptionState.h |
| index 576d370ee2553c3176ddb9e58bb33964d484633f..de1300b5ae72b0e319611aaf73bf4b8e6c8a374e 100644 |
| --- a/Source/bindings/v8/ExceptionState.h |
| +++ b/Source/bindings/v8/ExceptionState.h |
| @@ -44,11 +44,39 @@ typedef int ExceptionCode; |
| class ExceptionState { |
| WTF_MAKE_NONCOPYABLE(ExceptionState); |
| public: |
| + enum Context { |
| + ConstructionContext, |
| + ExecutionContext, |
| + DeletionContext, |
| + GetterContext, |
| + SetterContext, |
| + UnknownContext, // FIXME: Remove this once we've flipped over to the new API. |
| + }; |
| + |
| explicit ExceptionState(const v8::Handle<v8::Object>& creationContext, v8::Isolate* isolate) |
| : m_code(0) |
| + , m_context(UnknownContext) |
| + , m_property(0) |
| + , m_interface(0) |
| + , m_creationContext(creationContext) |
| + , m_isolate(isolate) { } |
| + |
| + ExceptionState(Context context, const char* property, const char* interface, const v8::Handle<v8::Object>& creationContext, v8::Isolate* isolate) |
| + : m_code(0) |
| + , m_context(context) |
| + , m_property(property) |
| + , m_interface(interface) |
| , m_creationContext(creationContext) |
| , m_isolate(isolate) { } |
| + ExceptionState(Context context, const char* interface, const v8::Handle<v8::Object>& creationContext, v8::Isolate* isolate) |
| + : m_code(0) |
| + , m_context(context) |
| + , m_property(0) |
| + , m_interface(interface) |
| + , m_creationContext(creationContext) |
| + , m_isolate(isolate) { ASSERT(m_executionContext == ExceptionStateForConstruction); } |
| + |
| virtual void throwDOMException(const ExceptionCode&, const String& message); |
| virtual void throwTypeError(const String& message); |
| virtual void throwSecurityError(const String& sanitizedMessage, const String& unsanitizedMessage = String()); |
| @@ -74,8 +102,15 @@ public: |
| return true; |
| } |
| + Context context() { return m_context; } |
| + const char* property() { return m_property; } |
| + const char* interface() { return m_interface; } |
| + |
| protected: |
| ExceptionCode m_code; |
| + Context m_context; |
| + const char* m_property; |
| + const char* m_interface; |
|
haraken
2013/11/26 10:49:36
Don't you want to use String instead of char*?
Mike West
2013/11/26 10:53:26
I don't want the performance hit of converting to
|
| private: |
| void setException(v8::Handle<v8::Value>); |