Index: third_party/WebKit/WebCore/dom/ExceptionContext.h |
=================================================================== |
--- third_party/WebKit/WebCore/dom/ExceptionContext.h (revision 4268) |
+++ third_party/WebKit/WebCore/dom/ExceptionContext.h (working copy) |
@@ -32,71 +32,29 @@ |
#ifndef ExceptionContext_h |
#define ExceptionContext_h |
+#include "ExceptionContextData.h" |
#include <wtf/Noncopyable.h> |
-#include "ScriptController.h" |
-#if USE(JSC) |
-namespace JSC { |
-class ExecState; |
-} |
-#endif |
- |
- |
namespace WebCore { |
class Node; |
-#if USE(V8) |
-class ExceptionCatcher; |
-#endif |
// Provides context of an exception. This class is an abstraction of JSC's |
-// ExecState. In V8, its purpose is to carry along the exceptions captured |
-// by the ExceptionCatcher. |
+// ExecState. In V8, it carries an explicitly set exception. |
class ExceptionContext : Noncopyable { |
public: |
- ExceptionContext(Node*); |
-#if USE(V8) |
- ExceptionContext(); |
-#elif USE(JSC) |
- ExceptionContext(JSC::ExecState* exec) : m_exec(exec) {} |
- JSC::ExecState* exec() const { return m_exec; } |
-#endif |
+ ExceptionContext(Node* node); |
+ ExceptionContext(ExceptionContextData data) : m_data(data) {} |
~ExceptionContext() {} |
bool hadException(); |
- JSException exception() const; |
+ ExceptionContextData data() const { return m_data; } |
+ void setData(ExceptionContextData data) { m_data = data; } |
- // Returns a non-exception code object. |
- static JSException noException(); |
- |
private: |
-#if USE(V8) |
- friend class ExceptionCatcher; |
- void setException(JSException exception) { m_exception = exception; } |
- void setExceptionCatcher(ExceptionCatcher*); |
- JSException m_exception; |
- ExceptionCatcher* m_exceptionCatcher; |
-#elif USE(JSC) |
- JSC::ExecState* m_exec; |
-#endif |
+ ExceptionContextData m_data; |
}; |
-#if USE(V8) |
-// A wrapper around v8::TryCatch helper in order to facilitate updating |
-// ExceptionContext with the latest exceptions that may have occurred. |
-class ExceptionCatcher { |
-public: |
- ExceptionCatcher(ExceptionContext*); |
- ~ExceptionCatcher(); |
- void updateContext(); |
- void detachContext(); |
- |
-private: |
- ExceptionContext* m_context; |
- v8::TryCatch m_catcher; |
-}; |
-#endif |
- |
} // namespace WebCore |
-#endif // !defined(ExceptionContext_h) |
+#endif // ExceptionContext_h |
Property changes on: third_party\WebKit\WebCore\dom\ExceptionContext.h |
___________________________________________________________________ |
Added: svn:mergeinfo |
Merged /branches/chrome_webkit_merge_branch/src/webkit/pending/ExceptionContext.h:r3734-4217 |