Changeset 71602 in webkit


Ignore:
Timestamp:
Nov 8, 2010 8:14:36 PM (13 years ago)
Author:
commit-queue@webkit.org
Message:

2010-11-08 John Knottenbelt <jknotten@chromium.org>

Reviewed by Steve Block.

Convert to and from DOMTimeStamp with converter functions.
This is a refactoring only, covered by existing layout tests.
https://bugs.webkit.org/show_bug.cgi?id=49066

  • GNUmakefile.am:
  • WebCore.gypi:
  • WebCore.pro:
  • WebCore.vcproj/WebCore.vcproj:
  • WebCore.xcodeproj/project.pbxproj:
  • dom/DOMTimeStamp.h: Added. (WebCore::convertSecondsToDOMTimeStamp): (WebCore::convertDOMTimeStampToSeconds):
  • dom/Event.cpp: (WebCore::Event::Event):
  • dom/Event.h:
  • page/Geolocation.cpp: (WebCore::Geolocation::haveSuitableCachedPosition):
  • platform/android/GeolocationServiceAndroid.cpp: (WebCore::GeolocationServiceAndroid::isPositionMoreTimely):

2010-11-08 John Knottenbelt <jknotten@chromium.org>

Reviewed by Steve Block.

Convert to and from DOMTimeStamp with converter functions
https://bugs.webkit.org/show_bug.cgi?id=49066

  • src/WebDataSourceImpl.cpp: (WebKit::WebDataSourceImpl::triggeringEventTime):
Location:
trunk
Files:
1 added
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r71598 r71602  
     12010-11-08  John Knottenbelt  <jknotten@chromium.org>
     2
     3        Reviewed by Steve Block.
     4
     5        Convert to and from DOMTimeStamp with converter functions.
     6        This is a refactoring only, covered by existing layout tests.
     7        https://bugs.webkit.org/show_bug.cgi?id=49066
     8
     9        * GNUmakefile.am:
     10        * WebCore.gypi:
     11        * WebCore.pro:
     12        * WebCore.vcproj/WebCore.vcproj:
     13        * WebCore.xcodeproj/project.pbxproj:
     14        * dom/DOMTimeStamp.h: Added.
     15        (WebCore::convertSecondsToDOMTimeStamp):
     16        (WebCore::convertDOMTimeStampToSeconds):
     17        * dom/Event.cpp:
     18        (WebCore::Event::Event):
     19        * dom/Event.h:
     20        * page/Geolocation.cpp:
     21        (WebCore::Geolocation::haveSuitableCachedPosition):
     22        * platform/android/GeolocationServiceAndroid.cpp:
     23        (WebCore::GeolocationServiceAndroid::isPositionMoreTimely):
     24
    1252010-11-08  Ryosuke Niwa  <rniwa@webkit.org>
    226
  • trunk/WebCore/GNUmakefile.am

    r71562 r71602  
    11221122        WebCore/dom/DOMStringMap.cpp \
    11231123        WebCore/dom/DOMStringMap.h \
     1124        WebCore/dom/DOMTimeStamp.h \
    11241125        WebCore/dom/DynamicNodeList.cpp \
    11251126        WebCore/dom/DynamicNodeList.h \
  • trunk/WebCore/WebCore.gypi

    r71562 r71602  
    11581158            'dom/DOMStringMap.cpp',
    11591159            'dom/DOMStringMap.h',
     1160            'dom/DOMTimeStamp.h',
    11601161            'dom/DatasetDOMStringMap.cpp',
    11611162            'dom/DatasetDOMStringMap.h',
  • trunk/WebCore/WebCore.pro

    r71562 r71602  
    16231623    dom/DOMStringList.h \
    16241624    dom/DOMStringMap.h \
     1625    dom/DOMTimeStamp.h \
    16251626    dom/DatasetDOMStringMap.h \
    16261627    dom/DynamicNodeList.h \
  • trunk/WebCore/WebCore.vcproj/WebCore.vcproj

    r71562 r71602  
    4193341933                        </File>
    4193441934                        <File
     41935                                RelativePath="..\dom\DOMTimeStamp.h"
     41936                                >
     41937                        </File>
     41938                                <File
    4193541939                                RelativePath="..\dom\DynamicNodeList.cpp"
    4193641940                                >
  • trunk/WebCore/WebCore.xcodeproj/project.pbxproj

    r71562 r71602  
    3737                0014628B103CD1DE000B20DB /* OriginAccessEntry.h in Headers */ = {isa = PBXBuildFile; fileRef = 00146289103CD1DE000B20DB /* OriginAccessEntry.h */; };
    3838                003F1FEA11E6AB43008258D9 /* UserContentTypes.h in Headers */ = {isa = PBXBuildFile; fileRef = 003F1FE911E6AB43008258D9 /* UserContentTypes.h */; settings = {ATTRIBUTES = (Private, ); }; };
     39                05FD69E012845D4300B2BEB3 /* DOMTimeStamp.h in Headers */ = {isa = PBXBuildFile; fileRef = 05FD69DF12845D4300B2BEB3 /* DOMTimeStamp.h */; settings = {ATTRIBUTES = (Private, ); }; };
    3940                06027CAD0B1CBFC000884B2D /* ContextMenuItem.h in Headers */ = {isa = PBXBuildFile; fileRef = 06027CAC0B1CBFC000884B2D /* ContextMenuItem.h */; settings = {ATTRIBUTES = (Private, ); }; };
    4041                06027CB30B1CC03D00884B2D /* ContextMenuItemMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 06027CB20B1CC03D00884B2D /* ContextMenuItemMac.mm */; };
     
    60806081                00146289103CD1DE000B20DB /* OriginAccessEntry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OriginAccessEntry.h; sourceTree = "<group>"; };
    60816082                003F1FE911E6AB43008258D9 /* UserContentTypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UserContentTypes.h; sourceTree = "<group>"; };
     6083                05FD69DF12845D4300B2BEB3 /* DOMTimeStamp.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMTimeStamp.h; sourceTree = "<group>"; };
    60826084                06027CAC0B1CBFC000884B2D /* ContextMenuItem.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = ContextMenuItem.h; sourceTree = "<group>"; };
    60836085                06027CB20B1CC03D00884B2D /* ContextMenuItemMac.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = ContextMenuItemMac.mm; sourceTree = "<group>"; };
     
    1822218224                                BC64640811D7F304006455B0 /* DOMStringMap.h */,
    1822318225                                BC64647911D800CD006455B0 /* DOMStringMap.idl */,
     18226                                05FD69DF12845D4300B2BEB3 /* DOMTimeStamp.h */,
    1822418227                                BC7FA61E0D1F0CBD00DB22A9 /* DynamicNodeList.cpp */,
    1822518228                                BC7FA61F0D1F0CBD00DB22A9 /* DynamicNodeList.h */,
     
    1950119504                                85E711D90AC5D5350053270F /* DOMTextInternal.h in Headers */,
    1950219505                                188604B40F2E654A000B6443 /* DOMTimer.h in Headers */,
     19506                                05FD69E012845D4300B2BEB3 /* DOMTimeStamp.h in Headers */,
    1950319507                                76FC2B0C12370DA0006A991A /* DOMTokenList.h in Headers */,
    1950419508                                BC1A37BE097C715F0019F3D8 /* DOMTraversal.h in Headers */,
  • trunk/WebCore/dom/Event.cpp

    r68923 r71602  
    4040    , m_eventPhase(0)
    4141    , m_currentTarget(0)
    42     , m_createTime(static_cast<DOMTimeStamp>(currentTime() * 1000.0))
     42    , m_createTime(convertSecondsToDOMTimeStamp(currentTime()))
    4343{
    4444}
     
    5555    , m_eventPhase(0)
    5656    , m_currentTarget(0)
    57     , m_createTime(static_cast<DOMTimeStamp>(currentTime() * 1000.0))
     57    , m_createTime(convertSecondsToDOMTimeStamp(currentTime()))
    5858{
    5959}
  • trunk/WebCore/dom/Event.h

    r68923 r71602  
    2525#define Event_h
    2626
     27#include "DOMTimeStamp.h"
    2728#include "EventTarget.h"
    2829#include <wtf/RefCounted.h>
     
    3233
    3334    class Clipboard;
    34 
    35     // FIXME: this should probably defined elsewhere.
    36     typedef unsigned long long DOMTimeStamp;
    3735
    3836    class Event : public RefCounted<Event> {
  • trunk/WebCore/page/Geolocation.cpp

    r68769 r71602  
    391391    if (!options->maximumAge())
    392392        return false;
    393     DOMTimeStamp currentTimeMillis = currentTime() * 1000.0;
     393    DOMTimeStamp currentTimeMillis = convertSecondsToDOMTimeStamp(currentTime());
    394394    return m_positionCache->cachedPosition()->timestamp() > currentTimeMillis - options->maximumAge();
    395395}
  • trunk/WebCore/platform/android/GeolocationServiceAndroid.cpp

    r51071 r71602  
    172172{
    173173    ASSERT(position1 && position2);
    174     DOMTimeStamp currentTimeMillis = WTF::currentTime() * 1000.0;
    175     DOMTimeStamp maximumAgeMillis = 10 * 60 * 1000; // 10 minutes
    176     return currentTimeMillis - position1->timestamp() > maximumAgeMillis;
     174    DOMTimeStamp currentTime = convertSecondsToDOMTimeStamp(WTF::currentTime());
     175    DOMTimeStamp maximumAge = convertSecondsToDOMTimeStamp(10 * 60); // 10 minutes
     176    return currentTime - position1->timestamp() > maximumAge;
    177177}
    178178
  • trunk/WebKit/chromium/ChangeLog

    r71587 r71602  
     12010-11-08  John Knottenbelt  <jknotten@chromium.org>
     2
     3        Reviewed by Steve Block.
     4
     5        Convert to and from DOMTimeStamp with converter functions
     6        https://bugs.webkit.org/show_bug.cgi?id=49066
     7
     8        * src/WebDataSourceImpl.cpp:
     9        (WebKit::WebDataSourceImpl::triggeringEventTime):
     10
     11
    1122010-11-08  Pierre-Antoine LaFayette  <pierre.lafayette@gmail.com>
    213
  • trunk/WebKit/chromium/src/WebDataSourceImpl.cpp

    r67676 r71602  
    9797
    9898    // DOMTimeStamp uses units of milliseconds.
    99     return triggeringAction().event()->timeStamp() / 1000.0;
     99    return convertDOMTimeStampToSeconds(triggeringAction().event()->timeStamp());
    100100}
    101101
Note: See TracChangeset for help on using the changeset viewer.