diff options
author | Lars Knoll <lars.knoll@digia.com> | 2013-05-30 13:45:23 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@digia.com> | 2013-05-30 16:42:25 +0200 |
commit | ca7ddc345ec4df017b7db6aee5a823f817e6e708 (patch) | |
tree | 170cd6efba1028f867e15cb2dce160f3639d2395 /src/qml/types/qquickworkerscript.cpp | |
parent | 35ab04c907a1cefa23eff2d7c853350fb5d27178 (diff) |
Cleanup the context wrapper code
Remove the QV8ContextWrapper class and move the code out
of the v8 directory.
Change-Id: I00c02f7310a3e43bd105c5bc5af034ce652cfd49
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/types/qquickworkerscript.cpp')
-rw-r--r-- | src/qml/types/qquickworkerscript.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/qml/types/qquickworkerscript.cpp b/src/qml/types/qquickworkerscript.cpp index 0ee2a06b69..95eabb0f4d 100644 --- a/src/qml/types/qquickworkerscript.cpp +++ b/src/qml/types/qquickworkerscript.cpp @@ -44,6 +44,7 @@ #include "qqmllistmodelworkeragent_p.h" #include <private/qqmlengine_p.h> #include <private/qqmlexpression_p.h> +#include <private/qqmlcontextwrapper_p.h> #include <QtCore/qcoreevent.h> #include <QtCore/qcoreapplication.h> @@ -295,16 +296,17 @@ QV4::Value QQuickWorkerScriptEnginePrivate::getWorker(WorkerScript *script) QV4::ExecutionEngine *v4 = QV8Engine::getV4(workerEngine); - script->object = workerEngine->contextWrapper()->urlScope(script->source); + script->object = QV4::QmlContextWrapper::urlScope(workerEngine, script->source); - workerEngine->contextWrapper()->setReadOnly(script->object.value(), false); + QV4::QmlContextWrapper *w = script->object.value().asObject()->asQmlContext(); + w->setReadOnly(false); QV4::Object *api = v4->newObject(); api->put(v4->newString("sendMessage"), workerEngine->sendFunction(script->id)); script->object.value().asObject()->put(v4->newString("WorkerScript"), QV4::Value::fromObject(api)); - workerEngine->contextWrapper()->setReadOnly(script->object.value(), true); + w->setReadOnly(true); } return script->object.value(); |