OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 Google Inc. All rights reserved. |
3 * Copyright (C) 2012 Intel Inc. All rights reserved. | 3 * Copyright (C) 2012 Intel Inc. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
7 * met: | 7 * met: |
8 * | 8 * |
9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 if (!m_timing) | 92 if (!m_timing) |
93 m_timing = PerformanceTiming::create(m_frame); | 93 m_timing = PerformanceTiming::create(m_frame); |
94 | 94 |
95 return m_timing.get(); | 95 return m_timing.get(); |
96 } | 96 } |
97 | 97 |
98 PerformanceEntryVector Performance::getEntries() const | 98 PerformanceEntryVector Performance::getEntries() const |
99 { | 99 { |
100 PerformanceEntryVector entries; | 100 PerformanceEntryVector entries; |
101 | 101 |
102 entries.append(m_resourceTimingBuffer); | 102 entries.appendVector(m_resourceTimingBuffer); |
103 | 103 |
104 if (m_userTiming) { | 104 if (m_userTiming) { |
105 entries.append(m_userTiming->getMarks()); | 105 entries.appendVector(m_userTiming->getMarks()); |
106 entries.append(m_userTiming->getMeasures()); | 106 entries.appendVector(m_userTiming->getMeasures()); |
107 } | 107 } |
108 | 108 |
109 std::sort(entries.begin(), entries.end(), PerformanceEntry::startTimeCompare
LessThan); | 109 std::sort(entries.begin(), entries.end(), PerformanceEntry::startTimeCompare
LessThan); |
110 return entries; | 110 return entries; |
111 } | 111 } |
112 | 112 |
113 PerformanceEntryVector Performance::getEntriesByType(const String& entryType) | 113 PerformanceEntryVector Performance::getEntriesByType(const String& entryType) |
114 { | 114 { |
115 PerformanceEntryVector entries; | 115 PerformanceEntryVector entries; |
116 | 116 |
117 if (equalIgnoringCase(entryType, "resource")) | 117 if (equalIgnoringCase(entryType, "resource")) |
118 for (PerformanceEntryVector::const_iterator resource = m_resourceTimingB
uffer.begin(); resource != m_resourceTimingBuffer.end(); ++resource) | 118 for (PerformanceEntryVector::const_iterator resource = m_resourceTimingB
uffer.begin(); resource != m_resourceTimingBuffer.end(); ++resource) |
119 entries.append(*resource); | 119 entries.append(*resource); |
120 | 120 |
121 if (m_userTiming) { | 121 if (m_userTiming) { |
122 if (equalIgnoringCase(entryType, "mark")) | 122 if (equalIgnoringCase(entryType, "mark")) |
123 entries.append(m_userTiming->getMarks()); | 123 entries.appendVector(m_userTiming->getMarks()); |
124 else if (equalIgnoringCase(entryType, "measure")) | 124 else if (equalIgnoringCase(entryType, "measure")) |
125 entries.append(m_userTiming->getMeasures()); | 125 entries.appendVector(m_userTiming->getMeasures()); |
126 } | 126 } |
127 | 127 |
128 std::sort(entries.begin(), entries.end(), PerformanceEntry::startTimeCompare
LessThan); | 128 std::sort(entries.begin(), entries.end(), PerformanceEntry::startTimeCompare
LessThan); |
129 return entries; | 129 return entries; |
130 } | 130 } |
131 | 131 |
132 PerformanceEntryVector Performance::getEntriesByName(const String& name, const S
tring& entryType) | 132 PerformanceEntryVector Performance::getEntriesByName(const String& name, const S
tring& entryType) |
133 { | 133 { |
134 PerformanceEntryVector entries; | 134 PerformanceEntryVector entries; |
135 | 135 |
136 if (entryType.isNull() || equalIgnoringCase(entryType, "resource")) | 136 if (entryType.isNull() || equalIgnoringCase(entryType, "resource")) |
137 for (PerformanceEntryVector::const_iterator resource = m_resourceTimingB
uffer.begin(); resource != m_resourceTimingBuffer.end(); ++resource) | 137 for (PerformanceEntryVector::const_iterator resource = m_resourceTimingB
uffer.begin(); resource != m_resourceTimingBuffer.end(); ++resource) |
138 if ((*resource)->name() == name) | 138 if ((*resource)->name() == name) |
139 entries.append(*resource); | 139 entries.append(*resource); |
140 | 140 |
141 if (m_userTiming) { | 141 if (m_userTiming) { |
142 if (entryType.isNull() || equalIgnoringCase(entryType, "mark")) | 142 if (entryType.isNull() || equalIgnoringCase(entryType, "mark")) |
143 entries.append(m_userTiming->getMarks(name)); | 143 entries.appendVector(m_userTiming->getMarks(name)); |
144 if (entryType.isNull() || equalIgnoringCase(entryType, "measure")) | 144 if (entryType.isNull() || equalIgnoringCase(entryType, "measure")) |
145 entries.append(m_userTiming->getMeasures(name)); | 145 entries.appendVector(m_userTiming->getMeasures(name)); |
146 } | 146 } |
147 | 147 |
148 std::sort(entries.begin(), entries.end(), PerformanceEntry::startTimeCompare
LessThan); | 148 std::sort(entries.begin(), entries.end(), PerformanceEntry::startTimeCompare
LessThan); |
149 return entries; | 149 return entries; |
150 } | 150 } |
151 | 151 |
152 void Performance::webkitClearResourceTimings() | 152 void Performance::webkitClearResourceTimings() |
153 { | 153 { |
154 m_resourceTimingBuffer.clear(); | 154 m_resourceTimingBuffer.clear(); |
155 } | 155 } |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
281 | 281 |
282 void Performance::trace(Visitor* visitor) | 282 void Performance::trace(Visitor* visitor) |
283 { | 283 { |
284 visitor->trace(m_navigation); | 284 visitor->trace(m_navigation); |
285 visitor->trace(m_timing); | 285 visitor->trace(m_timing); |
286 visitor->trace(m_resourceTimingBuffer); | 286 visitor->trace(m_resourceTimingBuffer); |
287 visitor->trace(m_userTiming); | 287 visitor->trace(m_userTiming); |
288 } | 288 } |
289 | 289 |
290 } // namespace WebCore | 290 } // namespace WebCore |
OLD | NEW |