Changeset 120962 in webkit
- Timestamp:
- Jun 21, 2012 2:15:19 PM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 1 added
- 19 edited
- 3 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/CMakeLists.txt
r120957 r120962 397 397 page/PerformanceEntryList.idl 398 398 page/PerformanceNavigation.idl 399 page/PerformanceResourceTiming.idl 399 400 page/PerformanceTiming.idl 400 401 page/Screen.idl … … 1088 1089 page/PerformanceEntryList.cpp 1089 1090 page/PerformanceNavigation.cpp 1091 page/PerformanceResourceTiming.cpp 1090 1092 page/PerformanceTiming.cpp 1091 1093 page/PrintContext.cpp -
trunk/Source/WebCore/ChangeLog
r120960 r120962 1 2012-06-21 James Simonsen <simonjam@chromium.org> 2 3 [Resource Timing] Implement Resource Timing interface 4 https://bugs.webkit.org/show_bug.cgi?id=61152 5 6 This patch implements the Resource Timing interface. It doesn't do anything 7 useful, because nothing populates the timeline yet. There are also some gaps 8 in the implementation, which have been filed as bugs. 9 10 http://dvcs.w3.org/hg/webperf/raw-file/tip/specs/ResourceTiming/Overview.html 11 12 Reviewed by Tony Gentilcore. 13 14 No new tests. Feature is disabled on all platforms. 15 16 * CMakeLists.txt: 17 * DerivedSources.pri: 18 * GNUmakefile.list.am: 19 * Target.pri: 20 * UseV8.cmake: 21 * WebCore.gypi: 22 * WebCore.vcproj/WebCore.vcproj: 23 * WebCore.xcodeproj/project.pbxproj: 24 * bindings/v8/custom/V8PerformanceEntryCustom.cpp: 25 (WebCore): 26 (WebCore::toV8): Support PerformanceEntry polymorphism. 27 * dom/EventNames.h: 28 (WebCore): 29 * dom/EventTargetFactory.in: 30 * page/Performance.cpp: 31 (WebCore::Performance::~Performance): 32 (WebCore): 33 (WebCore::Performance::interfaceName): Reqired for EventTarget. 34 (WebCore::Performance::scriptExecutionContext): Ditto. 35 (WebCore::Performance::webkitGetEntries): Return "resource" entries. 36 (WebCore::Performance::webkitGetEntriesByType): Ditto. 37 (WebCore::Performance::webkitGetEntriesByName): Ditto. 38 (WebCore::Performance::webkitClearResourceTimings): New. 39 (WebCore::Performance::webkitSetResourceTimingBufferSize): New. Unimplemented. 40 (WebCore::Performance::addResourceTiming): This is how resources in WebCore will report to the timeline. 41 (WebCore::Performance::eventTargetData): Required for EventTarget. 42 (WebCore::Performance::ensureEventTargetData): Ditto. 43 * page/Performance.h: 44 (Performance): 45 (WebCore::Performance::refEventTarget): 46 (WebCore::Performance::derefEventTarget): 47 * page/Performance.idl: 48 * page/PerformanceEntry.cpp: 49 (WebCore::PerformanceEntry::~PerformanceEntry): 50 (WebCore): 51 * page/PerformanceEntry.h: 52 (PerformanceEntry): 53 (WebCore::PerformanceEntry::isResource): 54 * page/PerformanceEntry.idl: 55 * page/PerformanceResourceTiming.cpp: Added. 56 (WebCore): 57 (WebCore::PerformanceResourceTiming::PerformanceResourceTiming): 58 (WebCore::PerformanceResourceTiming::initiatorType): 59 (WebCore::PerformanceResourceTiming::redirectStart): 60 (WebCore::PerformanceResourceTiming::redirectEnd): 61 (WebCore::PerformanceResourceTiming::fetchStart): 62 (WebCore::PerformanceResourceTiming::domainLookupStart): 63 (WebCore::PerformanceResourceTiming::domainLookupEnd): 64 (WebCore::PerformanceResourceTiming::connectStart): 65 (WebCore::PerformanceResourceTiming::connectEnd): 66 (WebCore::PerformanceResourceTiming::secureConnectionStart): 67 (WebCore::PerformanceResourceTiming::requestStart): 68 (WebCore::PerformanceResourceTiming::responseStart): 69 (WebCore::PerformanceResourceTiming::responseEnd): 70 (WebCore::PerformanceResourceTiming::monotonicTimeToDocumentMilliseconds): 71 (WebCore::PerformanceResourceTiming::resourceTimeToMilliseconds): 72 * page/PerformanceResourceTiming.h: Added. 73 (WebCore): 74 (PerformanceResourceTiming): 75 (WebCore::PerformanceResourceTiming::create): 76 (WebCore::PerformanceResourceTiming::isResource): 77 * page/PerformanceResourceTiming.idl: Added. 78 1 79 2012-06-21 Hans Wennborg <hans@chromium.org> 2 80 -
trunk/Source/WebCore/DerivedSources.pri
r120957 r120962 426 426 $$PWD/page/PerformanceEntryList.idl \ 427 427 $$PWD/page/PerformanceNavigation.idl \ 428 $$PWD/page/PerformanceResourceTiming.idl \ 428 429 $$PWD/page/PerformanceTiming.idl \ 429 430 $$PWD/page/Screen.idl \ -
trunk/Source/WebCore/GNUmakefile.list.am
r120957 r120962 958 958 $(WebCore)/page/PerformanceEntryList.idl \ 959 959 $(WebCore)/page/PerformanceNavigation.idl \ 960 $(WebCore)/page/PerformanceResourceTiming.idl \ 960 961 $(WebCore)/page/PerformanceTiming.idl \ 961 962 $(WebCore)/page/Screen.idl \ … … 3043 3044 Source/WebCore/page/PerformanceNavigation.cpp \ 3044 3045 Source/WebCore/page/PerformanceNavigation.h \ 3046 Source/WebCore/page/PerformanceResourceTiming.cpp \ 3047 Source/WebCore/page/PerformanceResourceTiming.h \ 3045 3048 Source/WebCore/page/PerformanceTiming.cpp \ 3046 3049 Source/WebCore/page/PerformanceTiming.h \ -
trunk/Source/WebCore/Target.pri
r120929 r120962 209 209 bindings/v8/custom/V8NodeListCustom.cpp \ 210 210 bindings/v8/custom/V8PerformanceCustom.cpp \ 211 bindings/v8/custom/V8PerformanceEntryCustom.cpp \ 211 212 bindings/v8/custom/V8SQLResultSetRowListCustom.cpp \ 212 213 bindings/v8/custom/V8SQLTransactionCustom.cpp \ … … 1051 1052 page/PerformanceEntryList.cpp \ 1052 1053 page/PerformanceNavigation.cpp \ 1054 page/PerformanceResourceTiming.cpp \ 1053 1055 page/PerformanceTiming.cpp \ 1054 1056 page/PrintContext.cpp \ -
trunk/Source/WebCore/UseV8.cmake
r120866 r120962 141 141 bindings/v8/custom/V8NotificationCenterCustom.cpp 142 142 bindings/v8/custom/V8PerformanceCustom.cpp 143 bindings/v8/custom/V8PerformanceEntryCustom.cpp 143 144 bindings/v8/custom/V8PopStateEventCustom.cpp 144 145 bindings/v8/custom/V8SQLResultSetRowListCustom.cpp -
trunk/Source/WebCore/WebCore.gypi
r120957 r120962 1168 1168 'page/PerformanceEntryList.idl', 1169 1169 'page/PerformanceNavigation.idl', 1170 'page/PerformanceResourceTiming.idl', 1170 1171 'page/PerformanceTiming.idl', 1171 1172 'page/PointerLock.idl', … … 2336 2337 'bindings/v8/custom/V8NotificationCenterCustom.cpp', 2337 2338 'bindings/v8/custom/V8PerformanceCustom.cpp', 2339 'bindings/v8/custom/V8PerformanceEntryCustom.cpp', 2338 2340 'bindings/v8/custom/V8PopStateEventCustom.cpp', 2339 2341 'bindings/v8/custom/V8SQLResultSetRowListCustom.cpp', … … 3073 3075 'page/PerformanceNavigation.cpp', 3074 3076 'page/PerformanceNavigation.h', 3077 'page/PerformanceResourceTiming.cpp', 3078 'page/PerformanceResourceTiming.h', 3075 3079 'page/PerformanceTiming.cpp', 3076 3080 'page/PerformanceTiming.h', -
trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj
r120957 r120962 26880 26880 </File> 26881 26881 <File 26882 RelativePath="..\page\PerformanceResourceTiming.cpp" 26883 > 26884 </File> 26885 <File 26886 RelativePath="..\page\PerformanceResourceTiming.h" 26887 > 26888 </File> 26889 <File 26882 26890 RelativePath="..\page\PerformanceTiming.cpp" 26883 26891 > -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r120957 r120962 2899 2899 861C2EA613FB4FFF00062ABB /* ResourceLoadTiming.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 861C2EA513FB4FFF00062ABB /* ResourceLoadTiming.cpp */; }; 2900 2900 86243D0111BC31F700CC006A /* JSArrayBufferViewHelper.h in Headers */ = {isa = PBXBuildFile; fileRef = 86243D0011BC31F700CC006A /* JSArrayBufferViewHelper.h */; }; 2901 86512EDE154A2AEF00A90426 /* PerformanceResourceTiming.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 86512EDB154A2AEE00A90426 /* PerformanceResourceTiming.cpp */; }; 2902 86512EDF154A2AEF00A90426 /* PerformanceResourceTiming.h in Headers */ = {isa = PBXBuildFile; fileRef = 86512EDC154A2AEF00A90426 /* PerformanceResourceTiming.h */; }; 2901 2903 86BE340015058CB200CE0FD8 /* PerformanceEntry.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 86BE33FA15058CB200CE0FD8 /* PerformanceEntry.cpp */; }; 2902 2904 86BE340115058CB200CE0FD8 /* PerformanceEntry.h in Headers */ = {isa = PBXBuildFile; fileRef = 86BE33FB15058CB200CE0FD8 /* PerformanceEntry.h */; }; … … 9961 9963 861C2EA513FB4FFF00062ABB /* ResourceLoadTiming.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ResourceLoadTiming.cpp; sourceTree = "<group>"; }; 9962 9964 86243D0011BC31F700CC006A /* JSArrayBufferViewHelper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSArrayBufferViewHelper.h; sourceTree = "<group>"; }; 9965 86512EDB154A2AEE00A90426 /* PerformanceResourceTiming.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PerformanceResourceTiming.cpp; sourceTree = "<group>"; }; 9966 86512EDC154A2AEF00A90426 /* PerformanceResourceTiming.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PerformanceResourceTiming.h; sourceTree = "<group>"; }; 9967 86512EDD154A2AEF00A90426 /* PerformanceResourceTiming.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = PerformanceResourceTiming.idl; sourceTree = "<group>"; }; 9963 9968 86BE33FA15058CB200CE0FD8 /* PerformanceEntry.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PerformanceEntry.cpp; sourceTree = "<group>"; }; 9964 9969 86BE33FB15058CB200CE0FD8 /* PerformanceEntry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PerformanceEntry.h; sourceTree = "<group>"; }; … … 15620 15625 8AF4E55311DC5A36000ED3DE /* PerformanceNavigation.h */, 15621 15626 8AF4E55411DC5A36000ED3DE /* PerformanceNavigation.idl */, 15627 86512EDB154A2AEE00A90426 /* PerformanceResourceTiming.cpp */, 15628 86512EDC154A2AEF00A90426 /* PerformanceResourceTiming.h */, 15629 86512EDD154A2AEF00A90426 /* PerformanceResourceTiming.idl */, 15622 15630 8AF4E55811DC5A63000ED3DE /* PerformanceTiming.cpp */, 15623 15631 8AF4E55911DC5A63000ED3DE /* PerformanceTiming.h */, … … 24162 24170 86BE340415058CB200CE0FD8 /* PerformanceEntryList.h in Headers */, 24163 24171 8AF4E55611DC5A36000ED3DE /* PerformanceNavigation.h in Headers */, 24172 86512EDF154A2AEF00A90426 /* PerformanceResourceTiming.h in Headers */, 24164 24173 8AF4E55C11DC5A63000ED3DE /* PerformanceTiming.h in Headers */, 24165 24174 49D5DC2E0F423A73008F20FD /* PerspectiveTransformOperation.h in Headers */, … … 27395 27404 86BE340315058CB200CE0FD8 /* PerformanceEntryList.cpp in Sources */, 27396 27405 8AF4E55511DC5A36000ED3DE /* PerformanceNavigation.cpp in Sources */, 27406 86512EDE154A2AEF00A90426 /* PerformanceResourceTiming.cpp in Sources */, 27397 27407 8AF4E55B11DC5A63000ED3DE /* PerformanceTiming.cpp in Sources */, 27398 27408 49D5DC2D0F423A73008F20FD /* PerspectiveTransformOperation.cpp in Sources */, -
trunk/Source/WebCore/bindings/v8/custom/V8PerformanceEntryCustom.cpp
r120960 r120962 30 30 31 31 #include "config.h" 32 #include "PerformanceEntry List.h"32 #include "PerformanceEntry.h" 33 33 34 #if ENABLE( WEB_TIMING) && ENABLE(PERFORMANCE_TIMELINE)34 #if ENABLE(PERFORMANCE_TIMELINE) 35 35 36 #include "PerformanceEntry.h" 36 #include "Performance.h" 37 #include "PerformanceResourceTiming.h" 38 39 #include "V8PerformanceEntry.h" 40 #include "V8PerformanceResourceTiming.h" 41 42 #include <wtf/RefPtr.h> 37 43 38 44 namespace WebCore { 39 45 40 PerformanceEntryList::PerformanceEntryList()46 v8::Handle<v8::Value> toV8(PerformanceEntry* impl, v8::Isolate* isolate) 41 47 { 42 } 48 if (!impl) 49 return v8::Null(); 43 50 44 PerformanceEntryList::~PerformanceEntryList() 45 { 46 } 51 #if ENABLE(RESOURCE_TIMING) 52 if (impl->isResource()) 53 return toV8(static_cast<PerformanceResourceTiming*>(impl), isolate); 54 #endif 47 55 48 unsigned PerformanceEntryList::length() const 49 { 50 return m_entries.size(); 51 } 52 53 PerformanceEntry* PerformanceEntryList::item(unsigned index) 54 { 55 if (index < m_entries.size()) 56 return m_entries[index].get(); 57 return 0; 58 } 59 60 void PerformanceEntryList::append(PassRefPtr<PerformanceEntry> entry) 61 { 62 m_entries.append(entry); 56 return V8PerformanceEntry::wrap(impl); 63 57 } 64 58 65 59 } // namespace WebCore 66 60 67 #endif // ENABLE( WEB_TIMING) && ENABLE(PERFORMANCE_TIMELINE)61 #endif // ENABLE(PERFORMANCE_TIMELINE) -
trunk/Source/WebCore/dom/EventNames.h
r119763 r120962 228 228 macro(webkitnetworkinfochange) \ 229 229 \ 230 macro(webkitresourcetimingbufferfull) \ 231 \ 230 232 231 233 // end of DOM_EVENT_NAMES_FOR_EACH -
trunk/Source/WebCore/dom/EventTargetFactory.in
r112815 r120962 23 23 Notification conditional=NOTIFICATIONS|LEGACY_NOTIFICATIONS 24 24 PeerConnection00 conditional=MEDIA_STREAM 25 Performance conditional=WEB_TIMING 25 26 SharedWorker conditional=SHARED_WORKERS 26 27 SharedWorkerContext conditional=SHARED_WORKERS -
trunk/Source/WebCore/page/Performance.cpp
r115503 r120962 35 35 #include "DocumentLoader.h" 36 36 #include "MemoryInfo.h" 37 #include "PerformanceEntry.h" 37 38 #include "PerformanceNavigation.h" 39 #include "PerformanceResourceTiming.h" 38 40 #include "PerformanceTiming.h" 41 #include "ResourceResponse.h" 39 42 #include <wtf/CurrentTime.h> 40 43 … … 48 51 : DOMWindowProperty(frame) 49 52 { 53 } 54 55 Performance::~Performance() 56 { 57 } 58 59 const AtomicString& Performance::interfaceName() const 60 { 61 return eventNames().interfaceForPerformance; 62 } 63 64 ScriptExecutionContext* Performance::scriptExecutionContext() const 65 { 66 if (!frame()) 67 return 0; 68 return frame()->document(); 50 69 } 51 70 … … 76 95 { 77 96 RefPtr<PerformanceEntryList> entries = PerformanceEntryList::create(); 97 98 #if ENABLE(RESOURCE_TIMING) 99 entries->appendAll(m_resourceTimingBuffer); 100 #endif // ENABLE(RESOURCE_TIMING) 101 78 102 return entries; 79 103 } 80 104 81 PassRefPtr<PerformanceEntryList> Performance::webkitGetEntriesByType(const String& )105 PassRefPtr<PerformanceEntryList> Performance::webkitGetEntriesByType(const String& entryType) 82 106 { 83 107 RefPtr<PerformanceEntryList> entries = PerformanceEntryList::create(); 108 109 #if ENABLE(RESOURCE_TIMING) 110 if (equalIgnoringCase(entryType, "resource")) 111 for (Vector<RefPtr<PerformanceEntry> >::const_iterator resource = m_resourceTimingBuffer.begin(); resource != m_resourceTimingBuffer.end(); ++resource) 112 entries->append(*resource); 113 #endif // ENABLE(RESOURCE_TIMING) 114 84 115 return entries; 85 116 } 86 117 87 PassRefPtr<PerformanceEntryList> Performance::webkitGetEntriesByName(const String& , const String&)118 PassRefPtr<PerformanceEntryList> Performance::webkitGetEntriesByName(const String& name, const String& entryType) 88 119 { 89 120 RefPtr<PerformanceEntryList> entries = PerformanceEntryList::create(); 121 122 #if ENABLE(RESOURCE_TIMING) 123 if (entryType.isNull() || equalIgnoringCase(entryType, "resource")) 124 for (Vector<RefPtr<PerformanceEntry> >::const_iterator resource = m_resourceTimingBuffer.begin(); resource != m_resourceTimingBuffer.end(); ++resource) 125 if ((*resource)->name() == name) 126 entries->append(*resource); 127 #endif // ENABLE(RESOURCE_TIMING) 128 90 129 return entries; 91 130 } 92 131 93 132 #endif // ENABLE(PERFORMANCE_TIMELINE) 133 134 #if ENABLE(RESOURCE_TIMING) 135 136 void Performance::webkitClearResourceTimings() 137 { 138 m_resourceTimingBuffer.clear(); 139 } 140 141 void Performance::webkitSetResourceTimingBufferSize(unsigned int) 142 { 143 // FIXME: Implement this. 144 } 145 146 void Performance::addResourceTiming(const ResourceRequest& request, const ResourceResponse& response, double finishTime, Document* requestingDocument) 147 { 148 if (!response.resourceLoadTiming()) 149 return; 150 151 RefPtr<PerformanceEntry> entry = PerformanceResourceTiming::create(request, response, finishTime, requestingDocument); 152 // FIXME: Need to enforce buffer limits. 153 m_resourceTimingBuffer.append(entry); 154 } 155 156 #endif // ENABLE(RESOURCE_TIMING) 157 158 EventTargetData* Performance::eventTargetData() 159 { 160 return &m_eventTargetData; 161 } 162 163 EventTargetData* Performance::ensureEventTargetData() 164 { 165 return &m_eventTargetData; 166 } 94 167 95 168 double Performance::webkitNow() const -
trunk/Source/WebCore/page/Performance.h
r115503 r120962 35 35 36 36 #include "DOMWindowProperty.h" 37 #include "EventTarget.h" 37 38 #include "MemoryInfo.h" 38 39 #include "PerformanceEntryList.h" … … 46 47 namespace WebCore { 47 48 48 class Performance : public RefCounted<Performance>, public DOMWindowProperty { 49 class Document; 50 class ResourceRequest; 51 class ResourceResponse; 52 53 class Performance : public RefCounted<Performance>, public DOMWindowProperty, public EventTarget { 49 54 public: 50 55 static PassRefPtr<Performance> create(Frame* frame) { return adoptRef(new Performance(frame)); } 56 ~Performance(); 57 58 virtual const AtomicString& interfaceName() const; 59 virtual ScriptExecutionContext* scriptExecutionContext() const; 51 60 52 61 PassRefPtr<MemoryInfo> memory() const; … … 61 70 #endif 62 71 72 #if ENABLE(RESOURCE_TIMING) 73 void webkitClearResourceTimings(); 74 void webkitSetResourceTimingBufferSize(unsigned int); 75 76 DEFINE_ATTRIBUTE_EVENT_LISTENER(webkitresourcetimingbufferfull); 77 78 void addResourceTiming(const ResourceRequest&, const ResourceResponse&, double finishTime, Document*); 79 #endif 80 81 using RefCounted<Performance>::ref; 82 using RefCounted<Performance>::deref; 83 63 84 private: 64 85 explicit Performance(Frame*); 65 86 87 virtual void refEventTarget() { ref(); } 88 virtual void derefEventTarget() { deref(); } 89 virtual EventTargetData* eventTargetData(); 90 virtual EventTargetData* ensureEventTargetData(); 91 92 EventTargetData m_eventTargetData; 93 ScriptExecutionContext *m_scriptExecutionContext; 94 66 95 mutable RefPtr<PerformanceNavigation> m_navigation; 67 96 mutable RefPtr<PerformanceTiming> m_timing; 97 98 #if ENABLE(RESOURCE_TIMING) 99 Vector<RefPtr<PerformanceEntry> > m_resourceTimingBuffer; 100 #endif 68 101 }; 69 102 -
trunk/Source/WebCore/page/Performance.idl
r115503 r120962 34 34 interface [ 35 35 Conditional=WEB_TIMING, 36 EventTarget, 36 37 OmitConstructor 37 38 ] Performance { … … 45 46 PerformanceEntryList webkitGetEntriesByName(in DOMString name, in [Optional=DefaultIsNullString] DOMString entryType); 46 47 #endif 48 49 #if defined(ENABLE_RESOURCE_TIMING) && ENABLE_RESOURCE_TIMING 50 void webkitClearResourceTimings(); 51 void webkitSetResourceTimingBufferSize(in unsigned long maxSize); 52 53 attribute EventListener onwebkitresourcetimingbufferfull; 54 #endif 47 55 // See http://www.w3.org/TR/hr-time/ for details. 48 56 double webkitNow(); -
trunk/Source/WebCore/page/PerformanceEntry.cpp
r115274 r120962 44 44 } 45 45 46 PerformanceEntry::~PerformanceEntry() 47 { 48 } 49 46 50 String PerformanceEntry::name() const 47 51 { -
trunk/Source/WebCore/page/PerformanceEntry.h
r115274 r120962 43 43 class PerformanceEntry : public RefCounted<PerformanceEntry> { 44 44 public: 45 virtual ~PerformanceEntry(); 46 45 47 String name() const; 46 48 String entryType() const; 47 49 double startTime() const; 48 50 double duration() const; 51 52 virtual bool isResource() { return false; } 49 53 50 54 protected: -
trunk/Source/WebCore/page/PerformanceEntry.idl
r115274 r120962 35 35 Conditional=WEB_TIMING, 36 36 Conditional=PERFORMANCE_TIMELINE, 37 CustomToJSObject, 37 38 OmitConstructor 38 39 ] PerformanceEntry { -
trunk/Source/WebCore/page/PerformanceEntryList.cpp
r115274 r120962 63 63 } 64 64 65 void PerformanceEntryList::appendAll(const Vector<RefPtr<PerformanceEntry> >& entries) 66 { 67 m_entries.append(entries); 68 } 69 65 70 } // namespace WebCore 66 71 -
trunk/Source/WebCore/page/PerformanceEntryList.h
r115274 r120962 52 52 53 53 void append(PassRefPtr<PerformanceEntry>); 54 void appendAll(const Vector<RefPtr<PerformanceEntry> >&); 54 55 55 56 private: -
trunk/Source/WebCore/page/PerformanceResourceTiming.h
r120960 r120962 29 29 */ 30 30 31 #ifndef Performance Entry_h32 #define Performance Entry_h31 #ifndef PerformanceResourceTiming_h 32 #define PerformanceResourceTiming_h 33 33 34 #if ENABLE( WEB_TIMING) && ENABLE(PERFORMANCE_TIMELINE)34 #if ENABLE(RESOURCE_TIMING) 35 35 36 #include "Performance .h"36 #include "PerformanceEntry.h" 37 37 #include <wtf/PassRefPtr.h> 38 #include <wtf/Ref Counted.h>38 #include <wtf/RefPtr.h> 39 39 #include <wtf/text/WTFString.h> 40 40 41 41 namespace WebCore { 42 42 43 class PerformanceEntry : public RefCounted<PerformanceEntry> { 43 class Document; 44 class KURL; 45 class ResourceLoadTiming; 46 class ResourceRequest; 47 class ResourceResponse; 48 49 class PerformanceResourceTiming : public PerformanceEntry { 44 50 public: 45 String name() const;46 String entryType() const;47 double startTime() const;48 double duration() const;51 static PassRefPtr<PerformanceResourceTiming> create(const ResourceRequest& request, const ResourceResponse& response, double finishTime, Document* requestingDocument) 52 { 53 return adoptRef(new PerformanceResourceTiming(request, response, finishTime, requestingDocument)); 54 } 49 55 50 protected: 51 PerformanceEntry(const String& name, const String& entryType, double startTime, double duration); 56 String initiatorType() const; 57 58 double redirectStart() const; 59 double redirectEnd() const; 60 double fetchStart() const; 61 double domainLookupStart() const; 62 double domainLookupEnd() const; 63 double connectStart() const; 64 double connectEnd() const; 65 double secureConnectionStart() const; 66 double requestStart() const; 67 double responseStart() const; 68 double responseEnd() const; 69 70 virtual bool isResource() { return true; } 52 71 53 72 private: 54 const String m_name; 55 const String m_entryType; 56 const double m_startTime; 57 const double m_duration; 73 PerformanceResourceTiming(const ResourceRequest&, const ResourceResponse&, double finishTime, Document*); 74 ~PerformanceResourceTiming(); 75 76 double monotonicTimeToDocumentMilliseconds(double seconds) const; 77 double resourceTimeToDocumentMilliseconds(int deltaMilliseconds) const; 78 79 RefPtr<ResourceLoadTiming> m_timing; 80 double m_finishTime; 81 RefPtr<Document> m_requestingDocument; 58 82 }; 59 83 60 84 } 61 85 62 #endif // !ENABLE(WEB_TIMING) && ENABLE(PERFORMANCE_TIMELINE) 63 #endif // !defined(PerformanceEntry_h) 86 #endif // ENABLE(RESOURCE_TIMING) 87 88 #endif // !defined(PerformanceResourceTiming_h) -
trunk/Source/WebCore/page/PerformanceResourceTiming.idl
r120960 r120962 31 31 module window { 32 32 33 // See: https://dvcs.w3.org/hg/webperf/raw-file/tip/specs/ PerformanceTimeline/Overview.html33 // See: https://dvcs.w3.org/hg/webperf/raw-file/tip/specs/ResourceTiming/Overview.html 34 34 interface [ 35 Conditional=WEB_TIMING, 36 Conditional=PERFORMANCE_TIMELINE, 35 Conditional=RESOURCE_TIMING, 37 36 OmitConstructor 38 ] PerformanceEntry { 39 readonly attribute DOMString name; 40 readonly attribute DOMString entryType; 41 readonly attribute double startTime; 42 readonly attribute double duration; 37 ] PerformanceResourceTiming : PerformanceEntry { 38 readonly attribute DOMString initiatorType; 39 40 readonly attribute double redirectStart; 41 readonly attribute double redirectEnd; 42 readonly attribute double fetchStart; 43 readonly attribute double domainLookupStart; 44 readonly attribute double domainLookupEnd; 45 readonly attribute double connectStart; 46 readonly attribute double connectEnd; 47 readonly attribute double secureConnectionStart; 48 readonly attribute double requestStart; 49 readonly attribute double responseStart; 50 readonly attribute double responseEnd; 43 51 }; 44 52 }
Note: See TracChangeset
for help on using the changeset viewer.