| 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 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 { |
| 161 DISALLOW_ALLOCATION(); |
| 161 private: | 162 private: |
| 162 struct Entry { | 163 struct Entry { |
| 163 Entry(PassRefPtr<TimelineEvent> record, const String& type) | 164 Entry(PassRefPtr<TimelineEvent> record, const String& type) |
| 164 : record(record) | 165 : record(record) |
| 165 , children(TypeBuilder::Array<TimelineEvent>::create()) | 166 , children(TypeBuilder::Array<TimelineEvent>::create()) |
| 166 #if ENABLE(ASSERT) | 167 #if ENABLE(ASSERT) |
| 167 , type(type) | 168 , type(type) |
| 168 #endif | 169 #endif |
| 169 { | 170 { |
| 170 } | 171 } |
| 171 | 172 |
| 172 RefPtr<TimelineEvent> record; | 173 RefPtr<TimelineEvent> record; |
| 173 RefPtr<TypeBuilder::Array<TimelineEvent> > children; | 174 RefPtr<TypeBuilder::Array<TimelineEvent> > children; |
| 174 #if ENABLE(ASSERT) | 175 #if ENABLE(ASSERT) |
| 175 String type; | 176 String type; |
| 176 #endif | 177 #endif |
| 177 }; | 178 }; |
| 178 | 179 |
| 179 public: | 180 public: |
| 180 TimelineRecordStack() : m_timelineAgent(0) { } | 181 TimelineRecordStack() : m_timelineAgent(nullptr) { } |
| 181 TimelineRecordStack(InspectorTimelineAgent*); | 182 explicit TimelineRecordStack(InspectorTimelineAgent*); |
| 182 | 183 |
| 183 void addScopedRecord(PassRefPtr<TimelineEvent> record, const String& type); | 184 void addScopedRecord(PassRefPtr<TimelineEvent> record, const String& type); |
| 184 void closeScopedRecord(double endTime); | 185 void closeScopedRecord(double endTime); |
| 185 void addInstantRecord(PassRefPtr<TimelineEvent> record); | 186 void addInstantRecord(PassRefPtr<TimelineEvent> record); |
| 186 | 187 |
| 187 #if ENABLE(ASSERT) | 188 #if ENABLE(ASSERT) |
| 188 bool isOpenRecordOfType(const String& type); | 189 bool isOpenRecordOfType(const String& type); |
| 189 #endif | 190 #endif |
| 190 | 191 |
| 192 void trace(Visitor*); |
| 193 |
| 191 private: | 194 private: |
| 192 void send(PassRefPtr<JSONObject>); | 195 void send(PassRefPtr<JSONObject>); |
| 193 | 196 |
| 194 InspectorTimelineAgent* m_timelineAgent; | 197 RawPtrWillBeMember<InspectorTimelineAgent> m_timelineAgent; |
| 195 Vector<Entry> m_stack; | 198 Vector<Entry> m_stack; |
| 196 }; | 199 }; |
| 197 | 200 |
| 198 struct TimelineThreadState { | 201 struct TimelineThreadState { |
| 202 ALLOW_ONLY_INLINE_ALLOCATION(); |
| 203 public: |
| 199 TimelineThreadState() { } | 204 TimelineThreadState() { } |
| 200 | 205 |
| 201 TimelineThreadState(InspectorTimelineAgent* timelineAgent) | 206 TimelineThreadState(InspectorTimelineAgent* timelineAgent) |
| 202 : recordStack(timelineAgent) | 207 : recordStack(timelineAgent) |
| 203 , inKnownLayerTask(false) | 208 , inKnownLayerTask(false) |
| 204 , decodedPixelRefId(0) | 209 , decodedPixelRefId(0) |
| 205 { | 210 { |
| 206 } | 211 } |
| 207 | 212 |
| 213 void trace(Visitor*); |
| 214 |
| 208 TimelineRecordStack recordStack; | 215 TimelineRecordStack recordStack; |
| 209 bool inKnownLayerTask; | 216 bool inKnownLayerTask; |
| 210 unsigned long long decodedPixelRefId; | 217 unsigned long long decodedPixelRefId; |
| 211 }; | 218 }; |
| 212 | 219 |
| 213 struct TimelineImageInfo { | 220 struct TimelineImageInfo { |
| 214 int backendNodeId; | 221 int backendNodeId; |
| 215 String url; | 222 String url; |
| 216 | 223 |
| 217 TimelineImageInfo() : backendNodeId(0) { } | 224 TimelineImageInfo() : backendNodeId(0) { } |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 258 } | 265 } |
| 259 | 266 |
| 260 InspectorTimelineAgent::~InspectorTimelineAgent() | 267 InspectorTimelineAgent::~InspectorTimelineAgent() |
| 261 { | 268 { |
| 262 } | 269 } |
| 263 | 270 |
| 264 void InspectorTimelineAgent::trace(Visitor* visitor) | 271 void InspectorTimelineAgent::trace(Visitor* visitor) |
| 265 { | 272 { |
| 266 visitor->trace(m_pageAgent); | 273 visitor->trace(m_pageAgent); |
| 267 visitor->trace(m_layerTreeAgent); | 274 visitor->trace(m_layerTreeAgent); |
| 275 visitor->trace(m_threadStates); |
| 268 InspectorBaseAgent::trace(visitor); | 276 InspectorBaseAgent::trace(visitor); |
| 269 } | 277 } |
| 270 | 278 |
| 271 void InspectorTimelineAgent::setFrontend(InspectorFrontend* frontend) | 279 void InspectorTimelineAgent::setFrontend(InspectorFrontend* frontend) |
| 272 { | 280 { |
| 273 m_frontend = frontend->timeline(); | 281 m_frontend = frontend->timeline(); |
| 274 } | 282 } |
| 275 | 283 |
| 276 void InspectorTimelineAgent::clearFrontend() | 284 void InspectorTimelineAgent::clearFrontend() |
| 277 { | 285 { |
| (...skipping 1030 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1308 m_stack.last().children->addItem(record); | 1316 m_stack.last().children->addItem(record); |
| 1309 } | 1317 } |
| 1310 | 1318 |
| 1311 #if ENABLE(ASSERT) | 1319 #if ENABLE(ASSERT) |
| 1312 bool TimelineRecordStack::isOpenRecordOfType(const String& type) | 1320 bool TimelineRecordStack::isOpenRecordOfType(const String& type) |
| 1313 { | 1321 { |
| 1314 return !m_stack.isEmpty() && m_stack.last().type == type; | 1322 return !m_stack.isEmpty() && m_stack.last().type == type; |
| 1315 } | 1323 } |
| 1316 #endif | 1324 #endif |
| 1317 | 1325 |
| 1326 void TimelineRecordStack::trace(Visitor* visitor) |
| 1327 { |
| 1328 visitor->trace(m_timelineAgent); |
| 1329 } |
| 1330 |
| 1331 void TimelineThreadState::trace(Visitor* visitor) |
| 1332 { |
| 1333 visitor->trace(recordStack); |
| 1334 } |
| 1335 |
| 1318 } // namespace blink | 1336 } // namespace blink |
| 1319 | 1337 |
| OLD | NEW |