Web Inspector: Remove unused Timeline GCEvent Record type
[WebKit-https.git] / Source / WebCore / inspector / TimelineRecordFactory.h
1 /*
2  * Copyright (C) 2009 Google Inc. All rights reserved.
3  * Copyright (C) 2014 University of Washington.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions are
7  * met:
8  *
9  *     * Redistributions of source code must retain the above copyright
10  * notice, this list of conditions and the following disclaimer.
11  *     * Redistributions in binary form must reproduce the above
12  * copyright notice, this list of conditions and the following disclaimer
13  * in the documentation and/or other materials provided with the
14  * distribution.
15  *     * Neither the name of Google Inc. nor the names of its
16  * contributors may be used to endorse or promote products derived from
17  * this software without specific prior written permission.
18  *
19  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30  */
31  
32 #ifndef TimelineRecordFactory_h
33 #define TimelineRecordFactory_h
34
35 #include "URL.h"
36 #include <inspector/InspectorValues.h>
37 #include <wtf/Forward.h>
38 #include <wtf/text/WTFString.h>
39
40 namespace JSC {
41 class Profile;
42 }
43
44 namespace Inspector {
45 struct ScriptBreakpointAction;
46 }
47
48 namespace WebCore {
49
50     class Event;
51     class FloatQuad;
52     class ResourceRequest;
53     class ResourceResponse;
54     class ScriptProfile;
55
56     class TimelineRecordFactory {
57     public:
58         static Ref<Inspector::InspectorObject> createGenericRecord(double startTime, int maxCallStackDepth);
59         static Ref<Inspector::InspectorObject> createBackgroundRecord(double startTime, const String& thread);
60
61         static Ref<Inspector::InspectorObject> createFunctionCallData(const String& scriptName, int scriptLine);
62         static Ref<Inspector::InspectorObject> createConsoleProfileData(const String& title);
63
64         static Ref<Inspector::InspectorObject> createProbeSampleData(const Inspector::ScriptBreakpointAction&, unsigned sampleId);
65
66         static Ref<Inspector::InspectorObject> createEventDispatchData(const Event&);
67
68         static Ref<Inspector::InspectorObject> createGenericTimerData(int timerId);
69
70         static Ref<Inspector::InspectorObject> createTimerInstallData(int timerId, int timeout, bool singleShot);
71
72         static Ref<Inspector::InspectorObject> createXHRReadyStateChangeData(const String& url, int readyState);
73
74         static Ref<Inspector::InspectorObject> createXHRLoadData(const String& url);
75
76         static Ref<Inspector::InspectorObject> createEvaluateScriptData(const String&, double lineNumber);
77
78         static Ref<Inspector::InspectorObject> createTimeStampData(const String&);
79
80         static Ref<Inspector::InspectorObject> createLayoutData(unsigned dirtyObjects, unsigned totalObjects, bool partialLayout);
81
82         static Ref<Inspector::InspectorObject> createMarkData(bool isMainFrame);
83
84         static Ref<Inspector::InspectorObject> createParseHTMLData(unsigned startLine);
85
86         static Ref<Inspector::InspectorObject> createAnimationFrameData(int callbackId);
87
88         static Ref<Inspector::InspectorObject> createPaintData(const FloatQuad&);
89
90         static void appendLayoutRoot(Inspector::InspectorObject* data, const FloatQuad&);
91
92         static void appendProfile(Inspector::InspectorObject*, RefPtr<JSC::Profile>&&);
93
94 #if ENABLE(WEB_SOCKETS)
95         static inline Ref<Inspector::InspectorObject> createWebSocketCreateData(unsigned long identifier, const URL& url, const String& protocol)
96         {
97             Ref<Inspector::InspectorObject> data = Inspector::InspectorObject::create();
98             data->setInteger("identifier", identifier);
99             data->setString("url", url.string());
100             if (!protocol.isNull())
101                 data->setString("webSocketProtocol", protocol);
102             return WTF::move(data);
103         }
104
105         static inline Ref<Inspector::InspectorObject> createGenericWebSocketData(unsigned long identifier)
106         {
107             Ref<Inspector::InspectorObject> data = Inspector::InspectorObject::create();
108             data->setInteger("identifier", identifier);
109             return WTF::move(data);
110         }
111 #endif
112     private:
113         TimelineRecordFactory() { }
114     };
115
116 } // namespace WebCore
117
118 #endif // !defined(TimelineRecordFactory_h)