Changeset 99222 in webkit


Ignore:
Timestamp:
Nov 3, 2011, 11:05:15 AM (14 years ago)
Author:
jer.noble@apple.com
Message:

Add Clock class and platform-specific implementations.
https://bugs.webkit.org/show_bug.cgi?id=71341

Reviewed by Sam Weinig.

Source/JavaScriptCore:

Add WTF_USE_COREAUDIO macro for use by PlatformClockCA.

  • wtf/Platform.h:

Source/WebCore:

No new tests; these classes will be used and tested by the MediaController feature.

Adds a abstract Clock class and two concrete, platform-specific subclasses.

Clock provides a basic interface for starting, stopping, and querying a generic timeline.
PlatformClockCA implements this interface using a CoreAudio CAClock object, which uses
the default audio device's hardware clock as a timing source. PlatformClockPOSIX
implements this interface using gettimeofday() as its timing source.

  • WebCore.xcodeproj/project.pbxproj:
  • platform/Clock.cpp: Added.

(Clock::create): Creates a platform-specific clock.

  • platform/Clock.h: Added.

(WebCore::Clock::~Clock):
(WebCore::Clock::Clock):

  • platform/mac/PlatformClockCA.cpp: Added.

(PlatformClockCA::PlatformClockCA):
(PlatformClockCA::~PlatformClockCA):
(PlatformClockCA::setCurrentTime):
(PlatformClockCA::currentTime):
(PlatformClockCA::setPlayRate):
(PlatformClockCA::PlatformClockCA::playRate):
(PlatformClockCA::start):
(PlatformClockCA::stop):

  • platform/mac/PlatformClockCA.h: Added.

(WebCore::PlatformClockCA::isRunning):

  • platform/posix/PlatformClockPOSIX.cpp: Added.

(timevalToFloat):
(timevalDelta):
(PlatformClockPOSIX::PlatformClockPOSIX):
(PlatformClockPOSIX::setCurrentTime):
(PlatformClockPOSIX::currentTime):
(PlatformClockPOSIX::setPlayRate):
(PlatformClockPOSIX::PlatformClockPOSIX::playRate):
(PlatformClockPOSIX::start):
(PlatformClockPOSIX::stop):
(PlatformClockPOSIX::now):

  • platform/posix/PlatformClockPOSIX.h: Added.

(WebCore::PlatformClockPOSIX::isRunning):

Location:
trunk/Source
Files:
6 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r99177 r99222  
     12011-11-02  Jer Noble  <jer.noble@apple.com>
     2
     3        Add Clock class and platform-specific implementations.
     4        https://bugs.webkit.org/show_bug.cgi?id=71341
     5
     6        Reviewed by Sam Weinig.
     7
     8        Add WTF_USE_COREAUDIO macro for use by PlatformClockCA.
     9
     10        * wtf/Platform.h:
     11
    1122011-11-03  Pavel Feldman  <pfeldman@chromium.org>
    213
  • trunk/Source/JavaScriptCore/wtf/Platform.h

    r98937 r99222  
    11051105#endif
    11061106
     1107#if PLATFORM(MAC) || (PLATFORM(WIN) && !OS(WINCE) && !PLATFORM(WIN_CAIRO))
     1108#define WTF_USE_COREAUDIO 1
     1109#endif
     1110
    11071111#endif /* WTF_Platform_h */
  • trunk/Source/WebCore/ChangeLog

    r99218 r99222  
     12011-11-02  Jer Noble  <jer.noble@apple.com>
     2
     3        Add Clock class and platform-specific implementations.
     4        https://bugs.webkit.org/show_bug.cgi?id=71341
     5
     6        Reviewed by Sam Weinig.
     7
     8        No new tests; these classes will be used and tested by the MediaController feature.
     9
     10        Adds a abstract Clock class and two concrete, platform-specific subclasses.
     11
     12        Clock provides a basic interface for starting, stopping, and querying a generic timeline.
     13        PlatformClockCA implements this interface using a CoreAudio CAClock object, which uses
     14        the default audio device's hardware clock as a timing source. PlatformClockPOSIX
     15        implements this interface using gettimeofday() as its timing source.
     16
     17        * WebCore.xcodeproj/project.pbxproj:
     18        * platform/Clock.cpp: Added.
     19        (Clock::create): Creates a platform-specific clock.
     20        * platform/Clock.h: Added.
     21        (WebCore::Clock::~Clock):
     22        (WebCore::Clock::Clock):
     23        * platform/mac/PlatformClockCA.cpp: Added.
     24        (PlatformClockCA::PlatformClockCA):
     25        (PlatformClockCA::~PlatformClockCA):
     26        (PlatformClockCA::setCurrentTime):
     27        (PlatformClockCA::currentTime):
     28        (PlatformClockCA::setPlayRate):
     29        (PlatformClockCA::PlatformClockCA::playRate):
     30        (PlatformClockCA::start):
     31        (PlatformClockCA::stop):
     32        * platform/mac/PlatformClockCA.h: Added.
     33        (WebCore::PlatformClockCA::isRunning):
     34        * platform/posix/PlatformClockPOSIX.cpp: Added.
     35        (timevalToFloat):
     36        (timevalDelta):
     37        (PlatformClockPOSIX::PlatformClockPOSIX):
     38        (PlatformClockPOSIX::setCurrentTime):
     39        (PlatformClockPOSIX::currentTime):
     40        (PlatformClockPOSIX::setPlayRate):
     41        (PlatformClockPOSIX::PlatformClockPOSIX::playRate):
     42        (PlatformClockPOSIX::start):
     43        (PlatformClockPOSIX::stop):
     44        (PlatformClockPOSIX::now):
     45        * platform/posix/PlatformClockPOSIX.h: Added.
     46        (WebCore::PlatformClockPOSIX::isRunning):
     47
    1482011-11-03  Joshua Bell  <jsbell@chromium.org>
    249
  • trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj

    r99108 r99222  
    57025702                CD8203101395ACE700F956C6 /* WebWindowAnimation.h in Headers */ = {isa = PBXBuildFile; fileRef = CD82030E1395ACE700F956C6 /* WebWindowAnimation.h */; };
    57035703                CD8203111395ACE700F956C6 /* WebWindowAnimation.mm in Sources */ = {isa = PBXBuildFile; fileRef = CD82030F1395ACE700F956C6 /* WebWindowAnimation.mm */; };
     5704                CDEA763014608A53008B31F1 /* PlatformClockCA.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CDEA762E146084DE008B31F1 /* PlatformClockCA.cpp */; };
     5705                CDEA76341460B56F008B31F1 /* PlatformClockPOSIX.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CDEA76321460AE29008B31F1 /* PlatformClockPOSIX.cpp */; };
     5706                CDEA76351460B71A008B31F1 /* Clock.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CDEA76331460B462008B31F1 /* Clock.cpp */; };
    57045707                CDEA7C841276230400B846DD /* RenderFullScreen.h in Headers */ = {isa = PBXBuildFile; fileRef = CDEA7C821276230400B846DD /* RenderFullScreen.h */; };
    57055708                CDEA7C851276230400B846DD /* RenderFullScreen.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CDEA7C831276230400B846DD /* RenderFullScreen.cpp */; };
     
    1298412987                CD82030F1395ACE700F956C6 /* WebWindowAnimation.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebWindowAnimation.mm; sourceTree = "<group>"; };
    1298512988                CDBD93BA1333BD4B002570E3 /* fullscreenQuickTime.css */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.css; path = fullscreenQuickTime.css; sourceTree = "<group>"; };
     12989                CDEA762C14608224008B31F1 /* Clock.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Clock.h; sourceTree = "<group>"; };
     12990                CDEA762E146084DE008B31F1 /* PlatformClockCA.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PlatformClockCA.cpp; sourceTree = "<group>"; };
     12991                CDEA762F146084EE008B31F1 /* PlatformClockCA.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlatformClockCA.h; sourceTree = "<group>"; };
     12992                CDEA76311460AE1B008B31F1 /* PlatformClockPOSIX.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlatformClockPOSIX.h; sourceTree = "<group>"; };
     12993                CDEA76321460AE29008B31F1 /* PlatformClockPOSIX.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PlatformClockPOSIX.cpp; sourceTree = "<group>"; };
     12994                CDEA76331460B462008B31F1 /* Clock.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Clock.cpp; sourceTree = "<group>"; };
    1298612995                CDEA7C821276230400B846DD /* RenderFullScreen.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderFullScreen.h; sourceTree = "<group>"; };
    1298712996                CDEA7C831276230400B846DD /* RenderFullScreen.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderFullScreen.cpp; sourceTree = "<group>"; };
     
    1501815027                        children = (
    1501915028                                5160300A0CC4251200C8AC25 /* FileSystemPOSIX.cpp */,
     15029                                CDEA76311460AE1B008B31F1 /* PlatformClockPOSIX.h */,
     15030                                CDEA76321460AE29008B31F1 /* PlatformClockPOSIX.cpp */,
    1502015031                        );
    1502115032                        path = posix;
     
    1539515406                                935C477209AC4D7700A6AAB4 /* WheelEventMac.mm */,
    1539615407                                9380F47709A11ACC001FDB34 /* WidgetMac.mm */,
     15408                                CDEA762E146084DE008B31F1 /* PlatformClockCA.cpp */,
     15409                                CDEA762F146084EE008B31F1 /* PlatformClockCA.h */,
    1539715410                        );
    1539815411                        path = mac;
     
    2004420057                                9380F47209A11AB4001FDB34 /* Widget.h */,
    2004520058                                E1E1BEFF115FF6FB006F52CA /* WindowsKeyboardCodes.h */,
     20059                                CDEA762C14608224008B31F1 /* Clock.h */,
     20060                                CDEA76331460B462008B31F1 /* Clock.cpp */,
    2004620061                        );
    2004720062                        path = platform;
     
    2739227407                                A3BB59F31457A40D00AC56FE /* DocumentEventQueue.cpp in Sources */,
    2739327408                                2D8FEBDC143E3EF70072502B /* CSSCrossfadeValue.cpp in Sources */,
     27409                                CDEA763014608A53008B31F1 /* PlatformClockCA.cpp in Sources */,
     27410                                CDEA76341460B56F008B31F1 /* PlatformClockPOSIX.cpp in Sources */,
     27411                                CDEA76351460B71A008B31F1 /* Clock.cpp in Sources */,
    2739427412                        );
    2739527413                        runOnlyForDeploymentPostprocessing = 0;
Note: See TracChangeset for help on using the changeset viewer.