PageRuntimeAgent.h [plain text]
#ifndef PageRuntimeAgent_h
#define PageRuntimeAgent_h
#if ENABLE(INSPECTOR)
#include "InspectorFrontend.h"
#include "InspectorRuntimeAgent.h"
#include "ScriptState.h"
#include <wtf/PassOwnPtr.h>
namespace WebCore {
class InspectorPageAgent;
class Page;
class SecurityOrigin;
class PageRuntimeAgent : public InspectorRuntimeAgent {
public:
static PassOwnPtr<PageRuntimeAgent> create(InstrumentingAgents* instrumentingAgents, InspectorCompositeState* state, InjectedScriptManager* injectedScriptManager, Page* page, InspectorPageAgent* pageAgent)
{
return adoptPtr(new PageRuntimeAgent(instrumentingAgents, state, injectedScriptManager, page, pageAgent));
}
virtual ~PageRuntimeAgent();
virtual void setFrontend(InspectorFrontend*);
virtual void clearFrontend();
virtual void restore();
virtual void enable(ErrorString*);
virtual void disable(ErrorString*);
void didCreateMainWorldContext(Frame*);
void didCreateIsolatedContext(Frame*, ScriptState*, SecurityOrigin*);
private:
PageRuntimeAgent(InstrumentingAgents*, InspectorCompositeState*, InjectedScriptManager*, Page*, InspectorPageAgent*);
virtual InjectedScript injectedScriptForEval(ErrorString*, const int* executionContextId);
virtual void muteConsole();
virtual void unmuteConsole();
void reportExecutionContextCreation();
void notifyContextCreated(const String& frameId, ScriptState*, SecurityOrigin*, bool isPageContext);
Page* m_inspectedPage;
InspectorPageAgent* m_pageAgent;
InspectorFrontend::Runtime* m_frontend;
bool m_mainWorldContextCreated;
};
}
#endif // ENABLE(INSPECTOR)
#endif // !defined(InspectorPagerAgent_h)