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

Unified Diff: third_party/WebKit/WebCore/dom/ExceptionContext.h

Issue 9018: Make ExceptionContext platform-independent using magic headers (1/2) (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 12 years, 1 month 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: 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
« no previous file with comments | « third_party/WebKit/WebCore/bindings/js/JSNodeFilterCondition.cpp ('k') | third_party/WebKit/WebCore/dom/ExceptionContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698