X-Git-Url: https://git.saurik.com/apple/javascriptcore.git/blobdiff_plain/81345200c95645a1b0d2635520f96ad55dfde63f..HEAD:/inspector/remote/RemoteInspectorDebuggable.cpp diff --git a/inspector/remote/RemoteInspectorDebuggable.cpp b/inspector/remote/RemoteInspectorDebuggable.cpp index fdf1d96..ac83a18 100644 --- a/inspector/remote/RemoteInspectorDebuggable.cpp +++ b/inspector/remote/RemoteInspectorDebuggable.cpp @@ -28,6 +28,7 @@ #if ENABLE(REMOTE_INSPECTOR) +#include "EventLoop.h" #include "InspectorFrontendChannel.h" #include "RemoteInspector.h" @@ -41,17 +42,17 @@ RemoteInspectorDebuggable::RemoteInspectorDebuggable() RemoteInspectorDebuggable::~RemoteInspectorDebuggable() { - RemoteInspector::shared().unregisterDebuggable(this); + RemoteInspector::singleton().unregisterDebuggable(this); } void RemoteInspectorDebuggable::init() { - RemoteInspector::shared().registerDebuggable(this); + RemoteInspector::singleton().registerDebuggable(this); } void RemoteInspectorDebuggable::update() { - RemoteInspector::shared().updateDebuggable(this); + RemoteInspector::singleton().updateDebuggable(this); } void RemoteInspectorDebuggable::setRemoteDebuggingAllowed(bool allowed) @@ -61,7 +62,10 @@ void RemoteInspectorDebuggable::setRemoteDebuggingAllowed(bool allowed) m_allowed = allowed; - update(); + if (m_allowed && automaticInspectionAllowed()) + RemoteInspector::singleton().updateDebuggableAutomaticInspectCandidate(this); + else + RemoteInspector::singleton().updateDebuggable(this); } RemoteInspectorDebuggableInfo RemoteInspectorDebuggable::info() const @@ -76,6 +80,22 @@ RemoteInspectorDebuggableInfo RemoteInspectorDebuggable::info() const return info; } +void RemoteInspectorDebuggable::pauseWaitingForAutomaticInspection() +{ + ASSERT(m_identifier); + ASSERT(m_allowed); + ASSERT(automaticInspectionAllowed()); + + EventLoop loop; + while (RemoteInspector::singleton().waitingForAutomaticInspection(identifier()) && !loop.ended()) + loop.cycle(); +} + +void RemoteInspectorDebuggable::unpauseForInitializedInspector() +{ + RemoteInspector::singleton().setupCompleted(identifier()); +} + } // namespace Inspector #endif // ENABLE(REMOTE_INSPECTOR)