Changeset 211360 in webkit
- Timestamp:
- Jan 30, 2017 2:14:36 AM (7 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r211358 r211360 1 2017-01-30 Carlos Garcia Campos <cgarcia@igalia.com> 2 3 Several web timing tests crash in GTK+ and AppleWin bots 4 https://bugs.webkit.org/show_bug.cgi?id=167577 5 6 Reviewed by Ryosuke Niwa. 7 8 The problem is that entry is used in both the key, to get name, and in the value with WTFMove. So, the name is 9 invalidated by the move. It could be fixed by simply copying the name, instead of using entry->name, but I think 10 that code could be simplified using HashMap::ensure and then we don't need any string copy, nor even the static 11 insertPerformanceEntry(). 12 13 Fix crashes in several imported/w3c/web-platform-tests/user-timing/ tests. 14 15 * page/PerformanceUserTiming.cpp: 16 (WebCore::UserTiming::mark): 17 (WebCore::UserTiming::measure): 18 (WebCore::insertPerformanceEntry): Deleted. 19 1 20 2017-01-30 Carlos Garcia Campos <cgarcia@igalia.com> 2 21 -
trunk/Source/WebCore/page/PerformanceUserTiming.cpp
r211332 r211360 89 89 } 90 90 91 static void insertPerformanceEntry(PerformanceEntryMap& performanceEntryMap, Ref<PerformanceEntry>&& performanceEntry)92 {93 RefPtr<PerformanceEntry> entry = WTFMove(performanceEntry);94 auto it = performanceEntryMap.find(entry->name());95 if (it != performanceEntryMap.end())96 it->value.append(WTFMove(entry));97 else98 performanceEntryMap.set(entry->name(), Vector<RefPtr<PerformanceEntry>> { WTFMove(entry) });99 }100 101 91 static void clearPerformanceEntries(PerformanceEntryMap& performanceEntryMap, const String& name) 102 92 { … … 114 104 return Exception { SYNTAX_ERR }; 115 105 116 insertPerformanceEntry(m_marksMap, PerformanceMark::create(markName, m_performance.now())); 106 auto& performanceEntryList = m_marksMap.ensure(markName, [] { return Vector<RefPtr<PerformanceEntry>>(); }).iterator->value; 107 performanceEntryList.append(PerformanceMark::create(markName, m_performance.now())); 108 117 109 return { }; 118 110 } … … 162 154 } 163 155 164 insertPerformanceEntry(m_measuresMap, PerformanceMeasure::create(measureName, startTime, endTime)); 156 auto& performanceEntryList = m_measuresMap.ensure(measureName, [] { return Vector<RefPtr<PerformanceEntry>>(); }).iterator->value; 157 performanceEntryList.append(PerformanceMeasure::create(measureName, startTime, endTime)); 158 165 159 return { }; 166 160 }
Note: See TracChangeset
for help on using the changeset viewer.