RemoteInspectionTarget.h [plain text]
#pragma once
#if ENABLE(REMOTE_INSPECTOR)
#include "RemoteControllableTarget.h"
#include <wtf/RetainPtr.h>
#include <wtf/TypeCasts.h>
#include <wtf/text/WTFString.h>
namespace Inspector {
class FrontendChannel;
class JS_EXPORT_PRIVATE RemoteInspectionTarget : public RemoteControllableTarget {
public:
bool remoteDebuggingAllowed() const { return m_allowed; }
void setRemoteDebuggingAllowed(bool);
#if USE(CF)
CFRunLoopRef targetRunLoop() const final { return m_runLoop.get(); }
void setTargetRunLoop(CFRunLoopRef runLoop) { m_runLoop = runLoop; }
#endif
virtual String name() const { return String(); } virtual String url() const { return String(); } virtual bool hasLocalDebugger() const = 0;
virtual void setIndicating(bool) { }
virtual bool automaticInspectionAllowed() const { return false; }
virtual void pauseWaitingForAutomaticInspection();
virtual void unpauseForInitializedInspector();
bool remoteControlAllowed() const final;
private:
bool m_allowed { false };
#if USE(CF)
RetainPtr<CFRunLoopRef> m_runLoop;
#endif
};
}
SPECIALIZE_TYPE_TRAITS_BEGIN(Inspector::RemoteInspectionTarget) \
static bool isType(const Inspector::RemoteControllableTarget& target) \
{ \
return target.type() == Inspector::RemoteControllableTarget::Type::JavaScript \
|| target.type() == Inspector::RemoteControllableTarget::Type::ServiceWorker \
|| target.type() == Inspector::RemoteControllableTarget::Type::Web; \
}
SPECIALIZE_TYPE_TRAITS_END()
#endif // ENABLE(REMOTE_INSPECTOR)