JSGlobalObjectDebuggable.cpp [plain text]
#include "config.h"
#include "JSGlobalObjectDebuggable.h"
#if ENABLE(REMOTE_INSPECTOR)
#include "InspectorAgentBase.h"
#include "InspectorFrontendChannel.h"
#include "JSGlobalObject.h"
#include "JSLock.h"
#include "RemoteInspector.h"
using namespace Inspector;
namespace JSC {
JSGlobalObjectDebuggable::JSGlobalObjectDebuggable(JSGlobalObject& globalObject)
: m_globalObject(globalObject)
{
}
String JSGlobalObjectDebuggable::name() const
{
String name = m_globalObject.name();
return name.isEmpty() ? ASCIILiteral("JSContext") : name;
}
void JSGlobalObjectDebuggable::connect(FrontendChannel* frontendChannel, bool automaticInspection)
{
JSLockHolder locker(&m_globalObject.vm());
m_globalObject.inspectorController().connectFrontend(frontendChannel, automaticInspection);
}
void JSGlobalObjectDebuggable::disconnect()
{
JSLockHolder locker(&m_globalObject.vm());
m_globalObject.inspectorController().disconnectFrontend(DisconnectReason::InspectorDestroyed);
}
void JSGlobalObjectDebuggable::pause()
{
JSLockHolder locker(&m_globalObject.vm());
m_globalObject.inspectorController().pause();
}
void JSGlobalObjectDebuggable::dispatchMessageFromRemoteFrontend(const String& message)
{
JSLockHolder locker(&m_globalObject.vm());
m_globalObject.inspectorController().dispatchMessageFromFrontend(message);
}
void JSGlobalObjectDebuggable::pauseWaitingForAutomaticInspection()
{
JSC::JSLock::DropAllLocks dropAllLocks(&m_globalObject.vm());
RemoteInspectorDebuggable::pauseWaitingForAutomaticInspection();
}
}
#endif // ENABLE(REMOTE_INSPECTOR)