RemoteInspectorDebuggable.h [plain text]
#if ENABLE(REMOTE_INSPECTOR)
#ifndef RemoteInspectorDebuggable_h
#define RemoteInspectorDebuggable_h
#include <CoreFoundation/CFRunLoop.h>
#include <wtf/RetainPtr.h>
#include <wtf/text/WTFString.h>
namespace Inspector {
class InspectorFrontendChannel;
struct RemoteInspectorDebuggableInfo;
class JS_EXPORT_PRIVATE RemoteInspectorDebuggable {
public:
RemoteInspectorDebuggable();
virtual ~RemoteInspectorDebuggable();
void init();
void update();
unsigned identifier() const { return m_identifier; }
void setIdentifier(unsigned identifier) { m_identifier = identifier; }
bool remoteDebuggingAllowed() const { return m_allowed; }
void setRemoteDebuggingAllowed(bool);
CFRunLoopRef debuggerRunLoop() { return m_runLoop.get(); }
void setDebuggerRunLoop(CFRunLoopRef runLoop) { m_runLoop = runLoop; }
RemoteInspectorDebuggableInfo info() const;
enum DebuggableType { JavaScript, Web };
virtual DebuggableType type() const = 0;
virtual String name() const { return String(); } virtual String url() const { return String(); } virtual bool hasLocalDebugger() const = 0;
virtual void connect(InspectorFrontendChannel*) = 0;
virtual void disconnect() = 0;
virtual void dispatchMessageFromRemoteFrontend(const String& message) = 0;
virtual void setIndicating(bool) { }
private:
unsigned m_identifier;
bool m_allowed;
RetainPtr<CFRunLoopRef> m_runLoop;
};
struct RemoteInspectorDebuggableInfo {
RemoteInspectorDebuggableInfo()
: identifier(0)
, type(RemoteInspectorDebuggable::JavaScript)
, hasLocalDebugger(false)
, remoteDebuggingAllowed(false)
{
}
unsigned identifier;
RemoteInspectorDebuggable::DebuggableType type;
String name;
String url;
bool hasLocalDebugger;
bool remoteDebuggingAllowed;
};
}
#endif // RemoteInspectorDebuggable_h
#endif // ENABLE(REMOTE_INSPECTOR)