InspectorPageAgent.h [plain text]
#ifndef InspectorPageAgent_h
#define InspectorPageAgent_h
#if ENABLE(INSPECTOR)
#include "InspectorFrontend.h"
#include "PlatformString.h"
#include <wtf/RefCounted.h>
#include <wtf/Vector.h>
namespace WebCore {
class CachedResource;
class DOMWrapperWorld;
class DocumentLoader;
class Frame;
class Frontend;
class InjectedScriptManager;
class InspectorArray;
class InspectorObject;
class InstrumentingAgents;
class KURL;
class Page;
class RegularExpression;
typedef String ErrorString;
class InspectorPageAgent {
WTF_MAKE_NONCOPYABLE(InspectorPageAgent);
public:
enum ResourceType {
DocumentResource,
StylesheetResource,
ImageResource,
FontResource,
ScriptResource,
XHRResource,
WebSocketResource,
OtherResource
};
static PassOwnPtr<InspectorPageAgent> create(InstrumentingAgents*, Page*, InjectedScriptManager*);
static void resourceContent(ErrorString*, Frame*, const KURL&, String* result);
static void resourceContentBase64(ErrorString*, Frame*, const KURL&, String* result);
static PassRefPtr<SharedBuffer> resourceData(Frame*, const KURL&, String* textEncodingName);
static CachedResource* cachedResource(Frame*, const KURL&);
static String resourceTypeString(ResourceType);
static ResourceType cachedResourceType(const CachedResource&);
static String cachedResourceTypeString(const CachedResource&);
void addScriptToEvaluateOnLoad(ErrorString*, const String& source);
void removeAllScriptsToEvaluateOnLoad(ErrorString*);
void reload(ErrorString*, const bool* const optionalIgnoreCache);
void open(ErrorString*, const String& url, const bool* const inNewWindow);
void getCookies(ErrorString*, RefPtr<InspectorArray>* cookies, WTF::String* cookiesString);
void deleteCookie(ErrorString*, const String& cookieName, const String& domain);
void getResourceTree(ErrorString*, RefPtr<InspectorObject>*);
void getResourceContent(ErrorString*, const String& frameId, const String& url, const bool* const base64Encode, String* content);
void searchInResources(ErrorString*, const String&, const bool* const caseSensitive, const bool* const isRegex, RefPtr<InspectorArray>*);
void didClearWindowObjectInWorld(Frame*, DOMWrapperWorld*);
void domContentEventFired();
void loadEventFired();
void frameNavigated(DocumentLoader*);
void frameDetached(Frame*);
void setFrontend(InspectorFrontend*);
void clearFrontend();
Frame* mainFrame();
Frame* frameForId(const String& frameId);
String frameId(Frame*);
String loaderId(DocumentLoader*);
private:
InspectorPageAgent(InstrumentingAgents*, Page*, InjectedScriptManager*);
PassRefPtr<InspectorObject> buildObjectForFrame(Frame*);
PassRefPtr<InspectorObject> buildObjectForFrameTree(Frame*);
InstrumentingAgents* m_instrumentingAgents;
Page* m_page;
InjectedScriptManager* m_injectedScriptManager;
InspectorFrontend::Page* m_frontend;
Vector<String> m_scriptsToEvaluateOnLoad;
};
}
#endif // ENABLE(INSPECTOR)
#endif // !defined(InspectorPagerAgent_h)