Changeset 115274 in webkit


Ignore:
Timestamp:
Apr 25, 2012 6:17:36 PM (12 years ago)
Author:
simonjam@chromium.org
Message:

[Web Timing] Add a vendor-prefixed Performance Timeline API
https://bugs.webkit.org/show_bug.cgi?id=80350

As described here: http://dvcs.w3.org/hg/webperf/raw-file/tip/specs/PerformanceTimeline/Overview.html

The API is there and should be correct, but it isn't particularly useful,
because nothing is populated. Upcoming changes will add Navigation Timing
and Resource Timing.

Reviewed by Tony Gentilcore.

No new tests. Functionality is disabled on all platforms.

  • CMakeLists.txt: Added PerformanceEntry* files.
  • DerivedSources.pri: Ditto.
  • GNUmakefile.list.am: Ditto.
  • WebCore.gypi: Ditto.
  • WebCore.vcproj/WebCore.vcproj: Ditto.
  • WebCore.xcodeproj/project.pbxproj: Ditto.
  • page/Performance.cpp:

(WebCore::Performance::webkitGetEntries): Added.
(WebCore::Performance::webkitGetEntriesByType): Added.
(WebCore::Performance::webkitGetEntriesByName): Added.

  • page/Performance.h:

(Performance):

  • page/Performance.idl:
  • page/PerformanceEntry.cpp: Added.

(WebCore):
(WebCore::PerformanceEntry::PerformanceEntry):
(WebCore::PerformanceEntry::name):
(WebCore::PerformanceEntry::entryType):
(WebCore::PerformanceEntry::startTime):
(WebCore::PerformanceEntry::duration):

  • page/PerformanceEntry.h: Added.

(WebCore):
(PerformanceEntry):

  • page/PerformanceEntry.idl: Added.
  • page/PerformanceEntryList.cpp: Added.

(WebCore):
(WebCore::PerformanceEntryList::PerformanceEntryList):
(WebCore::PerformanceEntryList::~PerformanceEntryList):
(WebCore::PerformanceEntryList::length):
(WebCore::PerformanceEntryList::item):
(WebCore::PerformanceEntryList::append):

  • page/PerformanceEntryList.h: Added.

(WebCore):
(PerformanceEntryList):
(WebCore::PerformanceEntryList::create):

  • page/PerformanceEntryList.idl: Added.
Location:
trunk/Source/WebCore
Files:
11 edited
6 copied

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/CMakeLists.txt

    r115248 r115274  
    375375    page/Navigator.idl
    376376    page/Performance.idl
     377    page/PerformanceEntry.idl
     378    page/PerformanceEntryList.idl
    377379    page/PerformanceNavigation.idl
    378380    page/PerformanceTiming.idl
     
    10571059    page/PageVisibilityState.cpp
    10581060    page/Performance.cpp
     1061    page/PerformanceEntry.cpp
     1062    page/PerformanceEntryList.cpp
    10591063    page/PerformanceNavigation.cpp
    10601064    page/PerformanceTiming.cpp
  • trunk/Source/WebCore/ChangeLog

    r115269 r115274  
     12012-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
    1532012-04-25  Benjamin Poulain  <bpoulain@apple.com>
    254
  • trunk/Source/WebCore/DerivedSources.pri

    r115248 r115274  
    412412    $$PWD/page/Navigator.idl \
    413413    $$PWD/page/Performance.idl \
     414    $$PWD/page/PerformanceEntry.idl \
     415    $$PWD/page/PerformanceEntryList.idl \
    414416    $$PWD/page/PerformanceNavigation.idl \
    415417    $$PWD/page/PerformanceTiming.idl \
  • trunk/Source/WebCore/GNUmakefile.list.am

    r115248 r115274  
    445445        DerivedSources/WebCore/JSPerformance.cpp \
    446446        DerivedSources/WebCore/JSPerformance.h \
     447        DerivedSources/WebCore/JSPerformanceEntry.cpp \
     448        DerivedSources/WebCore/JSPerformanceEntry.h \
     449        DerivedSources/WebCore/JSPerformanceEntryList.cpp \
     450        DerivedSources/WebCore/JSPerformanceEntryList.h \
    447451        DerivedSources/WebCore/JSPerformanceNavigation.cpp \
    448452        DerivedSources/WebCore/JSPerformanceNavigation.h \
     
    939943        $(WebCore)/page/Navigator.idl \
    940944        $(WebCore)/page/Performance.idl \
     945        $(WebCore)/page/PerformanceEntry.idl \
     946        $(WebCore)/page/PerformanceEntryList.idl \
    941947        $(WebCore)/page/PerformanceNavigation.idl \
    942948        $(WebCore)/page/PerformanceTiming.idl \
     
    29802986        Source/WebCore/page/Performance.cpp \
    29812987        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 \
    29822992        Source/WebCore/page/PerformanceNavigation.cpp \
    29832993        Source/WebCore/page/PerformanceNavigation.h \
  • trunk/Source/WebCore/Target.pri

    r115248 r115274  
    10331033    page/PageVisibilityState.cpp \
    10341034    page/Performance.cpp \
     1035    page/PerformanceEntry.cpp \
     1036    page/PerformanceEntryList.cpp \
    10351037    page/PerformanceNavigation.cpp \
    10361038    page/PerformanceTiming.cpp \
  • trunk/Source/WebCore/WebCore.gypi

    r115264 r115274  
    11451145            'page/NavigatorRegisterProtocolHandler.idl',
    11461146            'page/Performance.idl',
     1147            'page/PerformanceEntry.idl',
     1148            'page/PerformanceEntryList.idl',
    11471149            'page/PerformanceNavigation.idl',
    11481150            'page/PerformanceTiming.idl',
     
    30083010            'page/Performance.cpp',
    30093011            'page/Performance.h',
     3012            'page/PerformanceEntry.cpp',
     3013            'page/PerformanceEntry.h',
     3014            'page/PerformanceEntryList.cpp',
     3015            'page/PerformanceEntryList.h',
    30103016            'page/PerformanceNavigation.cpp',
    30113017            'page/PerformanceNavigation.h',
     
    76617667            '<(PRODUCT_DIR)/DerivedSources/WebCore/JSPerformance.cpp',
    76627668            '<(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',
    76637673            '<(PRODUCT_DIR)/DerivedSources/WebCore/JSPerformanceNavigation.cpp',
    76647674            '<(PRODUCT_DIR)/DerivedSources/WebCore/JSPerformanceNavigation.h',
  • trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj

    r115248 r115274  
    1221112211                        </File>
    1221212212                        <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
    1221312325                                RelativePath="$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources\JSPerformanceNavigation.cpp"
    1221412326                                >
     
    2636726479                        </File>
    2636826480                        <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
    2636926497                                RelativePath="..\page\PerformanceNavigation.cpp"
    2637026498                                >
  • trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj

    r115267 r115274  
    28672867                861C2EA613FB4FFF00062ABB /* ResourceLoadTiming.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 861C2EA513FB4FFF00062ABB /* ResourceLoadTiming.cpp */; };
    28682868                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 */; };
    28692873                86D982F7125C154000AD9E3D /* DocumentTiming.h in Headers */ = {isa = PBXBuildFile; fileRef = 86D982F6125C154000AD9E3D /* DocumentTiming.h */; settings = {ATTRIBUTES = (Private, ); }; };
    28702874                890AE0E11256A07900F5968C /* DirectoryReaderBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 890AE0E01256A07900F5968C /* DirectoryReaderBase.h */; };
     
    98449848                861C2EA513FB4FFF00062ABB /* ResourceLoadTiming.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ResourceLoadTiming.cpp; sourceTree = "<group>"; };
    98459849                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>"; };
    98469856                86D982F6125C154000AD9E3D /* DocumentTiming.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DocumentTiming.h; sourceTree = "<group>"; };
    98479857                890AE0E01256A07900F5968C /* DirectoryReaderBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DirectoryReaderBase.h; path = Modules/filesystem/DirectoryReaderBase.h; sourceTree = "<group>"; };
     
    1542215432                                8A844D0211D3C18E0014065C /* Performance.h */,
    1542315433                                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 */,
    1542415440                                8AF4E55211DC5A36000ED3DE /* PerformanceNavigation.cpp */,
    1542515441                                8AF4E55311DC5A36000ED3DE /* PerformanceNavigation.h */,
     
    2385123867                                8A7CC96B12076D73001D4588 /* PendingScript.h in Headers */,
    2385223868                                8A844D0511D3C18E0014065C /* Performance.h in Headers */,
     23869                                86BE340115058CB200CE0FD8 /* PerformanceEntry.h in Headers */,
     23870                                86BE340415058CB200CE0FD8 /* PerformanceEntryList.h in Headers */,
    2385323871                                8AF4E55611DC5A36000ED3DE /* PerformanceNavigation.h in Headers */,
    2385423872                                8AF4E55C11DC5A63000ED3DE /* PerformanceTiming.h in Headers */,
     
    2705027068                                8A7CC97012076F8A001D4588 /* PendingScript.cpp in Sources */,
    2705127069                                8A844D0411D3C18E0014065C /* Performance.cpp in Sources */,
     27070                                86BE340015058CB200CE0FD8 /* PerformanceEntry.cpp in Sources */,
     27071                                86BE340315058CB200CE0FD8 /* PerformanceEntryList.cpp in Sources */,
    2705227072                                8AF4E55511DC5A36000ED3DE /* PerformanceNavigation.cpp in Sources */,
    2705327073                                8AF4E55B11DC5A63000ED3DE /* PerformanceTiming.cpp in Sources */,
  • trunk/Source/WebCore/page/Performance.cpp

    r104380 r115274  
    6868}
    6969
     70#if ENABLE(PERFORMANCE_TIMELINE)
     71
     72PassRefPtr<PerformanceEntryList> Performance::webkitGetEntries() const
     73{
     74    RefPtr<PerformanceEntryList> entries = PerformanceEntryList::create();
     75    return entries;
     76}
     77
     78PassRefPtr<PerformanceEntryList> Performance::webkitGetEntriesByType(const String&)
     79{
     80    RefPtr<PerformanceEntryList> entries = PerformanceEntryList::create();
     81    return entries;
     82}
     83
     84PassRefPtr<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
    7092} // namespace WebCore
    7193
  • trunk/Source/WebCore/page/Performance.h

    r104380 r115274  
    3636#include "DOMWindowProperty.h"
    3737#include "MemoryInfo.h"
     38#include "PerformanceEntryList.h"
    3839#include "PerformanceNavigation.h"
    3940#include "PerformanceTiming.h"
     
    4142#include <wtf/RefCounted.h>
    4243#include <wtf/RefPtr.h>
     44#include <wtf/text/WTFString.h>
    4345
    4446namespace WebCore {
     
    5153    PerformanceNavigation* navigation() const;
    5254    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
    5361
    5462private:
  • trunk/Source/WebCore/page/Performance.idl

    r89269 r115274  
    3939        readonly attribute PerformanceTiming timing;
    4040        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
    4147    };
    4248
  • trunk/Source/WebCore/page/PerformanceEntry.cpp

    r115272 r115274  
    11/*
    2  * Copyright (C) 2010 Google Inc. All rights reserved.
     2 * Copyright (C) 2012 Google Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    3030
    3131#include "config.h"
    32 #include "Performance.h"
     32#include "PerformanceEntry.h"
    3333
    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)
    4135
    4236namespace WebCore {
    4337
    44 Performance::Performance(Frame* frame)
    45     : DOMWindowProperty(frame)
     38PerformanceEntry::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)
    4643{
    4744}
    4845
    49 PassRefPtr<MemoryInfo> Performance::memory() const
     46String PerformanceEntry::name() const
    5047{
    51     return MemoryInfo::create(m_frame);
     48    return m_name;
    5249}
    5350
    54 PerformanceNavigation* Performance::navigation() const
     51String PerformanceEntry::entryType() const
    5552{
    56     if (!m_navigation)
    57         m_navigation = PerformanceNavigation::create(m_frame);
    58 
    59     return m_navigation.get();
     53    return m_entryType;
    6054}
    6155
    62 PerformanceTiming* Performance::timing() const
     56double PerformanceEntry::startTime() const
    6357{
    64     if (!m_timing)
    65         m_timing = PerformanceTiming::create(m_frame);
     58    return m_startTime;
     59}
    6660
    67     return m_timing.get();
     61double PerformanceEntry::duration() const
     62{
     63    return m_duration;
    6864}
    6965
    7066} // namespace WebCore
    7167
    72 #endif // ENABLE(WEB_TIMING)
     68#endif // ENABLE(WEB_TIMING) && ENABLE(PERFORMANCE_TIMELINE)
  • trunk/Source/WebCore/page/PerformanceEntry.h

    r115272 r115274  
    11/*
    2  * Copyright (C) 2010 Google Inc. All rights reserved.
     2 * Copyright (C) 2012 Google Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    2929 */
    3030
    31 #ifndef Performance_h
    32 #define Performance_h
     31#ifndef PerformanceEntry_h
     32#define PerformanceEntry_h
    3333
    34 #if ENABLE(WEB_TIMING)
     34#if ENABLE(WEB_TIMING) && ENABLE(PERFORMANCE_TIMELINE)
    3535
    36 #include "DOMWindowProperty.h"
    37 #include "MemoryInfo.h"
    38 #include "PerformanceNavigation.h"
    39 #include "PerformanceTiming.h"
     36#include "Performance.h"
    4037#include <wtf/PassRefPtr.h>
    4138#include <wtf/RefCounted.h>
    42 #include <wtf/RefPtr.h>
     39#include <wtf/text/WTFString.h>
    4340
    4441namespace WebCore {
    4542
    46 class Performance : public RefCounted<Performance>, public DOMWindowProperty {
     43class PerformanceEntry : public RefCounted<PerformanceEntry> {
    4744public:
    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;
    4949
    50     PassRefPtr<MemoryInfo> memory() const;
    51     PerformanceNavigation* navigation() const;
    52     PerformanceTiming* timing() const;
     50protected:
     51    PerformanceEntry(const String& name, const String& entryType, double startTime, double duration);
    5352
    5453private:
    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;
    5958};
    6059
    6160}
    6261
    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  
    11/*
    2  * Copyright (C) 2010 Google Inc. All rights reserved.
     2 * Copyright (C) 2012 Google Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    3131module window {
    3232
    33     // See: http://dev.w3.org/2006/webapi/WebTiming/
     33    // See: https://dvcs.w3.org/hg/webperf/raw-file/tip/specs/PerformanceTimeline/Overview.html
    3434    interface [
    3535        Conditional=WEB_TIMING,
     36        Conditional=PERFORMANCE_TIMELINE,
    3637        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;
    4143    };
    42 
    4344}
  • trunk/Source/WebCore/page/PerformanceEntryList.cpp

    r115272 r115274  
    11/*
    2  * Copyright (C) 2010 Google Inc. All rights reserved.
     2 * Copyright (C) 2012 Google Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    3030
    3131#include "config.h"
    32 #include "Performance.h"
     32#include "PerformanceEntryList.h"
    3333
    34 #include "MemoryInfo.h"
    35 #include "PerformanceNavigation.h"
    36 #include "PerformanceTiming.h"
     34#if ENABLE(WEB_TIMING) && ENABLE(PERFORMANCE_TIMELINE)
    3735
    38 #if ENABLE(WEB_TIMING)
    39 
    40 #include "Frame.h"
     36#include "PerformanceEntry.h"
    4137
    4238namespace WebCore {
    4339
    44 Performance::Performance(Frame* frame)
    45     : DOMWindowProperty(frame)
     40PerformanceEntryList::PerformanceEntryList()
    4641{
    4742}
    4843
    49 PassRefPtr<MemoryInfo> Performance::memory() const
     44PerformanceEntryList::~PerformanceEntryList()
    5045{
    51     return MemoryInfo::create(m_frame);
    5246}
    5347
    54 PerformanceNavigation* Performance::navigation() const
     48unsigned PerformanceEntryList::length() const
    5549{
    56     if (!m_navigation)
    57         m_navigation = PerformanceNavigation::create(m_frame);
    58 
    59     return m_navigation.get();
     50    return m_entries.size();
    6051}
    6152
    62 PerformanceTiming* Performance::timing() const
     53PerformanceEntry* PerformanceEntryList::item(unsigned index)
    6354{
    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}
    6659
    67     return m_timing.get();
     60void PerformanceEntryList::append(PassRefPtr<PerformanceEntry> entry)
     61{
     62    m_entries.append(entry);
    6863}
    6964
    7065} // namespace WebCore
    7166
    72 #endif // ENABLE(WEB_TIMING)
     67#endif // ENABLE(WEB_TIMING) && ENABLE(PERFORMANCE_TIMELINE)
  • trunk/Source/WebCore/page/PerformanceEntryList.h

    r115272 r115274  
    11/*
    2  * Copyright (C) 2010 Google Inc. All rights reserved.
     2 * Copyright (C) 2012 Google Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    2929 */
    3030
    31 #ifndef Performance_h
    32 #define Performance_h
     31#ifndef PerformanceEntryList_h
     32#define PerformanceEntryList_h
    3333
    34 #if ENABLE(WEB_TIMING)
     34#if ENABLE(WEB_TIMING) && ENABLE(PERFORMANCE_TIMELINE)
    3535
    36 #include "DOMWindowProperty.h"
    37 #include "MemoryInfo.h"
    38 #include "PerformanceNavigation.h"
    39 #include "PerformanceTiming.h"
    4036#include <wtf/PassRefPtr.h>
    4137#include <wtf/RefCounted.h>
    4238#include <wtf/RefPtr.h>
     39#include <wtf/Vector.h>
    4340
    4441namespace WebCore {
    4542
    46 class Performance : public RefCounted<Performance>, public DOMWindowProperty {
     43class PerformanceEntry;
     44
     45class PerformanceEntryList : public RefCounted<PerformanceEntryList> {
    4746public:
    48     static PassRefPtr<Performance> create(Frame* frame) { return adoptRef(new Performance(frame)); }
     47    static PassRefPtr<PerformanceEntryList> create() { return adoptRef(new PerformanceEntryList); }
     48    ~PerformanceEntryList();
    4949
    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>);
    5354
    5455private:
    55     explicit Performance(Frame*);
     56    PerformanceEntryList();
    5657
    57     mutable RefPtr<PerformanceNavigation> m_navigation;
    58     mutable RefPtr<PerformanceTiming> m_timing;
     58    Vector<RefPtr<PerformanceEntry> > m_entries;
    5959};
    6060
    61 }
     61} // namespace WebCore
    6262
    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  
    11/*
    2  * Copyright (C) 2010 Google Inc. All rights reserved.
     2 * Copyright (C) 2012 Google Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    3131module window {
    3232
    33     // See: http://dev.w3.org/2006/webapi/WebTiming/
     33    // See: https://dvcs.w3.org/hg/webperf/raw-file/tip/specs/PerformanceTimeline/Overview.html
    3434    interface [
    3535        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);
    4142    };
    4243
Note: See TracChangeset for help on using the changeset viewer.