OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
150 , skipWhenUnbalanced(false) | 150 , skipWhenUnbalanced(false) |
151 { | 151 { |
152 } | 152 } |
153 RefPtr<TimelineEvent> record; | 153 RefPtr<TimelineEvent> record; |
154 RefPtr<JSONObject> data; | 154 RefPtr<JSONObject> data; |
155 RefPtr<TypeBuilder::Array<TimelineEvent> > children; | 155 RefPtr<TypeBuilder::Array<TimelineEvent> > children; |
156 String type; | 156 String type; |
157 bool skipWhenUnbalanced; | 157 bool skipWhenUnbalanced; |
158 }; | 158 }; |
159 | 159 |
160 class TimelineRecordStack { | 160 class TimelineRecordStack : public NoBaseWillBeGarbageCollectedFinalized<Timelin eRecordStack> { |
tkent
2014/06/11 05:48:49
You don't need to make TimelineRecordStack on-heap
keishi
2014/06/19 04:36:22
Done.
| |
161 private: | 161 private: |
162 struct Entry { | 162 struct Entry { |
163 Entry(PassRefPtr<TimelineEvent> record, const String& type) | 163 Entry(PassRefPtr<TimelineEvent> record, const String& type) |
164 : record(record) | 164 : record(record) |
165 , children(TypeBuilder::Array<TimelineEvent>::create()) | 165 , children(TypeBuilder::Array<TimelineEvent>::create()) |
166 #ifndef NDEBUG | 166 #ifndef NDEBUG |
167 , type(type) | 167 , type(type) |
168 #endif | 168 #endif |
169 { | 169 { |
170 } | 170 } |
171 | 171 |
172 RefPtr<TimelineEvent> record; | 172 RefPtr<TimelineEvent> record; |
173 RefPtr<TypeBuilder::Array<TimelineEvent> > children; | 173 RefPtr<TypeBuilder::Array<TimelineEvent> > children; |
174 #ifndef NDEBUG | 174 #ifndef NDEBUG |
175 String type; | 175 String type; |
176 #endif | 176 #endif |
177 }; | 177 }; |
178 | 178 |
179 public: | 179 public: |
180 TimelineRecordStack() : m_timelineAgent(0) { } | 180 TimelineRecordStack() : m_timelineAgent(nullptr) { } |
181 TimelineRecordStack(InspectorTimelineAgent*); | 181 TimelineRecordStack(InspectorTimelineAgent*); |
182 | 182 |
183 void addScopedRecord(PassRefPtr<TimelineEvent> record, const String& type); | 183 void addScopedRecord(PassRefPtr<TimelineEvent> record, const String& type); |
184 void closeScopedRecord(double endTime); | 184 void closeScopedRecord(double endTime); |
185 void addInstantRecord(PassRefPtr<TimelineEvent> record); | 185 void addInstantRecord(PassRefPtr<TimelineEvent> record); |
186 | 186 |
187 #ifndef NDEBUG | 187 #ifndef NDEBUG |
188 bool isOpenRecordOfType(const String& type); | 188 bool isOpenRecordOfType(const String& type); |
189 #endif | 189 #endif |
190 | 190 |
191 void trace(Visitor*); | |
192 | |
191 private: | 193 private: |
192 void send(PassRefPtr<JSONObject>); | 194 void send(PassRefPtr<JSONObject>); |
193 | 195 |
194 InspectorTimelineAgent* m_timelineAgent; | 196 RawPtrWillBeMember<InspectorTimelineAgent> m_timelineAgent; |
195 Vector<Entry> m_stack; | 197 Vector<Entry> m_stack; |
196 }; | 198 }; |
197 | 199 |
198 struct TimelineThreadState { | 200 struct TimelineThreadState : public NoBaseWillBeGarbageCollectedFinalized<Timeli neThreadState> { |
199 TimelineThreadState() { } | 201 TimelineThreadState() { } |
200 | 202 |
201 TimelineThreadState(InspectorTimelineAgent* timelineAgent) | 203 TimelineThreadState(InspectorTimelineAgent* timelineAgent) |
202 : recordStack(timelineAgent) | 204 : recordStack(adoptPtrWillBeNoop(new TimelineRecordStack(timelineAgent)) ) |
203 , inKnownLayerTask(false) | 205 , inKnownLayerTask(false) |
204 , decodedPixelRefId(0) | 206 , decodedPixelRefId(0) |
205 { | 207 { |
206 } | 208 } |
207 | 209 |
208 TimelineRecordStack recordStack; | 210 void trace(Visitor*); |
211 | |
212 OwnPtrWillBeMember<TimelineRecordStack> recordStack; | |
209 bool inKnownLayerTask; | 213 bool inKnownLayerTask; |
210 unsigned long long decodedPixelRefId; | 214 unsigned long long decodedPixelRefId; |
211 }; | 215 }; |
212 | 216 |
213 struct TimelineImageInfo { | 217 struct TimelineImageInfo { |
214 int backendNodeId; | 218 int backendNodeId; |
215 String url; | 219 String url; |
216 | 220 |
217 TimelineImageInfo() : backendNodeId(0) { } | 221 TimelineImageInfo() : backendNodeId(0) { } |
218 TimelineImageInfo(int backendNodeId, String url) : backendNodeId(backendNode Id), url(url) { } | 222 TimelineImageInfo(int backendNodeId, String url) : backendNodeId(backendNode Id), url(url) { } |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
258 } | 262 } |
259 | 263 |
260 InspectorTimelineAgent::~InspectorTimelineAgent() | 264 InspectorTimelineAgent::~InspectorTimelineAgent() |
261 { | 265 { |
262 } | 266 } |
263 | 267 |
264 void InspectorTimelineAgent::trace(Visitor* visitor) | 268 void InspectorTimelineAgent::trace(Visitor* visitor) |
265 { | 269 { |
266 visitor->trace(m_pageAgent); | 270 visitor->trace(m_pageAgent); |
267 visitor->trace(m_layerTreeAgent); | 271 visitor->trace(m_layerTreeAgent); |
272 visitor->trace(m_threadStates); | |
268 InspectorBaseAgent::trace(visitor); | 273 InspectorBaseAgent::trace(visitor); |
269 } | 274 } |
270 | 275 |
271 void InspectorTimelineAgent::setFrontend(InspectorFrontend* frontend) | 276 void InspectorTimelineAgent::setFrontend(InspectorFrontend* frontend) |
272 { | 277 { |
273 m_frontend = frontend->timeline(); | 278 m_frontend = frontend->timeline(); |
274 } | 279 } |
275 | 280 |
276 void InspectorTimelineAgent::clearFrontend() | 281 void InspectorTimelineAgent::clearFrontend() |
277 { | 282 { |
(...skipping 608 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
886 { | 891 { |
887 appendRecord(TimelineRecordFactory::createGenericWebSocketData(identifier), TimelineRecordType::WebSocketDestroy, true, document->frame()); | 892 appendRecord(TimelineRecordFactory::createGenericWebSocketData(identifier), TimelineRecordType::WebSocketDestroy, true, document->frame()); |
888 } | 893 } |
889 | 894 |
890 void InspectorTimelineAgent::onBeginImplSideFrame(const TraceEventDispatcher::Tr aceEvent& event) | 895 void InspectorTimelineAgent::onBeginImplSideFrame(const TraceEventDispatcher::Tr aceEvent& event) |
891 { | 896 { |
892 unsigned long long layerTreeId = event.asUInt(InstrumentationEventArguments: :LayerTreeId); | 897 unsigned long long layerTreeId = event.asUInt(InstrumentationEventArguments: :LayerTreeId); |
893 if (layerTreeId != m_layerTreeId) | 898 if (layerTreeId != m_layerTreeId) |
894 return; | 899 return; |
895 TimelineThreadState& state = threadState(event.threadIdentifier()); | 900 TimelineThreadState& state = threadState(event.threadIdentifier()); |
896 state.recordStack.addInstantRecord(createRecordForEvent(event, TimelineRecor dType::BeginFrame, JSONObject::create())); | 901 state.recordStack->addInstantRecord(createRecordForEvent(event, TimelineReco rdType::BeginFrame, JSONObject::create())); |
897 } | 902 } |
898 | 903 |
899 void InspectorTimelineAgent::onPaintSetupBegin(const TraceEventDispatcher::Trace Event& event) | 904 void InspectorTimelineAgent::onPaintSetupBegin(const TraceEventDispatcher::Trace Event& event) |
900 { | 905 { |
901 ASSERT(!m_paintSetupStart); | 906 ASSERT(!m_paintSetupStart); |
902 m_paintSetupStart = event.timestamp() * msPerSecond; | 907 m_paintSetupStart = event.timestamp() * msPerSecond; |
903 } | 908 } |
904 | 909 |
905 void InspectorTimelineAgent::onPaintSetupEnd(const TraceEventDispatcher::TraceEv ent& event) | 910 void InspectorTimelineAgent::onPaintSetupEnd(const TraceEventDispatcher::TraceEv ent& event) |
906 { | 911 { |
907 ASSERT(m_paintSetupStart); | 912 ASSERT(m_paintSetupStart); |
908 m_paintSetupEnd = event.timestamp() * msPerSecond; | 913 m_paintSetupEnd = event.timestamp() * msPerSecond; |
909 } | 914 } |
910 | 915 |
911 void InspectorTimelineAgent::onRasterTaskBegin(const TraceEventDispatcher::Trace Event& event) | 916 void InspectorTimelineAgent::onRasterTaskBegin(const TraceEventDispatcher::Trace Event& event) |
912 { | 917 { |
913 TimelineThreadState& state = threadState(event.threadIdentifier()); | 918 TimelineThreadState& state = threadState(event.threadIdentifier()); |
914 unsigned long long layerId = event.asUInt(InstrumentationEventArguments::Lay erId); | 919 unsigned long long layerId = event.asUInt(InstrumentationEventArguments::Lay erId); |
915 ASSERT(layerId); | 920 ASSERT(layerId); |
916 if (!m_layerToNodeMap.contains(layerId)) | 921 if (!m_layerToNodeMap.contains(layerId)) |
917 return; | 922 return; |
918 ASSERT(!state.inKnownLayerTask); | 923 ASSERT(!state.inKnownLayerTask); |
919 state.inKnownLayerTask = true; | 924 state.inKnownLayerTask = true; |
920 double timestamp = event.timestamp() * msPerSecond; | 925 double timestamp = event.timestamp() * msPerSecond; |
921 RefPtr<JSONObject> data = TimelineRecordFactory::createLayerData(m_layerToNo deMap.get(layerId)); | 926 RefPtr<JSONObject> data = TimelineRecordFactory::createLayerData(m_layerToNo deMap.get(layerId)); |
922 RefPtr<TimelineEvent> record = TimelineRecordFactory::createBackgroundRecord (timestamp, String::number(event.threadIdentifier()), TimelineRecordType::Raster ize, data); | 927 RefPtr<TimelineEvent> record = TimelineRecordFactory::createBackgroundRecord (timestamp, String::number(event.threadIdentifier()), TimelineRecordType::Raster ize, data); |
923 state.recordStack.addScopedRecord(record, TimelineRecordType::Rasterize); | 928 state.recordStack->addScopedRecord(record, TimelineRecordType::Rasterize); |
924 } | 929 } |
925 | 930 |
926 void InspectorTimelineAgent::onRasterTaskEnd(const TraceEventDispatcher::TraceEv ent& event) | 931 void InspectorTimelineAgent::onRasterTaskEnd(const TraceEventDispatcher::TraceEv ent& event) |
927 { | 932 { |
928 TimelineThreadState& state = threadState(event.threadIdentifier()); | 933 TimelineThreadState& state = threadState(event.threadIdentifier()); |
929 if (!state.inKnownLayerTask) | 934 if (!state.inKnownLayerTask) |
930 return; | 935 return; |
931 ASSERT(state.recordStack.isOpenRecordOfType(TimelineRecordType::Rasterize)); | 936 ASSERT(state.recordStack->isOpenRecordOfType(TimelineRecordType::Rasterize)) ; |
932 state.recordStack.closeScopedRecord(event.timestamp() * msPerSecond); | 937 state.recordStack->closeScopedRecord(event.timestamp() * msPerSecond); |
933 state.inKnownLayerTask = false; | 938 state.inKnownLayerTask = false; |
934 } | 939 } |
935 | 940 |
936 void InspectorTimelineAgent::onImageDecodeBegin(const TraceEventDispatcher::Trac eEvent& event) | 941 void InspectorTimelineAgent::onImageDecodeBegin(const TraceEventDispatcher::Trac eEvent& event) |
937 { | 942 { |
938 TimelineThreadState& state = threadState(event.threadIdentifier()); | 943 TimelineThreadState& state = threadState(event.threadIdentifier()); |
939 if (!state.decodedPixelRefId && !state.inKnownLayerTask) | 944 if (!state.decodedPixelRefId && !state.inKnownLayerTask) |
940 return; | 945 return; |
941 TimelineImageInfo imageInfo; | 946 TimelineImageInfo imageInfo; |
942 if (state.decodedPixelRefId) { | 947 if (state.decodedPixelRefId) { |
943 PixelRefToImageInfoMap::const_iterator it = m_pixelRefToImageInfo.find(s tate.decodedPixelRefId); | 948 PixelRefToImageInfoMap::const_iterator it = m_pixelRefToImageInfo.find(s tate.decodedPixelRefId); |
944 if (it != m_pixelRefToImageInfo.end()) | 949 if (it != m_pixelRefToImageInfo.end()) |
945 imageInfo = it->value; | 950 imageInfo = it->value; |
946 else | 951 else |
947 ASSERT_NOT_REACHED(); | 952 ASSERT_NOT_REACHED(); |
948 } | 953 } |
949 RefPtr<JSONObject> data = JSONObject::create(); | 954 RefPtr<JSONObject> data = JSONObject::create(); |
950 TimelineRecordFactory::setImageDetails(data.get(), imageInfo.backendNodeId, imageInfo.url); | 955 TimelineRecordFactory::setImageDetails(data.get(), imageInfo.backendNodeId, imageInfo.url); |
951 double timeestamp = event.timestamp() * msPerSecond; | 956 double timeestamp = event.timestamp() * msPerSecond; |
952 state.recordStack.addScopedRecord(TimelineRecordFactory::createBackgroundRec ord(timeestamp, String::number(event.threadIdentifier()), TimelineRecordType::De codeImage, data), TimelineRecordType::DecodeImage); | 957 state.recordStack->addScopedRecord(TimelineRecordFactory::createBackgroundRe cord(timeestamp, String::number(event.threadIdentifier()), TimelineRecordType::D ecodeImage, data), TimelineRecordType::DecodeImage); |
953 } | 958 } |
954 | 959 |
955 void InspectorTimelineAgent::onImageDecodeEnd(const TraceEventDispatcher::TraceE vent& event) | 960 void InspectorTimelineAgent::onImageDecodeEnd(const TraceEventDispatcher::TraceE vent& event) |
956 { | 961 { |
957 TimelineThreadState& state = threadState(event.threadIdentifier()); | 962 TimelineThreadState& state = threadState(event.threadIdentifier()); |
958 if (!state.decodedPixelRefId) | 963 if (!state.decodedPixelRefId) |
959 return; | 964 return; |
960 ASSERT(state.recordStack.isOpenRecordOfType(TimelineRecordType::DecodeImage) ); | 965 ASSERT(state.recordStack->isOpenRecordOfType(TimelineRecordType::DecodeImage )); |
961 state.recordStack.closeScopedRecord(event.timestamp() * msPerSecond); | 966 state.recordStack->closeScopedRecord(event.timestamp() * msPerSecond); |
962 } | 967 } |
963 | 968 |
964 void InspectorTimelineAgent::onRequestMainThreadFrame(const TraceEventDispatcher ::TraceEvent& event) | 969 void InspectorTimelineAgent::onRequestMainThreadFrame(const TraceEventDispatcher ::TraceEvent& event) |
965 { | 970 { |
966 unsigned long long layerTreeId = event.asUInt(InstrumentationEventArguments: :LayerTreeId); | 971 unsigned long long layerTreeId = event.asUInt(InstrumentationEventArguments: :LayerTreeId); |
967 if (layerTreeId != m_layerTreeId) | 972 if (layerTreeId != m_layerTreeId) |
968 return; | 973 return; |
969 TimelineThreadState& state = threadState(event.threadIdentifier()); | 974 TimelineThreadState& state = threadState(event.threadIdentifier()); |
970 state.recordStack.addInstantRecord(createRecordForEvent(event, TimelineRecor dType::RequestMainThreadFrame, JSONObject::create())); | 975 state.recordStack->addInstantRecord(createRecordForEvent(event, TimelineReco rdType::RequestMainThreadFrame, JSONObject::create())); |
971 } | 976 } |
972 | 977 |
973 void InspectorTimelineAgent::onActivateLayerTree(const TraceEventDispatcher::Tra ceEvent& event) | 978 void InspectorTimelineAgent::onActivateLayerTree(const TraceEventDispatcher::Tra ceEvent& event) |
974 { | 979 { |
975 unsigned long long layerTreeId = event.asUInt(InstrumentationEventArguments: :LayerTreeId); | 980 unsigned long long layerTreeId = event.asUInt(InstrumentationEventArguments: :LayerTreeId); |
976 if (layerTreeId != m_layerTreeId) | 981 if (layerTreeId != m_layerTreeId) |
977 return; | 982 return; |
978 unsigned long long frameId = event.asUInt(InstrumentationEventArguments::Fra meId); | 983 unsigned long long frameId = event.asUInt(InstrumentationEventArguments::Fra meId); |
979 TimelineThreadState& state = threadState(event.threadIdentifier()); | 984 TimelineThreadState& state = threadState(event.threadIdentifier()); |
980 state.recordStack.addInstantRecord(createRecordForEvent(event, TimelineRecor dType::ActivateLayerTree, TimelineRecordFactory::createFrameData(frameId))); | 985 state.recordStack->addInstantRecord(createRecordForEvent(event, TimelineReco rdType::ActivateLayerTree, TimelineRecordFactory::createFrameData(frameId))); |
981 } | 986 } |
982 | 987 |
983 void InspectorTimelineAgent::onDrawFrame(const TraceEventDispatcher::TraceEvent& event) | 988 void InspectorTimelineAgent::onDrawFrame(const TraceEventDispatcher::TraceEvent& event) |
984 { | 989 { |
985 unsigned long long layerTreeId = event.asUInt(InstrumentationEventArguments: :LayerTreeId); | 990 unsigned long long layerTreeId = event.asUInt(InstrumentationEventArguments: :LayerTreeId); |
986 if (layerTreeId != m_layerTreeId) | 991 if (layerTreeId != m_layerTreeId) |
987 return; | 992 return; |
988 TimelineThreadState& state = threadState(event.threadIdentifier()); | 993 TimelineThreadState& state = threadState(event.threadIdentifier()); |
989 state.recordStack.addInstantRecord(createRecordForEvent(event, TimelineRecor dType::DrawFrame, JSONObject::create())); | 994 state.recordStack->addInstantRecord(createRecordForEvent(event, TimelineReco rdType::DrawFrame, JSONObject::create())); |
990 } | 995 } |
991 | 996 |
992 void InspectorTimelineAgent::onLayerDeleted(const TraceEventDispatcher::TraceEve nt& event) | 997 void InspectorTimelineAgent::onLayerDeleted(const TraceEventDispatcher::TraceEve nt& event) |
993 { | 998 { |
994 unsigned long long id = event.id(); | 999 unsigned long long id = event.id(); |
995 ASSERT(id); | 1000 ASSERT(id); |
996 m_layerToNodeMap.remove(id); | 1001 m_layerToNodeMap.remove(id); |
997 } | 1002 } |
998 | 1003 |
999 void InspectorTimelineAgent::onDecodeLazyPixelRefBegin(const TraceEventDispatche r::TraceEvent& event) | 1004 void InspectorTimelineAgent::onDecodeLazyPixelRefBegin(const TraceEventDispatche r::TraceEvent& event) |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1044 } | 1049 } |
1045 } | 1050 } |
1046 } | 1051 } |
1047 | 1052 |
1048 void InspectorTimelineAgent::onEmbedderCallbackBegin(const TraceEventDispatcher: :TraceEvent& event) | 1053 void InspectorTimelineAgent::onEmbedderCallbackBegin(const TraceEventDispatcher: :TraceEvent& event) |
1049 { | 1054 { |
1050 TimelineThreadState& state = threadState(event.threadIdentifier()); | 1055 TimelineThreadState& state = threadState(event.threadIdentifier()); |
1051 double timestamp = event.timestamp() * msPerSecond; | 1056 double timestamp = event.timestamp() * msPerSecond; |
1052 RefPtr<JSONObject> data = TimelineRecordFactory::createEmbedderCallbackData( event.asString(InstrumentationEventArguments::CallbackName)); | 1057 RefPtr<JSONObject> data = TimelineRecordFactory::createEmbedderCallbackData( event.asString(InstrumentationEventArguments::CallbackName)); |
1053 RefPtr<TimelineEvent> record = TimelineRecordFactory::createGenericRecord(ti mestamp, 0, TimelineRecordType::EmbedderCallback, data); | 1058 RefPtr<TimelineEvent> record = TimelineRecordFactory::createGenericRecord(ti mestamp, 0, TimelineRecordType::EmbedderCallback, data); |
1054 state.recordStack.addScopedRecord(record, TimelineRecordType::EmbedderCallba ck); | 1059 state.recordStack->addScopedRecord(record, TimelineRecordType::EmbedderCallb ack); |
1055 } | 1060 } |
1056 | 1061 |
1057 void InspectorTimelineAgent::onEmbedderCallbackEnd(const TraceEventDispatcher::T raceEvent& event) | 1062 void InspectorTimelineAgent::onEmbedderCallbackEnd(const TraceEventDispatcher::T raceEvent& event) |
1058 { | 1063 { |
1059 TimelineThreadState& state = threadState(event.threadIdentifier()); | 1064 TimelineThreadState& state = threadState(event.threadIdentifier()); |
1060 state.recordStack.closeScopedRecord(event.timestamp() * msPerSecond); | 1065 state.recordStack->closeScopedRecord(event.timestamp() * msPerSecond); |
1061 } | 1066 } |
1062 | 1067 |
1063 void InspectorTimelineAgent::addRecordToTimeline(PassRefPtr<TimelineEvent> recor d, double ts) | 1068 void InspectorTimelineAgent::addRecordToTimeline(PassRefPtr<TimelineEvent> recor d, double ts) |
1064 { | 1069 { |
1065 commitFrameRecord(); | 1070 commitFrameRecord(); |
1066 innerAddRecordToTimeline(record); | 1071 innerAddRecordToTimeline(record); |
1067 if (m_bufferedEvents && ts - m_lastProgressTimestamp > 300) { | 1072 if (m_bufferedEvents && ts - m_lastProgressTimestamp > 300) { |
1068 m_lastProgressTimestamp = ts; | 1073 m_lastProgressTimestamp = ts; |
1069 m_frontend->progress(m_bufferedEvents->length()); | 1074 m_frontend->progress(m_bufferedEvents->length()); |
1070 } | 1075 } |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1201 if (hasLowLevelDetails && !m_platformInstrumentationClientInstalledAtStackDe pth && !PlatformInstrumentation::hasClient()) { | 1206 if (hasLowLevelDetails && !m_platformInstrumentationClientInstalledAtStackDe pth && !PlatformInstrumentation::hasClient()) { |
1202 m_platformInstrumentationClientInstalledAtStackDepth = m_recordStack.siz e(); | 1207 m_platformInstrumentationClientInstalledAtStackDepth = m_recordStack.siz e(); |
1203 PlatformInstrumentation::setClient(this); | 1208 PlatformInstrumentation::setClient(this); |
1204 } | 1209 } |
1205 } | 1210 } |
1206 | 1211 |
1207 TimelineThreadState& InspectorTimelineAgent::threadState(ThreadIdentifier thread ) | 1212 TimelineThreadState& InspectorTimelineAgent::threadState(ThreadIdentifier thread ) |
1208 { | 1213 { |
1209 ThreadStateMap::iterator it = m_threadStates.find(thread); | 1214 ThreadStateMap::iterator it = m_threadStates.find(thread); |
1210 if (it != m_threadStates.end()) | 1215 if (it != m_threadStates.end()) |
1211 return it->value; | 1216 return *(it->value); |
1212 return m_threadStates.add(thread, TimelineThreadState(this)).storedValue->va lue; | 1217 return *(m_threadStates.add(thread, adoptPtrWillBeNoop(new TimelineThreadSta te(this))).storedValue->value); |
1213 } | 1218 } |
1214 | 1219 |
1215 void InspectorTimelineAgent::commitFrameRecord() | 1220 void InspectorTimelineAgent::commitFrameRecord() |
1216 { | 1221 { |
1217 if (!m_pendingFrameRecord) | 1222 if (!m_pendingFrameRecord) |
1218 return; | 1223 return; |
1219 innerAddRecordToTimeline(m_pendingFrameRecord.release()); | 1224 innerAddRecordToTimeline(m_pendingFrameRecord.release()); |
1220 } | 1225 } |
1221 | 1226 |
1222 void InspectorTimelineAgent::clearRecordStack() | 1227 void InspectorTimelineAgent::clearRecordStack() |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1310 m_stack.last().children->addItem(record); | 1315 m_stack.last().children->addItem(record); |
1311 } | 1316 } |
1312 | 1317 |
1313 #ifndef NDEBUG | 1318 #ifndef NDEBUG |
1314 bool TimelineRecordStack::isOpenRecordOfType(const String& type) | 1319 bool TimelineRecordStack::isOpenRecordOfType(const String& type) |
1315 { | 1320 { |
1316 return !m_stack.isEmpty() && m_stack.last().type == type; | 1321 return !m_stack.isEmpty() && m_stack.last().type == type; |
1317 } | 1322 } |
1318 #endif | 1323 #endif |
1319 | 1324 |
1325 void TimelineRecordStack::trace(Visitor* visitor) | |
1326 { | |
1327 visitor->trace(m_timelineAgent); | |
1328 } | |
1329 | |
1330 void TimelineThreadState::trace(Visitor* visitor) | |
1331 { | |
1332 visitor->trace(recordStack); | |
1333 } | |
1334 | |
1320 } // namespace WebCore | 1335 } // namespace WebCore |
1321 | 1336 |
OLD | NEW |