TimelineRecordFactory.h [plain text]
#ifndef TimelineRecordFactory_h
#define TimelineRecordFactory_h
#include "URL.h"
#include <inspector/InspectorValues.h>
#include <wtf/Forward.h>
#include <wtf/text/WTFString.h>
namespace JSC {
class Profile;
}
namespace Inspector {
struct ScriptBreakpointAction;
}
namespace WebCore {
class Event;
class FloatQuad;
class ResourceRequest;
class ResourceResponse;
class ScriptProfile;
class TimelineRecordFactory {
public:
static PassRefPtr<Inspector::InspectorObject> createGenericRecord(double startTime, int maxCallStackDepth);
static PassRefPtr<Inspector::InspectorObject> createBackgroundRecord(double startTime, const String& thread);
static PassRefPtr<Inspector::InspectorObject> createGCEventData(const size_t usedHeapSizeDelta);
static PassRefPtr<Inspector::InspectorObject> createFunctionCallData(const String& scriptName, int scriptLine);
static PassRefPtr<Inspector::InspectorObject> createConsoleProfileData(const String& title);
static PassRefPtr<Inspector::InspectorObject> createProbeSampleData(const Inspector::ScriptBreakpointAction&, int hitCount);
static PassRefPtr<Inspector::InspectorObject> createEventDispatchData(const Event&);
static PassRefPtr<Inspector::InspectorObject> createGenericTimerData(int timerId);
static PassRefPtr<Inspector::InspectorObject> createTimerInstallData(int timerId, int timeout, bool singleShot);
static PassRefPtr<Inspector::InspectorObject> createXHRReadyStateChangeData(const String& url, int readyState);
static PassRefPtr<Inspector::InspectorObject> createXHRLoadData(const String& url);
static PassRefPtr<Inspector::InspectorObject> createEvaluateScriptData(const String&, double lineNumber);
static PassRefPtr<Inspector::InspectorObject> createTimeStampData(const String&);
static PassRefPtr<Inspector::InspectorObject> createResourceSendRequestData(const String& requestId, const ResourceRequest&);
static PassRefPtr<Inspector::InspectorObject> createScheduleResourceRequestData(const String&);
static PassRefPtr<Inspector::InspectorObject> createResourceReceiveResponseData(const String& requestId, const ResourceResponse&);
static PassRefPtr<Inspector::InspectorObject> createReceiveResourceData(const String& requestId, int length);
static PassRefPtr<Inspector::InspectorObject> createResourceFinishData(const String& requestId, bool didFail, double finishTime);
static PassRefPtr<Inspector::InspectorObject> createLayoutData(unsigned dirtyObjects, unsigned totalObjects, bool partialLayout);
static PassRefPtr<Inspector::InspectorObject> createDecodeImageData(const String& imageType);
static PassRefPtr<Inspector::InspectorObject> createResizeImageData(bool shouldCache);
static PassRefPtr<Inspector::InspectorObject> createMarkData(bool isMainFrame);
static PassRefPtr<Inspector::InspectorObject> createParseHTMLData(unsigned startLine);
static PassRefPtr<Inspector::InspectorObject> createAnimationFrameData(int callbackId);
static PassRefPtr<Inspector::InspectorObject> createPaintData(const FloatQuad&);
static void appendLayoutRoot(Inspector::InspectorObject* data, const FloatQuad&);
static void appendProfile(Inspector::InspectorObject*, PassRefPtr<JSC::Profile>);
#if ENABLE(WEB_SOCKETS)
static inline PassRefPtr<Inspector::InspectorObject> createWebSocketCreateData(unsigned long identifier, const URL& url, const String& protocol)
{
RefPtr<Inspector::InspectorObject> data = Inspector::InspectorObject::create();
data->setNumber("identifier", identifier);
data->setString("url", url.string());
if (!protocol.isNull())
data->setString("webSocketProtocol", protocol);
return data.release();
}
static inline PassRefPtr<Inspector::InspectorObject> createGenericWebSocketData(unsigned long identifier)
{
RefPtr<Inspector::InspectorObject> data = Inspector::InspectorObject::create();
data->setNumber("identifier", identifier);
return data.release();
}
#endif
private:
TimelineRecordFactory() { }
};
}
#endif // !defined(TimelineRecordFactory_h)