diff options
author | Warwick Allison <warwick.allison@nokia.com> | 2009-07-31 11:52:57 +1000 |
---|---|---|
committer | Warwick Allison <warwick.allison@nokia.com> | 2009-07-31 11:52:57 +1000 |
commit | aa9cf406d62004519ad54596e1c391f9a6439210 (patch) | |
tree | dd562b9c296981f2761b76623911be8496c7af84 /src/3rdparty/webkit/WebCore/bindings/js/WorkerScriptController.cpp | |
parent | 987aec28b950e1c9817a20a9dd71afc071cd93ea (diff) | |
parent | 56b6a5924008ab5cdbae36e9662eddba923acd5e (diff) |
Merge branch 'master' of git@scm.dev.nokia.troll.no:qt/qt
Diffstat (limited to 'src/3rdparty/webkit/WebCore/bindings/js/WorkerScriptController.cpp')
-rw-r--r-- | src/3rdparty/webkit/WebCore/bindings/js/WorkerScriptController.cpp | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/src/3rdparty/webkit/WebCore/bindings/js/WorkerScriptController.cpp b/src/3rdparty/webkit/WebCore/bindings/js/WorkerScriptController.cpp index bcf107ba2..fc3de3c96 100644 --- a/src/3rdparty/webkit/WebCore/bindings/js/WorkerScriptController.cpp +++ b/src/3rdparty/webkit/WebCore/bindings/js/WorkerScriptController.cpp @@ -31,10 +31,9 @@ #include "WorkerScriptController.h" #include "JSDOMBinding.h" -#include "JSWorkerContext.h" +#include "JSDedicatedWorkerContext.h" #include "ScriptSourceCode.h" #include "ScriptValue.h" -#include "WorkerContext.h" #include "WorkerObjectProxy.h" #include "WorkerThread.h" #include <interpreter/Interpreter.h> @@ -66,16 +65,20 @@ void WorkerScriptController::initScript() { ASSERT(!m_workerContextWrapper); - JSLock lock(false); + JSLock lock(SilenceAssertionsOnly); // Explicitly protect the global object's prototype so it isn't collected // when we allocate the global object. (Once the global object is fully // constructed, it can mark its own prototype.) - RefPtr<Structure> prototypeStructure = JSWorkerContextPrototype::createStructure(jsNull()); - ProtectedPtr<JSWorkerContextPrototype> prototype = new (m_globalData.get()) JSWorkerContextPrototype(prototypeStructure.release()); + RefPtr<Structure> workerContextPrototypeStructure = JSWorkerContextPrototype::createStructure(jsNull()); + ProtectedPtr<JSWorkerContextPrototype> workerContextPrototype = new (m_globalData.get()) JSWorkerContextPrototype(workerContextPrototypeStructure.release()); - RefPtr<Structure> structure = JSWorkerContext::createStructure(prototype); - m_workerContextWrapper = new (m_globalData.get()) JSWorkerContext(structure.release(), m_workerContext); + // FIXME: When we add SharedWorkerContext, generate the correct wrapper here. + RefPtr<Structure> dedicatedContextPrototypeStructure = JSDedicatedWorkerContextPrototype::createStructure(workerContextPrototype); + ProtectedPtr<JSDedicatedWorkerContextPrototype> dedicatedContextPrototype = new (m_globalData.get()) JSDedicatedWorkerContextPrototype(dedicatedContextPrototypeStructure.release()); + RefPtr<Structure> structure = JSDedicatedWorkerContext::createStructure(dedicatedContextPrototype); + + m_workerContextWrapper = new (m_globalData.get()) JSDedicatedWorkerContext(structure.release(), static_cast<DedicatedWorkerContext*>(m_workerContext)); } ScriptValue WorkerScriptController::evaluate(const ScriptSourceCode& sourceCode) @@ -88,7 +91,7 @@ ScriptValue WorkerScriptController::evaluate(const ScriptSourceCode& sourceCode) ScriptValue exception; ScriptValue result = evaluate(sourceCode, &exception); if (exception.jsValue()) { - JSLock lock(false); + JSLock lock(SilenceAssertionsOnly); reportException(m_workerContextWrapper->globalExec(), exception.jsValue()); } return result; @@ -103,7 +106,7 @@ ScriptValue WorkerScriptController::evaluate(const ScriptSourceCode& sourceCode, } initScriptIfNeeded(); - JSLock lock(false); + JSLock lock(SilenceAssertionsOnly); ExecState* exec = m_workerContextWrapper->globalExec(); m_workerContextWrapper->globalData()->timeoutChecker.start(); |