Changeset 115274 in webkit
- Timestamp:
- Apr 25, 2012 6:17:36 PM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 11 edited
- 6 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/CMakeLists.txt
r115248 r115274 375 375 page/Navigator.idl 376 376 page/Performance.idl 377 page/PerformanceEntry.idl 378 page/PerformanceEntryList.idl 377 379 page/PerformanceNavigation.idl 378 380 page/PerformanceTiming.idl … … 1057 1059 page/PageVisibilityState.cpp 1058 1060 page/Performance.cpp 1061 page/PerformanceEntry.cpp 1062 page/PerformanceEntryList.cpp 1059 1063 page/PerformanceNavigation.cpp 1060 1064 page/PerformanceTiming.cpp -
trunk/Source/WebCore/ChangeLog
r115269 r115274 1 2012-04-25 James Simonsen <simonjam@chromium.org> 2 3 [Web Timing] Add a vendor-prefixed Performance Timeline API 4 https://bugs.webkit.org/show_bug.cgi?id=80350 5 6 As described here: http://dvcs.w3.org/hg/webperf/raw-file/tip/specs/PerformanceTimeline/Overview.html 7 8 The API is there and should be correct, but it isn't particularly useful, 9 because nothing is populated. Upcoming changes will add Navigation Timing 10 and Resource Timing. 11 12 Reviewed by Tony Gentilcore. 13 14 No new tests. Functionality is disabled on all platforms. 15 16 * CMakeLists.txt: Added PerformanceEntry* files. 17 * DerivedSources.pri: Ditto. 18 * GNUmakefile.list.am: Ditto. 19 * WebCore.gypi: Ditto. 20 * WebCore.vcproj/WebCore.vcproj: Ditto. 21 * WebCore.xcodeproj/project.pbxproj: Ditto. 22 * page/Performance.cpp: 23 (WebCore::Performance::webkitGetEntries): Added. 24 (WebCore::Performance::webkitGetEntriesByType): Added. 25 (WebCore::Performance::webkitGetEntriesByName): Added. 26 * page/Performance.h: 27 (Performance): 28 * page/Performance.idl: 29 * page/PerformanceEntry.cpp: Added. 30 (WebCore): 31 (WebCore::PerformanceEntry::PerformanceEntry): 32 (WebCore::PerformanceEntry::name): 33 (WebCore::PerformanceEntry::entryType): 34 (WebCore::PerformanceEntry::startTime): 35 (WebCore::PerformanceEntry::duration): 36 * page/PerformanceEntry.h: Added. 37 (WebCore): 38 (PerformanceEntry): 39 * page/PerformanceEntry.idl: Added. 40 * page/PerformanceEntryList.cpp: Added. 41 (WebCore): 42 (WebCore::PerformanceEntryList::PerformanceEntryList): 43 (WebCore::PerformanceEntryList::~PerformanceEntryList): 44 (WebCore::PerformanceEntryList::length): 45 (WebCore::PerformanceEntryList::item): 46 (WebCore::PerformanceEntryList::append): 47 * page/PerformanceEntryList.h: Added. 48 (WebCore): 49 (PerformanceEntryList): 50 (WebCore::PerformanceEntryList::create): 51 * page/PerformanceEntryList.idl: Added. 52 1 53 2012-04-25 Benjamin Poulain <bpoulain@apple.com> 2 54 -
trunk/Source/WebCore/DerivedSources.pri
r115248 r115274 412 412 $$PWD/page/Navigator.idl \ 413 413 $$PWD/page/Performance.idl \ 414 $$PWD/page/PerformanceEntry.idl \ 415 $$PWD/page/PerformanceEntryList.idl \ 414 416 $$PWD/page/PerformanceNavigation.idl \ 415 417 $$PWD/page/PerformanceTiming.idl \ -
trunk/Source/WebCore/GNUmakefile.list.am
r115248 r115274 445 445 DerivedSources/WebCore/JSPerformance.cpp \ 446 446 DerivedSources/WebCore/JSPerformance.h \ 447 DerivedSources/WebCore/JSPerformanceEntry.cpp \ 448 DerivedSources/WebCore/JSPerformanceEntry.h \ 449 DerivedSources/WebCore/JSPerformanceEntryList.cpp \ 450 DerivedSources/WebCore/JSPerformanceEntryList.h \ 447 451 DerivedSources/WebCore/JSPerformanceNavigation.cpp \ 448 452 DerivedSources/WebCore/JSPerformanceNavigation.h \ … … 939 943 $(WebCore)/page/Navigator.idl \ 940 944 $(WebCore)/page/Performance.idl \ 945 $(WebCore)/page/PerformanceEntry.idl \ 946 $(WebCore)/page/PerformanceEntryList.idl \ 941 947 $(WebCore)/page/PerformanceNavigation.idl \ 942 948 $(WebCore)/page/PerformanceTiming.idl \ … … 2980 2986 Source/WebCore/page/Performance.cpp \ 2981 2987 Source/WebCore/page/Performance.h \ 2988 Source/WebCore/page/PerformanceEntry.cpp \ 2989 Source/WebCore/page/PerformanceEntry.h \ 2990 Source/WebCore/page/PerformanceEntryList.cpp \ 2991 Source/WebCore/page/PerformanceEntryList.h \ 2982 2992 Source/WebCore/page/PerformanceNavigation.cpp \ 2983 2993 Source/WebCore/page/PerformanceNavigation.h \ -
trunk/Source/WebCore/Target.pri
r115248 r115274 1033 1033 page/PageVisibilityState.cpp \ 1034 1034 page/Performance.cpp \ 1035 page/PerformanceEntry.cpp \ 1036 page/PerformanceEntryList.cpp \ 1035 1037 page/PerformanceNavigation.cpp \ 1036 1038 page/PerformanceTiming.cpp \ -
trunk/Source/WebCore/WebCore.gypi
r115264 r115274 1145 1145 'page/NavigatorRegisterProtocolHandler.idl', 1146 1146 'page/Performance.idl', 1147 'page/PerformanceEntry.idl', 1148 'page/PerformanceEntryList.idl', 1147 1149 'page/PerformanceNavigation.idl', 1148 1150 'page/PerformanceTiming.idl', … … 3008 3010 'page/Performance.cpp', 3009 3011 'page/Performance.h', 3012 'page/PerformanceEntry.cpp', 3013 'page/PerformanceEntry.h', 3014 'page/PerformanceEntryList.cpp', 3015 'page/PerformanceEntryList.h', 3010 3016 'page/PerformanceNavigation.cpp', 3011 3017 'page/PerformanceNavigation.h', … … 7661 7667 '<(PRODUCT_DIR)/DerivedSources/WebCore/JSPerformance.cpp', 7662 7668 '<(PRODUCT_DIR)/DerivedSources/WebCore/JSPerformance.h', 7669 '<(PRODUCT_DIR)/DerivedSources/WebCore/JSPerformanceEntry.cpp', 7670 '<(PRODUCT_DIR)/DerivedSources/WebCore/JSPerformanceEntry.h', 7671 '<(PRODUCT_DIR)/DerivedSources/WebCore/JSPerformanceEntryList.cpp', 7672 '<(PRODUCT_DIR)/DerivedSources/WebCore/JSPerformanceEntryList.h', 7663 7673 '<(PRODUCT_DIR)/DerivedSources/WebCore/JSPerformanceNavigation.cpp', 7664 7674 '<(PRODUCT_DIR)/DerivedSources/WebCore/JSPerformanceNavigation.h', -
trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj
r115248 r115274 12211 12211 </File> 12212 12212 <File 12213 RelativePath="$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources\JSPerformanceEntry.cpp" 12214 > 12215 <FileConfiguration 12216 Name="Debug|Win32" 12217 ExcludedFromBuild="true" 12218 > 12219 <Tool 12220 Name="VCCLCompilerTool" 12221 /> 12222 </FileConfiguration> 12223 <FileConfiguration 12224 Name="Release|Win32" 12225 ExcludedFromBuild="true" 12226 > 12227 <Tool 12228 Name="VCCLCompilerTool" 12229 /> 12230 </FileConfiguration> 12231 <FileConfiguration 12232 Name="Debug_Cairo_CFLite|Win32" 12233 ExcludedFromBuild="true" 12234 > 12235 <Tool 12236 Name="VCCLCompilerTool" 12237 /> 12238 </FileConfiguration> 12239 <FileConfiguration 12240 Name="Release_Cairo_CFLite|Win32" 12241 ExcludedFromBuild="true" 12242 > 12243 <Tool 12244 Name="VCCLCompilerTool" 12245 /> 12246 </FileConfiguration> 12247 <FileConfiguration 12248 Name="Debug_All|Win32" 12249 ExcludedFromBuild="true" 12250 > 12251 <Tool 12252 Name="VCCLCompilerTool" 12253 /> 12254 </FileConfiguration> 12255 <FileConfiguration 12256 Name="Production|Win32" 12257 ExcludedFromBuild="true" 12258 > 12259 <Tool 12260 Name="VCCLCompilerTool" 12261 /> 12262 </FileConfiguration> 12263 </File> 12264 <File 12265 RelativePath="$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources\JSPerformanceEntry.h" 12266 > 12267 </File> 12268 <File 12269 RelativePath="$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources\JSPerformanceEntryList.cpp" 12270 > 12271 <FileConfiguration 12272 Name="Debug|Win32" 12273 ExcludedFromBuild="true" 12274 > 12275 <Tool 12276 Name="VCCLCompilerTool" 12277 /> 12278 </FileConfiguration> 12279 <FileConfiguration 12280 Name="Release|Win32" 12281 ExcludedFromBuild="true" 12282 > 12283 <Tool 12284 Name="VCCLCompilerTool" 12285 /> 12286 </FileConfiguration> 12287 <FileConfiguration 12288 Name="Debug_Cairo_CFLite|Win32" 12289 ExcludedFromBuild="true" 12290 > 12291 <Tool 12292 Name="VCCLCompilerTool" 12293 /> 12294 </FileConfiguration> 12295 <FileConfiguration 12296 Name="Release_Cairo_CFLite|Win32" 12297 ExcludedFromBuild="true" 12298 > 12299 <Tool 12300 Name="VCCLCompilerTool" 12301 /> 12302 </FileConfiguration> 12303 <FileConfiguration 12304 Name="Debug_All|Win32" 12305 ExcludedFromBuild="true" 12306 > 12307 <Tool 12308 Name="VCCLCompilerTool" 12309 /> 12310 </FileConfiguration> 12311 <FileConfiguration 12312 Name="Production|Win32" 12313 ExcludedFromBuild="true" 12314 > 12315 <Tool 12316 Name="VCCLCompilerTool" 12317 /> 12318 </FileConfiguration> 12319 </File> 12320 <File 12321 RelativePath="$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources\JSPerformanceEntryList.h" 12322 > 12323 </File> 12324 <File 12213 12325 RelativePath="$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources\JSPerformanceNavigation.cpp" 12214 12326 > … … 26367 26479 </File> 26368 26480 <File 26481 RelativePath="..\page\PerformanceEntry.cpp" 26482 > 26483 </File> 26484 <File 26485 RelativePath="..\page\PerformanceEntry.h" 26486 > 26487 </File> 26488 <File 26489 RelativePath="..\page\PerformanceEntryList.cpp" 26490 > 26491 </File> 26492 <File 26493 RelativePath="..\page\PerformanceEntryList.h" 26494 > 26495 </File> 26496 <File 26369 26497 RelativePath="..\page\PerformanceNavigation.cpp" 26370 26498 > -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r115267 r115274 2867 2867 861C2EA613FB4FFF00062ABB /* ResourceLoadTiming.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 861C2EA513FB4FFF00062ABB /* ResourceLoadTiming.cpp */; }; 2868 2868 86243D0111BC31F700CC006A /* JSArrayBufferViewHelper.h in Headers */ = {isa = PBXBuildFile; fileRef = 86243D0011BC31F700CC006A /* JSArrayBufferViewHelper.h */; }; 2869 86BE340015058CB200CE0FD8 /* PerformanceEntry.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 86BE33FA15058CB200CE0FD8 /* PerformanceEntry.cpp */; }; 2870 86BE340115058CB200CE0FD8 /* PerformanceEntry.h in Headers */ = {isa = PBXBuildFile; fileRef = 86BE33FB15058CB200CE0FD8 /* PerformanceEntry.h */; }; 2871 86BE340315058CB200CE0FD8 /* PerformanceEntryList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 86BE33FD15058CB200CE0FD8 /* PerformanceEntryList.cpp */; }; 2872 86BE340415058CB200CE0FD8 /* PerformanceEntryList.h in Headers */ = {isa = PBXBuildFile; fileRef = 86BE33FE15058CB200CE0FD8 /* PerformanceEntryList.h */; }; 2869 2873 86D982F7125C154000AD9E3D /* DocumentTiming.h in Headers */ = {isa = PBXBuildFile; fileRef = 86D982F6125C154000AD9E3D /* DocumentTiming.h */; settings = {ATTRIBUTES = (Private, ); }; }; 2870 2874 890AE0E11256A07900F5968C /* DirectoryReaderBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 890AE0E01256A07900F5968C /* DirectoryReaderBase.h */; }; … … 9844 9848 861C2EA513FB4FFF00062ABB /* ResourceLoadTiming.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ResourceLoadTiming.cpp; sourceTree = "<group>"; }; 9845 9849 86243D0011BC31F700CC006A /* JSArrayBufferViewHelper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSArrayBufferViewHelper.h; sourceTree = "<group>"; }; 9850 86BE33FA15058CB200CE0FD8 /* PerformanceEntry.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PerformanceEntry.cpp; sourceTree = "<group>"; }; 9851 86BE33FB15058CB200CE0FD8 /* PerformanceEntry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PerformanceEntry.h; sourceTree = "<group>"; }; 9852 86BE33FC15058CB200CE0FD8 /* PerformanceEntry.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = PerformanceEntry.idl; sourceTree = "<group>"; }; 9853 86BE33FD15058CB200CE0FD8 /* PerformanceEntryList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PerformanceEntryList.cpp; sourceTree = "<group>"; }; 9854 86BE33FE15058CB200CE0FD8 /* PerformanceEntryList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PerformanceEntryList.h; sourceTree = "<group>"; }; 9855 86BE33FF15058CB200CE0FD8 /* PerformanceEntryList.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = PerformanceEntryList.idl; sourceTree = "<group>"; }; 9846 9856 86D982F6125C154000AD9E3D /* DocumentTiming.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DocumentTiming.h; sourceTree = "<group>"; }; 9847 9857 890AE0E01256A07900F5968C /* DirectoryReaderBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DirectoryReaderBase.h; path = Modules/filesystem/DirectoryReaderBase.h; sourceTree = "<group>"; }; … … 15422 15432 8A844D0211D3C18E0014065C /* Performance.h */, 15423 15433 8A844D0311D3C18E0014065C /* Performance.idl */, 15434 86BE33FA15058CB200CE0FD8 /* PerformanceEntry.cpp */, 15435 86BE33FB15058CB200CE0FD8 /* PerformanceEntry.h */, 15436 86BE33FC15058CB200CE0FD8 /* PerformanceEntry.idl */, 15437 86BE33FD15058CB200CE0FD8 /* PerformanceEntryList.cpp */, 15438 86BE33FE15058CB200CE0FD8 /* PerformanceEntryList.h */, 15439 86BE33FF15058CB200CE0FD8 /* PerformanceEntryList.idl */, 15424 15440 8AF4E55211DC5A36000ED3DE /* PerformanceNavigation.cpp */, 15425 15441 8AF4E55311DC5A36000ED3DE /* PerformanceNavigation.h */, … … 23851 23867 8A7CC96B12076D73001D4588 /* PendingScript.h in Headers */, 23852 23868 8A844D0511D3C18E0014065C /* Performance.h in Headers */, 23869 86BE340115058CB200CE0FD8 /* PerformanceEntry.h in Headers */, 23870 86BE340415058CB200CE0FD8 /* PerformanceEntryList.h in Headers */, 23853 23871 8AF4E55611DC5A36000ED3DE /* PerformanceNavigation.h in Headers */, 23854 23872 8AF4E55C11DC5A63000ED3DE /* PerformanceTiming.h in Headers */, … … 27050 27068 8A7CC97012076F8A001D4588 /* PendingScript.cpp in Sources */, 27051 27069 8A844D0411D3C18E0014065C /* Performance.cpp in Sources */, 27070 86BE340015058CB200CE0FD8 /* PerformanceEntry.cpp in Sources */, 27071 86BE340315058CB200CE0FD8 /* PerformanceEntryList.cpp in Sources */, 27052 27072 8AF4E55511DC5A36000ED3DE /* PerformanceNavigation.cpp in Sources */, 27053 27073 8AF4E55B11DC5A63000ED3DE /* PerformanceTiming.cpp in Sources */, -
trunk/Source/WebCore/page/Performance.cpp
r104380 r115274 68 68 } 69 69 70 #if ENABLE(PERFORMANCE_TIMELINE) 71 72 PassRefPtr<PerformanceEntryList> Performance::webkitGetEntries() const 73 { 74 RefPtr<PerformanceEntryList> entries = PerformanceEntryList::create(); 75 return entries; 76 } 77 78 PassRefPtr<PerformanceEntryList> Performance::webkitGetEntriesByType(const String&) 79 { 80 RefPtr<PerformanceEntryList> entries = PerformanceEntryList::create(); 81 return entries; 82 } 83 84 PassRefPtr<PerformanceEntryList> Performance::webkitGetEntriesByName(const String&, const String&) 85 { 86 RefPtr<PerformanceEntryList> entries = PerformanceEntryList::create(); 87 return entries; 88 } 89 90 #endif // ENABLE(PERFORMANCE_TIMELINE) 91 70 92 } // namespace WebCore 71 93 -
trunk/Source/WebCore/page/Performance.h
r104380 r115274 36 36 #include "DOMWindowProperty.h" 37 37 #include "MemoryInfo.h" 38 #include "PerformanceEntryList.h" 38 39 #include "PerformanceNavigation.h" 39 40 #include "PerformanceTiming.h" … … 41 42 #include <wtf/RefCounted.h> 42 43 #include <wtf/RefPtr.h> 44 #include <wtf/text/WTFString.h> 43 45 44 46 namespace WebCore { … … 51 53 PerformanceNavigation* navigation() const; 52 54 PerformanceTiming* timing() const; 55 56 #if ENABLE(PERFORMANCE_TIMELINE) 57 PassRefPtr<PerformanceEntryList> webkitGetEntries() const; 58 PassRefPtr<PerformanceEntryList> webkitGetEntriesByType(const String& entryType); 59 PassRefPtr<PerformanceEntryList> webkitGetEntriesByName(const String& name, const String& entryType); 60 #endif 53 61 54 62 private: -
trunk/Source/WebCore/page/Performance.idl
r89269 r115274 39 39 readonly attribute PerformanceTiming timing; 40 40 readonly attribute [V8CustomGetter] MemoryInfo memory; 41 42 #if defined(ENABLE_PERFORMANCE_TIMELINE) && ENABLE_PERFORMANCE_TIMELINE 43 PerformanceEntryList webkitGetEntries(); 44 PerformanceEntryList webkitGetEntriesByType(in DOMString entryType); 45 PerformanceEntryList webkitGetEntriesByName(in DOMString name, in [Optional=DefaultIsNullString] DOMString entryType); 46 #endif 41 47 }; 42 48 -
trunk/Source/WebCore/page/PerformanceEntry.cpp
r115272 r115274 1 1 /* 2 * Copyright (C) 201 0Google Inc. All rights reserved.2 * Copyright (C) 2012 Google Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 30 30 31 31 #include "config.h" 32 #include "Performance .h"32 #include "PerformanceEntry.h" 33 33 34 #include "MemoryInfo.h" 35 #include "PerformanceNavigation.h" 36 #include "PerformanceTiming.h" 37 38 #if ENABLE(WEB_TIMING) 39 40 #include "Frame.h" 34 #if ENABLE(WEB_TIMING) && ENABLE(PERFORMANCE_TIMELINE) 41 35 42 36 namespace WebCore { 43 37 44 Performance::Performance(Frame* frame) 45 : DOMWindowProperty(frame) 38 PerformanceEntry::PerformanceEntry(const String& name, const String& entryType, double startTime, double duration) 39 : m_name(name) 40 , m_entryType(entryType) 41 , m_startTime(startTime) 42 , m_duration(duration) 46 43 { 47 44 } 48 45 49 PassRefPtr<MemoryInfo> Performance::memory() const46 String PerformanceEntry::name() const 50 47 { 51 return MemoryInfo::create(m_frame);48 return m_name; 52 49 } 53 50 54 PerformanceNavigation* Performance::navigation() const51 String PerformanceEntry::entryType() const 55 52 { 56 if (!m_navigation) 57 m_navigation = PerformanceNavigation::create(m_frame); 58 59 return m_navigation.get(); 53 return m_entryType; 60 54 } 61 55 62 PerformanceTiming* Performance::timing() const56 double PerformanceEntry::startTime() const 63 57 { 64 if (!m_timing)65 m_timing = PerformanceTiming::create(m_frame); 58 return m_startTime; 59 } 66 60 67 return m_timing.get(); 61 double PerformanceEntry::duration() const 62 { 63 return m_duration; 68 64 } 69 65 70 66 } // namespace WebCore 71 67 72 #endif // ENABLE(WEB_TIMING) 68 #endif // ENABLE(WEB_TIMING) && ENABLE(PERFORMANCE_TIMELINE) -
trunk/Source/WebCore/page/PerformanceEntry.h
r115272 r115274 1 1 /* 2 * Copyright (C) 201 0Google Inc. All rights reserved.2 * Copyright (C) 2012 Google Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 29 29 */ 30 30 31 #ifndef Performance _h32 #define Performance _h31 #ifndef PerformanceEntry_h 32 #define PerformanceEntry_h 33 33 34 #if ENABLE(WEB_TIMING) 34 #if ENABLE(WEB_TIMING) && ENABLE(PERFORMANCE_TIMELINE) 35 35 36 #include "DOMWindowProperty.h" 37 #include "MemoryInfo.h" 38 #include "PerformanceNavigation.h" 39 #include "PerformanceTiming.h" 36 #include "Performance.h" 40 37 #include <wtf/PassRefPtr.h> 41 38 #include <wtf/RefCounted.h> 42 #include <wtf/ RefPtr.h>39 #include <wtf/text/WTFString.h> 43 40 44 41 namespace WebCore { 45 42 46 class Performance : public RefCounted<Performance>, public DOMWindowProperty{43 class PerformanceEntry : public RefCounted<PerformanceEntry> { 47 44 public: 48 static PassRefPtr<Performance> create(Frame* frame) { return adoptRef(new Performance(frame)); } 45 String name() const; 46 String entryType() const; 47 double startTime() const; 48 double duration() const; 49 49 50 PassRefPtr<MemoryInfo> memory() const; 51 PerformanceNavigation* navigation() const; 52 PerformanceTiming* timing() const; 50 protected: 51 PerformanceEntry(const String& name, const String& entryType, double startTime, double duration); 53 52 54 53 private: 55 explicit Performance(Frame*);56 57 mutable RefPtr<PerformanceNavigation> m_navigation;58 mutable RefPtr<PerformanceTiming> m_timing;54 const String m_name; 55 const String m_entryType; 56 const double m_startTime; 57 const double m_duration; 59 58 }; 60 59 61 60 } 62 61 63 #endif // ENABLE(WEB_TIMING) 64 65 #endif // Performance_h 62 #endif // !ENABLE(WEB_TIMING) && ENABLE(PERFORMANCE_TIMELINE) 63 #endif // !defined(PerformanceEntry_h) -
trunk/Source/WebCore/page/PerformanceEntry.idl
r115272 r115274 1 1 /* 2 * Copyright (C) 201 0Google Inc. All rights reserved.2 * Copyright (C) 2012 Google Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 31 31 module window { 32 32 33 // See: http ://dev.w3.org/2006/webapi/WebTiming/33 // See: https://dvcs.w3.org/hg/webperf/raw-file/tip/specs/PerformanceTimeline/Overview.html 34 34 interface [ 35 35 Conditional=WEB_TIMING, 36 Conditional=PERFORMANCE_TIMELINE, 36 37 OmitConstructor 37 ] Performance { 38 readonly attribute PerformanceNavigation navigation; 39 readonly attribute PerformanceTiming timing; 40 readonly attribute [V8CustomGetter] MemoryInfo memory; 38 ] PerformanceEntry { 39 readonly attribute DOMString name; 40 readonly attribute DOMString entryType; 41 readonly attribute double startTime; 42 readonly attribute double duration; 41 43 }; 42 43 44 } -
trunk/Source/WebCore/page/PerformanceEntryList.cpp
r115272 r115274 1 1 /* 2 * Copyright (C) 201 0Google Inc. All rights reserved.2 * Copyright (C) 2012 Google Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 30 30 31 31 #include "config.h" 32 #include "Performance .h"32 #include "PerformanceEntryList.h" 33 33 34 #include "MemoryInfo.h" 35 #include "PerformanceNavigation.h" 36 #include "PerformanceTiming.h" 34 #if ENABLE(WEB_TIMING) && ENABLE(PERFORMANCE_TIMELINE) 37 35 38 #if ENABLE(WEB_TIMING) 39 40 #include "Frame.h" 36 #include "PerformanceEntry.h" 41 37 42 38 namespace WebCore { 43 39 44 Performance::Performance(Frame* frame) 45 : DOMWindowProperty(frame) 40 PerformanceEntryList::PerformanceEntryList() 46 41 { 47 42 } 48 43 49 P assRefPtr<MemoryInfo> Performance::memory() const44 PerformanceEntryList::~PerformanceEntryList() 50 45 { 51 return MemoryInfo::create(m_frame);52 46 } 53 47 54 PerformanceNavigation* Performance::navigation() const48 unsigned PerformanceEntryList::length() const 55 49 { 56 if (!m_navigation) 57 m_navigation = PerformanceNavigation::create(m_frame); 58 59 return m_navigation.get(); 50 return m_entries.size(); 60 51 } 61 52 62 Performance Timing* Performance::timing() const53 PerformanceEntry* PerformanceEntryList::item(unsigned index) 63 54 { 64 if (!m_timing) 65 m_timing = PerformanceTiming::create(m_frame); 55 if (index < m_entries.size()) 56 return m_entries[index].get(); 57 return 0; 58 } 66 59 67 return m_timing.get(); 60 void PerformanceEntryList::append(PassRefPtr<PerformanceEntry> entry) 61 { 62 m_entries.append(entry); 68 63 } 69 64 70 65 } // namespace WebCore 71 66 72 #endif // ENABLE(WEB_TIMING) 67 #endif // ENABLE(WEB_TIMING) && ENABLE(PERFORMANCE_TIMELINE) -
trunk/Source/WebCore/page/PerformanceEntryList.h
r115272 r115274 1 1 /* 2 * Copyright (C) 201 0Google Inc. All rights reserved.2 * Copyright (C) 2012 Google Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 29 29 */ 30 30 31 #ifndef Performance _h32 #define Performance _h31 #ifndef PerformanceEntryList_h 32 #define PerformanceEntryList_h 33 33 34 #if ENABLE(WEB_TIMING) 34 #if ENABLE(WEB_TIMING) && ENABLE(PERFORMANCE_TIMELINE) 35 35 36 #include "DOMWindowProperty.h"37 #include "MemoryInfo.h"38 #include "PerformanceNavigation.h"39 #include "PerformanceTiming.h"40 36 #include <wtf/PassRefPtr.h> 41 37 #include <wtf/RefCounted.h> 42 38 #include <wtf/RefPtr.h> 39 #include <wtf/Vector.h> 43 40 44 41 namespace WebCore { 45 42 46 class Performance : public RefCounted<Performance>, public DOMWindowProperty { 43 class PerformanceEntry; 44 45 class PerformanceEntryList : public RefCounted<PerformanceEntryList> { 47 46 public: 48 static PassRefPtr<Performance> create(Frame* frame) { return adoptRef(new Performance(frame)); } 47 static PassRefPtr<PerformanceEntryList> create() { return adoptRef(new PerformanceEntryList); } 48 ~PerformanceEntryList(); 49 49 50 PassRefPtr<MemoryInfo> memory() const; 51 PerformanceNavigation* navigation() const; 52 PerformanceTiming* timing() const; 50 unsigned length() const; 51 PerformanceEntry* item(unsigned index); 52 53 void append(PassRefPtr<PerformanceEntry>); 53 54 54 55 private: 55 explicit Performance(Frame*);56 PerformanceEntryList(); 56 57 57 mutable RefPtr<PerformanceNavigation> m_navigation; 58 mutable RefPtr<PerformanceTiming> m_timing; 58 Vector<RefPtr<PerformanceEntry> > m_entries; 59 59 }; 60 60 61 } 61 } // namespace WebCore 62 62 63 #endif // ENABLE(WEB_TIMING) 64 65 #endif // Performance_h 63 #endif // !ENABLE(WEB_TIMING) && ENABLE(PERFORMANCE_TIMELINE) 64 #endif // PerformanceEntryList_h -
trunk/Source/WebCore/page/PerformanceEntryList.idl
r115272 r115274 1 1 /* 2 * Copyright (C) 201 0Google Inc. All rights reserved.2 * Copyright (C) 2012 Google Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 31 31 module window { 32 32 33 // See: http ://dev.w3.org/2006/webapi/WebTiming/33 // See: https://dvcs.w3.org/hg/webperf/raw-file/tip/specs/PerformanceTimeline/Overview.html 34 34 interface [ 35 35 Conditional=WEB_TIMING, 36 OmitConstructor 37 ] Performance { 38 readonly attribute PerformanceNavigation navigation; 39 readonly attribute PerformanceTiming timing; 40 readonly attribute [V8CustomGetter] MemoryInfo memory; 36 Conditional=PERFORMANCE_TIMELINE, 37 OmitConstructor, 38 IndexedGetter 39 ] PerformanceEntryList { 40 readonly attribute unsigned long length; 41 PerformanceEntry item(in unsigned long index); 41 42 }; 42 43
Note: See TracChangeset
for help on using the changeset viewer.