WebInspectorServer.h [plain text]
#ifndef WebInspectorServer_h
#define WebInspectorServer_h
#if ENABLE(INSPECTOR_SERVER)
#include "WebSocketServer.h"
#include "WebSocketServerClient.h"
#include <wtf/HashMap.h>
#include <wtf/text/WTFString.h>
namespace WebKit {
class WebInspectorProxy;
class WebInspectorServer : public WebSocketServer, public WebSocketServerClient {
public:
typedef HashMap<unsigned, WebInspectorProxy*> ClientMap;
static WebInspectorServer& singleton();
int registerPage(WebInspectorProxy* client);
void unregisterPage(int pageId);
String inspectorUrlForPageID(int pageId);
void sendMessageOverConnection(unsigned pageIdForConnection, const String& message);
private:
WebInspectorServer();
~WebInspectorServer();
virtual void didReceiveUnrecognizedHTTPRequest(WebSocketServerConnection*, PassRefPtr<HTTPRequest>);
virtual bool didReceiveWebSocketUpgradeHTTPRequest(WebSocketServerConnection*, PassRefPtr<HTTPRequest>);
virtual void didEstablishWebSocketConnection(WebSocketServerConnection*, PassRefPtr<HTTPRequest>);
virtual void didReceiveWebSocketMessage(WebSocketServerConnection*, const String& message);
virtual void didCloseWebSocketConnection(WebSocketServerConnection*);
bool platformResourceForPath(const String& path, Vector<char>& data, String& contentType);
#if PLATFORM(GTK) || PLATFORM(EFL)
void buildPageList(Vector<char>& data, String& contentType);
#endif
void closeConnection(WebInspectorProxy*, WebSocketServerConnection*);
unsigned m_nextAvailablePageId;
ClientMap m_clientMap;
HashMap<unsigned, WebSocketServerConnection*> m_connectionMap;
};
}
#endif // ENABLE(INSPECTOR_SERVER)
#endif // WebInspectorServer_h