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 1042 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1053 | 1053 |
1054 static size_t getUsedHeapSize() | 1054 static size_t getUsedHeapSize() |
1055 { | 1055 { |
1056 HeapInfo info; | 1056 HeapInfo info; |
1057 ScriptGCEvent::getHeapSize(info); | 1057 ScriptGCEvent::getHeapSize(info); |
1058 return info.usedJSHeapSize; | 1058 return info.usedJSHeapSize; |
1059 } | 1059 } |
1060 | 1060 |
1061 void InspectorTimelineAgent::setCounters(TimelineEvent* record) | 1061 void InspectorTimelineAgent::setCounters(TimelineEvent* record) |
1062 { | 1062 { |
1063 record->setUsedHeapSize(getUsedHeapSize()); | 1063 if (!m_state->getBoolean(TimelineAgentState::includeCounters)) |
1064 | 1064 return; |
1065 if (m_state->getBoolean(TimelineAgentState::includeCounters) && m_inspectorT
ype == PageInspector) { | 1065 RefPtr<TypeBuilder::Timeline::Counters> counters = TypeBuilder::Timeline::Co
unters::create(); |
1066 RefPtr<TypeBuilder::Timeline::Counters> counters = TypeBuilder::Timeline
::Counters::create(); | 1066 if (m_inspectorType == PageInspector) { |
1067 counters->setDocuments(InspectorCounters::counterValue(InspectorCounters
::DocumentCounter)); | 1067 counters->setDocuments(InspectorCounters::counterValue(InspectorCounters
::DocumentCounter)); |
1068 counters->setNodes(InspectorCounters::counterValue(InspectorCounters::No
deCounter)); | 1068 counters->setNodes(InspectorCounters::counterValue(InspectorCounters::No
deCounter)); |
1069 counters->setJsEventListeners(InspectorCounters::counterValue(InspectorC
ounters::JSEventListenerCounter)); | 1069 counters->setJsEventListeners(InspectorCounters::counterValue(InspectorC
ounters::JSEventListenerCounter)); |
1070 record->setCounters(counters.release()); | |
1071 } | 1070 } |
| 1071 counters->setJsHeapSizeUsed(static_cast<double>(getUsedHeapSize())); |
| 1072 record->setCounters(counters.release()); |
1072 } | 1073 } |
1073 | 1074 |
1074 void InspectorTimelineAgent::setFrameIdentifier(TimelineEvent* record, Frame* fr
ame) | 1075 void InspectorTimelineAgent::setFrameIdentifier(TimelineEvent* record, Frame* fr
ame) |
1075 { | 1076 { |
1076 if (!frame || !m_pageAgent) | 1077 if (!frame || !m_pageAgent) |
1077 return; | 1078 return; |
1078 String frameId; | 1079 String frameId; |
1079 if (frame && m_pageAgent) | 1080 if (frame && m_pageAgent) |
1080 frameId = m_pageAgent->frameId(frame); | 1081 frameId = m_pageAgent->frameId(frame); |
1081 record->setFrameId(frameId); | 1082 record->setFrameId(frameId); |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1270 | 1271 |
1271 #ifndef NDEBUG | 1272 #ifndef NDEBUG |
1272 bool TimelineRecordStack::isOpenRecordOfType(const String& type) | 1273 bool TimelineRecordStack::isOpenRecordOfType(const String& type) |
1273 { | 1274 { |
1274 return !m_stack.isEmpty() && m_stack.last().type == type; | 1275 return !m_stack.isEmpty() && m_stack.last().type == type; |
1275 } | 1276 } |
1276 #endif | 1277 #endif |
1277 | 1278 |
1278 } // namespace WebCore | 1279 } // namespace WebCore |
1279 | 1280 |
OLD | NEW |