Changeset 132147 in webkit
- Timestamp:
- Oct 22, 2012 3:36:59 PM (11 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r132146 r132147 1 2012-10-22 Pan Deng <pan.deng@intel.com> 2 3 [User Timing]Integrate with Perforamnce Timeline. 4 https://bugs.webkit.org/show_bug.cgi?id=91072. 5 6 Reviewed by Tony Gentilcore. 7 8 This patch expose user timing entries via performance timeline interface. JavaScriptCore custom binding will be another patch 9 10 No new tests, user timing test cases have been landed. 11 12 * page/Performance.cpp: 13 (WebCore::Performance::Performance): 14 (WebCore::Performance::webkitGetEntries): 15 (WebCore::Performance::webkitGetEntriesByType): 16 (WebCore::Performance::webkitGetEntriesByName): 17 * page/PerformanceEntry.h: 18 (WebCore::PerformanceEntry::startTimeCompareLessThan): 19 (PerformanceEntry): 20 * page/PerformanceEntryList.cpp: 21 (WebCore::PerformanceEntryList::sort): 22 (WebCore): 23 * page/PerformanceEntryList.h: 24 (PerformanceEntryList): 25 * page/PerformanceUserTiming.cpp: 26 (WebCore::convertToEntrySequence): 27 (WebCore): 28 (WebCore::getEntrySequenceByName): 29 (WebCore::UserTiming::getMarks): 30 (WebCore::UserTiming::getMeasures): 31 * page/PerformanceUserTiming.h: 32 (UserTiming): 33 1 34 2012-10-22 Pan Deng <pan.deng@intel.com> 2 35 -
trunk/Source/WebCore/page/Performance.cpp
r131829 r132147 58 58 #if ENABLE(RESOURCE_TIMING) 59 59 , m_resourceTimingBufferSize(defaultResourceTimingBufferSize) 60 #endif 60 #endif // ENABLE(RESOURCE_TIMING) 61 #if ENABLE(USER_TIMING) 62 , m_userTiming(0) 63 #endif // ENABLE(USER_TIMING) 61 64 { 62 65 } … … 109 112 #endif // ENABLE(RESOURCE_TIMING) 110 113 111 // FIXME: User Timing entries should be handled here. see https://bugs.webkit.org/show_bug.cgi?id=91072 114 #if ENABLE(USER_TIMING) 115 if (m_userTiming) { 116 entries->appendAll(m_userTiming->getMarks()); 117 entries->appendAll(m_userTiming->getMeasures()); 118 } 119 #endif // ENABLE(USER_TIMING) 120 121 entries->sort(); 112 122 return entries; 113 123 } … … 123 133 #endif // ENABLE(RESOURCE_TIMING) 124 134 125 // FIXME: User Timing entries should be handled here. see https://bugs.webkit.org/show_bug.cgi?id=91072 135 #if ENABLE(USER_TIMING) 136 if (m_userTiming) { 137 if (equalIgnoringCase(entryType, "mark")) 138 entries->appendAll(m_userTiming->getMarks()); 139 else if (equalIgnoringCase(entryType, "measure")) 140 entries->appendAll(m_userTiming->getMeasures()); 141 } 142 #endif // ENABLE(USER_TIMING) 143 144 entries->sort(); 126 145 return entries; 127 146 } … … 138 157 #endif // ENABLE(RESOURCE_TIMING) 139 158 140 // FIXME: User Timing entries should be handled here. see https://bugs.webkit.org/show_bug.cgi?id=91072 159 #if ENABLE(USER_TIMING) 160 if (m_userTiming) { 161 if (entryType.isNull() || equalIgnoringCase(entryType, "mark")) 162 entries->appendAll(m_userTiming->getMarks(name)); 163 if (entryType.isNull() || equalIgnoringCase(entryType, "measure")) 164 entries->appendAll(m_userTiming->getMeasures(name)); 165 } 166 #endif // ENABLE(USER_TIMING) 167 168 entries->sort(); 141 169 return entries; 142 170 } -
trunk/Source/WebCore/page/PerformanceEntry.h
r120962 r132147 1 1 /* 2 2 * Copyright (C) 2012 Google Inc. All rights reserved. 3 * Copyright (C) 2012 Intel Inc. All rights reserved. 3 4 * 4 5 * Redistribution and use in source and binary forms, with or without … … 52 53 virtual bool isResource() { return false; } 53 54 55 static bool startTimeCompareLessThan(PassRefPtr<PerformanceEntry> a, PassRefPtr<PerformanceEntry> b) 56 { 57 return a->startTime() < b->startTime(); 58 } 59 54 60 protected: 55 61 PerformanceEntry(const String& name, const String& entryType, double startTime, double duration); -
trunk/Source/WebCore/page/PerformanceEntryList.cpp
r120962 r132147 1 1 /* 2 2 * Copyright (C) 2012 Google Inc. All rights reserved. 3 * Copyright (C) 2012 Intel Inc. All rights reserved. 3 4 * 4 5 * Redistribution and use in source and binary forms, with or without … … 68 69 } 69 70 71 void PerformanceEntryList::sort() 72 { 73 std::sort(m_entries.begin(), m_entries.end(), PerformanceEntry::startTimeCompareLessThan); 74 } 75 70 76 } // namespace WebCore 71 77 -
trunk/Source/WebCore/page/PerformanceEntryList.h
r120962 r132147 1 1 /* 2 2 * Copyright (C) 2012 Google Inc. All rights reserved. 3 * Copyright (C) 2012 Intel Inc. All rights reserved. 3 4 * 4 5 * Redistribution and use in source and binary forms, with or without … … 54 55 void appendAll(const Vector<RefPtr<PerformanceEntry> >&); 55 56 57 void sort(); 58 56 59 private: 57 60 PerformanceEntryList(); -
trunk/Source/WebCore/page/PerformanceUserTiming.cpp
r132146 r132147 163 163 } 164 164 165 static Vector<RefPtr<PerformanceEntry> > convertToEntrySequence(const PerformanceEntryMap& performanceEntryMap) 166 { 167 Vector<RefPtr<PerformanceEntry> > entries; 168 169 for (PerformanceEntryMap::const_iterator it = performanceEntryMap.begin(); it != performanceEntryMap.end(); ++it) 170 entries.append(it->value); 171 172 return entries; 173 } 174 175 static Vector<RefPtr<PerformanceEntry> > getEntrySequenceByName(const PerformanceEntryMap& performanceEntryMap, const String& name) 176 { 177 Vector<RefPtr<PerformanceEntry> > entries; 178 179 PerformanceEntryMap::const_iterator it = performanceEntryMap.find(name); 180 if (it != performanceEntryMap.end()) 181 entries.append(it->value); 182 183 return entries; 184 } 185 186 Vector<RefPtr<PerformanceEntry> > UserTiming::getMarks() const 187 { 188 return convertToEntrySequence(m_marksMap); 189 } 190 191 Vector<RefPtr<PerformanceEntry> > UserTiming::getMarks(const String& name) const 192 { 193 return getEntrySequenceByName(m_marksMap, name); 194 } 195 196 Vector<RefPtr<PerformanceEntry> > UserTiming::getMeasures() const 197 { 198 return convertToEntrySequence(m_measuresMap); 199 } 200 201 Vector<RefPtr<PerformanceEntry> > UserTiming::getMeasures(const String& name) const 202 { 203 return getEntrySequenceByName(m_measuresMap, name); 204 } 205 165 206 } // namespace WebCore 166 207 -
trunk/Source/WebCore/page/PerformanceUserTiming.h
r132146 r132147 56 56 void clearMeasures(const String& measureName); 57 57 58 Vector<RefPtr<PerformanceEntry> > getMarks() const; 59 Vector<RefPtr<PerformanceEntry> > getMeasures() const; 60 61 Vector<RefPtr<PerformanceEntry> > getMarks(const String& name) const; 62 Vector<RefPtr<PerformanceEntry> > getMeasures(const String& name) const; 63 58 64 private: 59 65 explicit UserTiming(Performance*);
Note: See TracChangeset
for help on using the changeset viewer.