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

Unified Diff: webkit/port/bridge/ExceptionContextV8.cpp

Issue 9019: Make ExceptionContext platform-independent using magic headers (2/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
« no previous file with comments | « webkit/port/bindings/v8/v8_nodefilter.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/port/bridge/ExceptionContextV8.cpp
===================================================================
--- webkit/port/bridge/ExceptionContextV8.cpp (revision 4425)
+++ webkit/port/bridge/ExceptionContextV8.cpp (working copy)
@@ -34,75 +34,15 @@
namespace WebCore {
-// Unlike JSC, which stores exceptions in ExecState that is accessible from
-// ScriptController that is retrievable from Node*, V8 uses static chain of
-// handlers (encapsulated as v8::TryCatch and here as ExceptionCatcher)
-// to track exceptions, so it has no need for Node*.
-ExceptionContext::ExceptionContext(Node* node)
+ExceptionContext::ExceptionContext(Node*)
+ : m_data()
{
}
-ExceptionContext::ExceptionContext()
- : m_exception()
- , m_exceptionCatcher(0)
-{
-}
-
-void ExceptionContext::setExceptionCatcher(ExceptionCatcher* exceptionCatcher)
-{
- if (m_exceptionCatcher && exceptionCatcher)
- m_exceptionCatcher->detachContext();
-
- m_exceptionCatcher = exceptionCatcher;
-}
-
bool ExceptionContext::hadException()
{
- if (m_exceptionCatcher)
- m_exceptionCatcher->updateContext();
-
- return !m_exception.IsEmpty();
+ return !m_data.IsEmpty();
}
-JSException ExceptionContext::exception() const
-{
- return m_exception;
-}
-JSException ExceptionContext::noException()
-{
- return v8::Local<v8::Value>();
-}
-
-ExceptionCatcher::ExceptionCatcher(ExceptionContext* exceptionContext)
- : m_context(exceptionContext)
- , m_catcher()
-{
- exceptionContext->setExceptionCatcher(this);
-}
-
-void ExceptionCatcher::detachContext()
-{
- m_context = 0;
-}
-
-void ExceptionCatcher::updateContext()
-{
- ASSERT(m_context);
-
- if (m_catcher.HasCaught())
- m_context->setException(m_catcher.Exception());
- else
- m_context->setException(ExceptionContext::noException());
-}
-
-ExceptionCatcher::~ExceptionCatcher()
-{
- if (!m_context)
- return;
-
- updateContext();
- m_context->setExceptionCatcher(0);
-}
-
} // namespace WebCore
« no previous file with comments | « webkit/port/bindings/v8/v8_nodefilter.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698