summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/webkit/WebCore/bindings/js/JSWorkerContextBase.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/3rdparty/webkit/WebCore/bindings/js/JSWorkerContextBase.cpp')
-rw-r--r--src/3rdparty/webkit/WebCore/bindings/js/JSWorkerContextBase.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/3rdparty/webkit/WebCore/bindings/js/JSWorkerContextBase.cpp b/src/3rdparty/webkit/WebCore/bindings/js/JSWorkerContextBase.cpp
index c71f45bd4..622da7056 100644
--- a/src/3rdparty/webkit/WebCore/bindings/js/JSWorkerContextBase.cpp
+++ b/src/3rdparty/webkit/WebCore/bindings/js/JSWorkerContextBase.cpp
@@ -31,6 +31,7 @@
#include "JSWorkerContextBase.h"
+#include "JSDedicatedWorkerContext.h"
#include "JSWorkerContext.h"
#include "WorkerContext.h"
@@ -57,6 +58,11 @@ ScriptExecutionContext* JSWorkerContextBase::scriptExecutionContext() const
return m_impl.get();
}
+JSValue toJS(ExecState* exec, JSDOMGlobalObject*, WorkerContext* workerContext)
+{
+ return toJS(exec, workerContext);
+}
+
JSValue toJS(ExecState*, WorkerContext* workerContext)
{
if (!workerContext)
@@ -67,6 +73,22 @@ JSValue toJS(ExecState*, WorkerContext* workerContext)
return script->workerContextWrapper();
}
+JSDedicatedWorkerContext* toJSDedicatedWorkerContext(JSValue value)
+{
+ if (!value.isObject())
+ return 0;
+ const ClassInfo* classInfo = asObject(value)->classInfo();
+ if (classInfo == &JSDedicatedWorkerContext::s_info)
+ return static_cast<JSDedicatedWorkerContext*>(asObject(value));
+ return 0;
+}
+
+JSWorkerContext* toJSWorkerContext(JSValue value)
+{
+ // When we support shared workers, we'll add code to test for SharedWorkerContext too.
+ return toJSDedicatedWorkerContext(value);
+}
+
} // namespace WebCore
#endif // ENABLE(WORKERS)