summaryrefslogtreecommitdiffstats
path: root/webkit
diff options
context:
space:
mode:
Diffstat (limited to 'webkit')
-rw-r--r--webkit/build/KJSBindings/KJSBindings.vcproj8
-rw-r--r--webkit/build/V8Bindings/V8Bindings.vcproj4
-rw-r--r--webkit/build/port/port.vcproj4
-rw-r--r--webkit/pending/ExceptionContext.h29
-rw-r--r--webkit/port/bridge/ExceptionContextV8.cpp24
5 files changed, 25 insertions, 44 deletions
diff --git a/webkit/build/KJSBindings/KJSBindings.vcproj b/webkit/build/KJSBindings/KJSBindings.vcproj
index 39867ef..c1f5a21 100644
--- a/webkit/build/KJSBindings/KJSBindings.vcproj
+++ b/webkit/build/KJSBindings/KJSBindings.vcproj
@@ -1922,14 +1922,6 @@
>
</File>
<File
- RelativePath="..\..\..\third_party\WebKit\WebCore\bindings\js\ExceptionContext.cpp"
- >
- </File>
- <File
- RelativePath="..\..\pending\ExceptionContext.h"
- >
- </File>
- <File
RelativePath="..\..\..\third_party\WebKit\WebCore\bindings\js\ScriptControllerWin.cpp"
>
</File>
diff --git a/webkit/build/V8Bindings/V8Bindings.vcproj b/webkit/build/V8Bindings/V8Bindings.vcproj
index 209ba50..4e660d4 100644
--- a/webkit/build/V8Bindings/V8Bindings.vcproj
+++ b/webkit/build/V8Bindings/V8Bindings.vcproj
@@ -2393,10 +2393,6 @@
>
</File>
<File
- RelativePath="..\..\pending\ExceptionContext.h"
- >
- </File>
- <File
RelativePath="..\..\port\bridge\ExceptionContextV8.cpp"
>
</File>
diff --git a/webkit/build/port/port.vcproj b/webkit/build/port/port.vcproj
index 4aa94d7..9f0805b 100644
--- a/webkit/build/port/port.vcproj
+++ b/webkit/build/port/port.vcproj
@@ -1208,6 +1208,10 @@
Name="bridge"
>
<File
+ RelativePath="..\..\pending\ExceptionContext.h"
+ >
+ </File>
+ <File
RelativePath="..\..\port\bridge\FrameWin.cpp"
>
</File>
diff --git a/webkit/pending/ExceptionContext.h b/webkit/pending/ExceptionContext.h
index 529b8f3..7b6c1b4 100644
--- a/webkit/pending/ExceptionContext.h
+++ b/webkit/pending/ExceptionContext.h
@@ -35,13 +35,6 @@
#include <wtf/Noncopyable.h>
#include "ScriptController.h"
-#if USE(JSC)
-namespace KJS {
-class ExecState;
-}
-#endif
-
-
namespace WebCore {
class Node;
@@ -54,30 +47,26 @@ class ExceptionCatcher;
// by the ExceptionCatcher.
class ExceptionContext : Noncopyable {
public:
- ExceptionContext(Node*);
-#if USE(V8)
ExceptionContext();
-#elif USE(JSC)
- ExceptionContext(KJS::ExecState* exec) : m_exec(exec) {}
- KJS::ExecState* exec() const { return m_exec; }
-#endif
- ~ExceptionContext() {}
+ ~ExceptionContext();
bool hadException();
- JSException exception() const;
+ JSException exception() const { return m_exception; }
+
+ static ExceptionContext* createFromNode(Node*);
// Returns a non-exception code object.
- static JSException noException();
+ static JSException NoException();
private:
+ void setException(JSException exception) { m_exception = exception; }
+
+ JSException m_exception;
+
#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)
- KJS::ExecState* m_exec;
#endif
};
diff --git a/webkit/port/bridge/ExceptionContextV8.cpp b/webkit/port/bridge/ExceptionContextV8.cpp
index 9b14d76..7301522 100644
--- a/webkit/port/bridge/ExceptionContextV8.cpp
+++ b/webkit/port/bridge/ExceptionContextV8.cpp
@@ -34,20 +34,16 @@
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()
: m_exception()
, m_exceptionCatcher(0)
{
}
+ExceptionContext::~ExceptionContext()
+{
+}
+
void ExceptionContext::setExceptionCatcher(ExceptionCatcher* exceptionCatcher)
{
if (m_exceptionCatcher && exceptionCatcher)
@@ -64,12 +60,16 @@ bool ExceptionContext::hadException()
return !m_exception.IsEmpty();
}
-JSException ExceptionContext::exception() const
+ExceptionContext* ExceptionContext::createFromNode(Node*)
{
- return m_exception;
+ // 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*.
+ return new ExceptionContext();
}
-JSException ExceptionContext::noException()
+JSException ExceptionContext::NoException()
{
return v8::Local<v8::Value>();
}
@@ -93,7 +93,7 @@ void ExceptionCatcher::updateContext()
if (m_catcher.HasCaught())
m_context->setException(m_catcher.Exception());
else
- m_context->setException(ExceptionContext::noException());
+ m_context->setException(ExceptionContext::NoException());
}
ExceptionCatcher::~ExceptionCatcher()