Changeset 97831 in webkit


Ignore:
Timestamp:
Oct 18, 2011 9:32:28 PM (13 years ago)
Author:
jnd@chromium.org
Message:

Source/WebCore: Implement NSProcessInfo::systemUptime on Mac Leopard.
https://bugs.webkit.org/show_bug.cgi?id=66577

Reviewed by Tony Chang.

  • WebCore.gyp/WebCore.gyp:
  • platform/chromium/ScrollAnimatorChromiumMac.mm:

(-[NSProcessInfo systemUptime]):

LayoutTests: Enable touch tests on Mac Leopard.
https://bugs.webkit.org/show_bug.cgi?id=66577

Reviewed by Tony Chang.

  • platform/chromium/test_expectations.txt:
Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r97828 r97831  
     12011-10-18  Johnny Ding  <jnd@chromium.org>
     2
     3        Enable touch tests on Mac Leopard.
     4        https://bugs.webkit.org/show_bug.cgi?id=66577
     5
     6        Reviewed by Tony Chang.
     7
     8        * platform/chromium/test_expectations.txt:
     9
    1102011-10-18  Ojan Vafai  <ojan@chromium.org>
    211
  • trunk/LayoutTests/platform/chromium/test_expectations.txt

    r97828 r97831  
    34753475BUGWK66569 SLOW LINUX WIN DEBUG : http/tests/inspector/network/network-iframe-load-and-delete.html = PASS
    34763476
    3477 BUGWK66577 LEOPARD : fast/events/touch/basic-single-touch-events.html = TIMEOUT
    3478 BUGWK66577 LEOPARD : fast/events/touch/multi-touch-grouped-targets.html = TIMEOUT
    3479 BUGWK66577 LEOPARD : fast/events/touch/touch-gesture-scroll.html = TIMEOUT
    3480 BUGWK66577 LEOPARD : fast/events/touch/touch-target-limited.html = TIMEOUT
    3481 BUGWK66577 LEOPARD : fast/events/touch/touch-target.html = TIMEOUT
    3482 BUGWK66577 LEOPARD : fast/events/touch/tap-highlight-color.html = TIMEOUT
    3483 
    34843477BUGV8_1634 : fast/js/const.html = TEXT
    34853478
  • trunk/Source/WebCore/ChangeLog

    r97823 r97831  
     12011-10-18  Johnny Ding  <jnd@chromium.org>
     2
     3        Implement NSProcessInfo::systemUptime on Mac Leopard.
     4        https://bugs.webkit.org/show_bug.cgi?id=66577
     5
     6        Reviewed by Tony Chang.
     7
     8        * WebCore.gyp/WebCore.gyp:
     9        * platform/chromium/ScrollAnimatorChromiumMac.mm:
     10        (-[NSProcessInfo systemUptime]):
     11
    1122011-10-18  Sam Weinig  <sam@webkit.org>
    213
  • trunk/Source/WebCore/WebCore.gyp/WebCore.gyp

    r97493 r97831  
    12511251                      'ChromiumWebCoreObjC|TCMVisibleView|RTCMFlippedView',
    12521252                  'category_whitelist_regex':
    1253                       'TCMInterposing',
     1253                      'TCMInterposing|ScrollAnimatorChromiumMacExt',
    12541254                },
    12551255                'action': [
  • trunk/Source/WebCore/platform/chromium/ScrollAnimatorChromiumMac.mm

    r97227 r97831  
    2626#include "config.h"
    2727
     28#include <sys/time.h>
     29#include <sys/sysctl.h>
     30
    2831#include "ScrollAnimatorChromiumMac.h"
    2932
     
    4750@end
    4851
    49 @interface NSProcessInfo (NSObject)
     52@interface NSProcessInfo (ScrollAnimatorChromiumMacExt)
    5053- (NSTimeInterval)systemUptime;
     54@end
     55
     56@implementation NSProcessInfo (ScrollAnimatorChromiumMacExt)
     57- (NSTimeInterval)systemUptime
     58{
     59    // Get how long system has been up. Found by looking getting "boottime" from the kernel.
     60    static struct timeval boottime = {0};
     61    if (!boottime.tv_sec) {
     62        int mib[2] = {CTL_KERN, KERN_BOOTTIME};
     63        size_t size = sizeof(boottime);
     64        if (-1 == sysctl(mib, 2, &boottime, &size, 0, 0))
     65            boottime.tv_sec = 0;
     66    }
     67    struct timeval now;
     68    if (boottime.tv_sec && -1 != gettimeofday(&now, 0)) {
     69        struct timeval uptime;
     70        timersub(&now, &boottime, &uptime);
     71        NSTimeInterval result = uptime.tv_sec + (uptime.tv_usec / 1E+6);
     72        return result;
     73    }
     74    return 0;
     75}
    5176@end
    5277#endif
Note: See TracChangeset for help on using the changeset viewer.