InspectorWorkerAgent.h [plain text]
#ifndef InspectorWorkerAgent_h
#define InspectorWorkerAgent_h
#if ENABLE(WORKERS)
#include "InspectorBaseAgent.h"
#include <wtf/Forward.h>
#include <wtf/HashMap.h>
namespace WebCore {
class InspectorFrontend;
class InspectorObject;
class InspectorState;
class InstrumentingAgents;
class KURL;
class WorkerContextProxy;
typedef String ErrorString;
class InspectorWorkerAgent : public InspectorBaseAgent<InspectorWorkerAgent>, public InspectorBackendDispatcher::WorkerCommandHandler {
public:
static PassOwnPtr<InspectorWorkerAgent> create(InstrumentingAgents*, InspectorCompositeState*);
~InspectorWorkerAgent();
virtual void setFrontend(InspectorFrontend*);
virtual void restore();
virtual void clearFrontend();
bool shouldPauseDedicatedWorkerOnStart();
void didStartWorkerContext(WorkerContextProxy*, const KURL&);
void workerContextTerminated(WorkerContextProxy*);
virtual void enable(ErrorString*);
virtual void disable(ErrorString*);
virtual void canInspectWorkers(ErrorString*, bool*);
virtual void connectToWorker(ErrorString*, int workerId);
virtual void disconnectFromWorker(ErrorString*, int workerId);
virtual void sendMessageToWorker(ErrorString*, int workerId, const RefPtr<InspectorObject>& message);
virtual void setAutoconnectToWorkers(ErrorString*, bool value);
private:
InspectorWorkerAgent(InstrumentingAgents*, InspectorCompositeState*);
void createWorkerFrontendChannelsForExistingWorkers();
void createWorkerFrontendChannel(WorkerContextProxy*, const String& url);
void destroyWorkerFrontendChannels();
InspectorFrontend* m_inspectorFrontend;
class WorkerFrontendChannel;
typedef HashMap<int, WorkerFrontendChannel*> WorkerChannels;
WorkerChannels m_idToChannel;
typedef HashMap<WorkerContextProxy*, String> DedicatedWorkers;
DedicatedWorkers m_dedicatedWorkers;
};
}
#endif // !defined(InspectorWorkerAgent_h)
#endif // ENABLE(WORKERS)