Showing the changes to libraries/script-engine/src/v8/ScriptEngineV8.cpp (1 of 1 file). Show all
Unified · Split
| @@ -334,15 +334,7 @@ void ScriptEngineV8::registerEnum(ScriptEngineScopeGuard* scopeGuard, const QStr · 333 unmodified lines | ||
| 334 | 334 | |
| 335 | 335 | void ScriptEngineV8::registerValue(ScriptEngineScopeGuardV8* scopeGuard, const QString& valueName, V8ScriptValue value) { |
| 336 | 336 | Q_ASSERT(scopeGuard); |
| 337 | − if (QThread::currentThread() != thread()) { | |
| 338 | −#ifdef THREAD_DEBUGGING | |
| 339 | − qCDebug(scriptengine_v8) << "*** WARNING *** ScriptEngineV8::registerValue() called on wrong thread [" << QThread::currentThread() << "], invoking on correct thread [" << thread() << "]"; | |
| 340 | −#endif | |
| 341 | − QMetaObject::invokeMethod(this, "registerValue", | |
| 342 | − Q_ARG(const QString&, valueName), | |
| 343 | − Q_ARG(V8ScriptValue, value)); | |
| 344 | − return; | |
| 345 | − } | |
| 337 | + Q_ASSERT(QThread::currentThread() == thread()); | |
| 346 | 338 | Q_ASSERT(_v8Isolate->IsCurrent()); |
| 347 | 339 | v8::HandleScope handleScope(_v8Isolate); |
| 348 | 340 | v8::Local<v8::Context> context = getContext(); |
| @@ -392,18 +384,7 @@ void ScriptEngineV8::registerValue(ScriptEngineScopeGuardV8* scopeGuard, const Q · 43 unmodified lines | ||
| 392 | 384 | |
| 393 | 385 | void ScriptEngineV8::registerGlobalObject(ScriptEngineScopeGuard* scopeGuard, const QString& name, QObject* object, ScriptEngine::ValueOwnership) { |
| 394 | 386 | Q_ASSERT(scopeGuard && dynamic_cast<ScriptEngineScopeGuardV8*>(scopeGuard)); |
| 395 | − if (QThread::currentThread() != thread()) { | |
| 396 | −#ifdef THREAD_DEBUGGING | |
| 397 | − qCDebug(scriptengine_v8) << "*** WARNING *** ScriptEngineV8::registerGlobalObject() called on wrong thread [" << QThread::currentThread() << "], invoking on correct thread [" << thread() << "] name:" << name; | |
| 398 | −#endif | |
| 399 | − QMetaObject::invokeMethod(this, "registerGlobalObject", | |
| 400 | − Q_ARG(const QString&, name), | |
| 401 | − Q_ARG(QObject*, object)); | |
| 402 | − return; | |
| 403 | − } | |
| 404 | −#ifdef THREAD_DEBUGGING | |
| 405 | − qCDebug(scriptengine_v8) << "ScriptEngineV8::registerGlobalObject() called on thread [" << QThread::currentThread() << "] name:" << name; | |
| 406 | −#endif | |
| 387 | + Q_ASSERT(QThread::currentThread() == thread()); | |
| 407 | 388 | Q_ASSERT(_v8Isolate->IsCurrent()); |
| 408 | 389 | v8::HandleScope handleScope(_v8Isolate); |
| 409 | 390 | Q_ASSERT(_v8Isolate->IsCurrent()); |
| @@ -428,20 +409,7 @@ void ScriptEngineV8::registerGlobalObject(ScriptEngineScopeGuard* scopeGuard, co · 18 unmodified lines | ||
| 428 | 409 | |
| 429 | 410 | void ScriptEngineV8::registerFunction(ScriptEngineScopeGuard* scopeGuard, const QString& name, ScriptEngine::FunctionSignature functionSignature, int numArguments) { |
| 430 | 411 | Q_ASSERT(scopeGuard && dynamic_cast<ScriptEngineScopeGuardV8*>(scopeGuard)); |
| 431 | − if (QThread::currentThread() != thread()) { | |
| 432 | −#ifdef THREAD_DEBUGGING | |
| 433 | − qCDebug(scriptengine_v8) << "*** WARNING *** ScriptEngineV8::registerFunction() called on wrong thread [" << QThread::currentThread() << "], invoking on correct thread [" << thread() << "] name:" << name; | |
| 434 | −#endif | |
| 435 | − QMetaObject::invokeMethod(this, "registerFunction", | |
| 436 | − Q_ARG(const QString&, name), | |
| 437 | − Q_ARG(ScriptEngine::FunctionSignature, functionSignature), | |
| 438 | − Q_ARG(int, numArguments)); | |
| 439 | − return; | |
| 440 | − } | |
| 441 | −#ifdef THREAD_DEBUGGING | |
| 442 | − qCDebug(scriptengine_v8) << "ScriptEngineV8::registerFunction() called on thread [" << QThread::currentThread() << "] name:" << name; | |
| 443 | −#endif | |
| 444 | − | |
| 412 | + Q_ASSERT(QThread::currentThread() == thread()); | |
| 445 | 413 | Q_ASSERT(_v8Isolate->IsCurrent()); |
| 446 | 414 | v8::HandleScope handleScope(_v8Isolate); |
| 447 | 415 | v8::Context::Scope contextScope(getContext()); |
| @@ -452,20 +420,7 @@ void ScriptEngineV8::registerFunction(ScriptEngineScopeGuard* scopeGuard, const · 4 unmodified lines | ||
| 452 | 420 | |
| 453 | 421 | void ScriptEngineV8::registerFunction(ScriptEngineScopeGuard* scopeGuard, const QString& parent, const QString& name, ScriptEngine::FunctionSignature functionSignature, int numArguments) { |
| 454 | 422 | Q_ASSERT(scopeGuard && dynamic_cast<ScriptEngineScopeGuardV8*>(scopeGuard)); |
| 455 | − if (QThread::currentThread() != thread()) { | |
| 456 | −#ifdef THREAD_DEBUGGING | |
| 457 | − qCDebug(scriptengine_v8) << "*** WARNING *** ScriptEngineV8::registerFunction() called on wrong thread [" << QThread::currentThread() << "], invoking on correct thread [" << thread() << "] parent:" << parent << "name:" << name; | |
| 458 | −#endif | |
| 459 | − QMetaObject::invokeMethod(this, "registerFunction", | |
| 460 | − Q_ARG(const QString&, name), | |
| 461 | − Q_ARG(ScriptEngine::FunctionSignature, functionSignature), | |
| 462 | − Q_ARG(int, numArguments)); | |
| 463 | − return; | |
| 464 | − } | |
| 465 | −#ifdef THREAD_DEBUGGING | |
| 466 | − qCDebug(scriptengine_v8) << "ScriptEngineV8::registerFunction() called on thread [" << QThread::currentThread() << "] parent:" << parent << "name:" << name; | |
| 467 | −#endif | |
| 468 | − | |
| 423 | + Q_ASSERT(QThread::currentThread() == thread()); | |
| 469 | 424 | Q_ASSERT(_v8Isolate->IsCurrent()); |
| 470 | 425 | v8::HandleScope handleScope(_v8Isolate); |
| 471 | 426 | v8::Context::Scope contextScope(getContext()); |
| @@ -479,21 +434,7 @@ void ScriptEngineV8::registerFunction(ScriptEngineScopeGuard* scopeGuard, const · 7 unmodified lines | ||
| 479 | 434 | void ScriptEngineV8::registerGetterSetter(ScriptEngineScopeGuard* scopeGuard, const QString& name, ScriptEngine::FunctionSignature getter, |
| 480 | 435 | ScriptEngine::FunctionSignature setter, const QString& parent) { |
| 481 | 436 | Q_ASSERT(scopeGuard && dynamic_cast<ScriptEngineScopeGuardV8*>(scopeGuard)); |
| 482 | − if (QThread::currentThread() != thread()) { | |
| 483 | −#ifdef THREAD_DEBUGGING | |
| 484 | − qCDebug(scriptengine_v8) << "*** WARNING *** ScriptEngineV8::registerGetterSetter() called on wrong thread [" << QThread::currentThread() << "], invoking on correct thread [" << thread() << "] " | |
| 485 | − " name:" << name << "parent:" << parent; | |
| 486 | −#endif | |
| 487 | − QMetaObject::invokeMethod(this, "registerGetterSetter", | |
| 488 | − Q_ARG(const QString&, name), | |
| 489 | − Q_ARG(ScriptEngine::FunctionSignature, getter), | |
| 490 | − Q_ARG(ScriptEngine::FunctionSignature, setter), | |
| 491 | − Q_ARG(const QString&, parent)); | |
| 492 | − return; | |
| 493 | − } | |
| 494 | −#ifdef THREAD_DEBUGGING | |
| 495 | − qCDebug(scriptengine_v8) << "ScriptEngineV8::registerGetterSetter() called on thread [" << QThread::currentThread() << "] name:" << name << "parent:" << parent; | |
| 496 | −#endif | |
| 437 | + Q_ASSERT(QThread::currentThread() == thread()); | |
| 497 | 438 | |
| 498 | 439 | Q_ASSERT(_v8Isolate->IsCurrent()); |
| 499 | 440 | v8::HandleScope handleScope(_v8Isolate); |