diff options
author | Ulf Hermann <ulf.hermann@theqtcompany.com> | 2015-11-12 17:03:38 +0100 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@theqtcompany.com> | 2015-11-18 09:35:56 +0000 |
commit | 242067390f3bd891b162164a2d01a3a982c64fa2 (patch) | |
tree | 028689821344d0f5275379cbe4a03f713c3badca /src/qml/qml/v8/qqmlbuiltinfunctions.cpp | |
parent | c4bd6beca3e7c3e8cf31af2f3fdd08a1f7aeabcb (diff) |
Allow enabling of QML profiler in JS-only environment
It's probably not so easy to use as you still need a
QQmlDebugConnector, but it might work for some.
Change-Id: Ibca42666a8ac0f81e2f30843f790ffd61b5ef65f
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Diffstat (limited to 'src/qml/qml/v8/qqmlbuiltinfunctions.cpp')
-rw-r--r-- | src/qml/qml/v8/qqmlbuiltinfunctions.cpp | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/src/qml/qml/v8/qqmlbuiltinfunctions.cpp b/src/qml/qml/v8/qqmlbuiltinfunctions.cpp index 3acabe390f..b0e490b5c9 100644 --- a/src/qml/qml/v8/qqmlbuiltinfunctions.cpp +++ b/src/qml/qml/v8/qqmlbuiltinfunctions.cpp @@ -1450,9 +1450,6 @@ QV4::ReturnedValue ConsoleObject::method_profile(CallContext *ctx) { QV4::ExecutionEngine *v4 = ctx->d()->engine; - if (!v4->qmlEngine()) - return QV4::Encode::undefined(); // Not yet implemented for JavaScript. - QV4::StackFrame frame = v4->currentStackFrame(); const QByteArray baSource = frame.source.toUtf8(); const QByteArray baFunction = frame.function.toUtf8(); @@ -1461,7 +1458,7 @@ QV4::ReturnedValue ConsoleObject::method_profile(CallContext *ctx) if (!service) { logger.warning("Cannot start profiling because debug service is disabled. Start with -qmljsdebugger=port:XXXXX."); } else { - service->startProfiling(v4->qmlEngine()); + service->startProfiling(v4->jsEngine()); logger.debug("Profiling started."); } @@ -1472,9 +1469,6 @@ QV4::ReturnedValue ConsoleObject::method_profileEnd(CallContext *ctx) { QV4::ExecutionEngine *v4 = ctx->d()->engine; - if (!v4->qmlEngine()) - return QV4::Encode::undefined(); // Not yet implemented for JavaScript. - QV4::StackFrame frame = v4->currentStackFrame(); const QByteArray baSource = frame.source.toUtf8(); const QByteArray baFunction = frame.function.toUtf8(); @@ -1484,7 +1478,7 @@ QV4::ReturnedValue ConsoleObject::method_profileEnd(CallContext *ctx) if (!service) { logger.warning("Ignoring console.profileEnd(): the debug service is disabled."); } else { - service->stopProfiling(v4->qmlEngine()); + service->stopProfiling(v4->jsEngine()); logger.debug("Profiling ended."); } |