bool GeolocationServiceAndroid::isPositionMoreTimely(Geoposition* position1, Geoposition* position2)
{
    ASSERT(position1 && position2);
    DOMTimeStamp currentTime = convertSecondsToDOMTimeStamp(WTF::currentTime());
    DOMTimeStamp maximumAge = convertSecondsToDOMTimeStamp(10 * 60); // 10 minutes
    return currentTime - position1->timestamp() > maximumAge;
}
Пример #2
0
static RefPtr<Geoposition> createGeoposition(Optional<GeolocationPosition>&& position)
{
    if (!position)
        return nullptr;
    
    DOMTimeStamp timestamp = convertSecondsToDOMTimeStamp(position->timestamp);
    return Geoposition::create(Coordinates::create(WTFMove(position.value())), timestamp);
}
Пример #3
0
Event::Event(const AtomicString& eventType, const EventInit& initializer)
    : m_isInitialized(true)
    , m_type(eventType)
    , m_canBubble(initializer.bubbles)
    , m_cancelable(initializer.cancelable)
    , m_createTime(convertSecondsToDOMTimeStamp(currentTime()))
{
}
Пример #4
0
Event::Event(const AtomicString& eventType, bool canBubbleArg, bool cancelableArg, double timestamp)
    : m_isInitialized(true)
    , m_type(eventType)
    , m_canBubble(canBubbleArg)
    , m_cancelable(cancelableArg)
    , m_createTime(convertSecondsToDOMTimeStamp(timestamp))
{
}
Пример #5
0
Event::Event(const AtomicString& eventType, bool canBubbleArg, bool cancelableArg)
    : m_type(eventType)
    , m_isInitialized(true)
    , m_canBubble(canBubbleArg)
    , m_cancelable(cancelableArg)
    , m_isTrusted(true)
    , m_createTime(convertSecondsToDOMTimeStamp(currentTime()))
{
}
Пример #6
0
void LayerTreeCoordinator::syncDisplayState()
{
#if ENABLE(REQUEST_ANIMATION_FRAME) && !USE(REQUEST_ANIMATION_FRAME_TIMER) && !USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR)
    // Make sure that any previously registered animation callbacks are being executed before we flush the layers.
    m_webPage->corePage()->mainFrame()->view()->serviceScriptedAnimations(convertSecondsToDOMTimeStamp(currentTime()));
#endif

    m_webPage->layoutIfNeeded();
}
Пример #7
0
bool Geolocation::haveSuitableCachedPosition(const PositionOptions& options) {
  if (!m_lastPosition)
    return false;
  DCHECK(isAllowed());
  if (!options.maximumAge())
    return false;
  DOMTimeStamp currentTimeMillis = convertSecondsToDOMTimeStamp(currentTime());
  return m_lastPosition->timestamp() > currentTimeMillis - options.maximumAge();
}
Пример #8
0
bool Geolocation::haveSuitableCachedPosition(const PositionOptions& options)
{
    Geoposition* cachedPosition = lastPosition();
    if (!cachedPosition)
        return false;
    if (!options.maximumAge)
        return false;
    DOMTimeStamp currentTimeMillis = convertSecondsToDOMTimeStamp(WallTime::now().secondsSinceEpoch());
    return cachedPosition->timestamp() > currentTimeMillis - options.maximumAge;
}
Пример #9
0
static PassRefPtr<Geoposition> createGeoposition(GeolocationPosition* position)
{
    if (!position)
        return 0;
    
    RefPtr<Coordinates> coordinates = Coordinates::create(position->latitude(), position->longitude(), position->canProvideAltitude(), position->altitude(), 
                                                          position->accuracy(), position->canProvideAltitudeAccuracy(), position->altitudeAccuracy(),
                                                          position->canProvideHeading(), position->heading(), position->canProvideSpeed(), position->speed());
    return Geoposition::create(coordinates.release(), convertSecondsToDOMTimeStamp(position->timestamp()));
}
Пример #10
0
void PageWidgetDelegate::animate(Page* page, double monotonicFrameBeginTime)
{
#if ENABLE(REQUEST_ANIMATION_FRAME)
    FrameView* view = mainFrameView(page);
    if (!view)
        return;
    double timeShift = currentTime() - monotonicallyIncreasingTime();
    view->serviceScriptedAnimations(convertSecondsToDOMTimeStamp(monotonicFrameBeginTime + timeShift));
#endif
}
Пример #11
0
bool Geolocation::haveSuitableCachedPosition(PositionOptions* options)
{
    if (!m_cachedPosition)
        return false;
    if (!options->hasMaximumAge())
        return true;
    if (!options->maximumAge())
        return false;
    DOMTimeStamp currentTimeMillis = convertSecondsToDOMTimeStamp(currentTime());
    return m_cachedPosition->timestamp() > currentTimeMillis - options->maximumAge();
}
Пример #12
0
Event::Event()
    : m_canBubble(false)
    , m_cancelable(false)
    , m_propagationStopped(false)
    , m_immediatePropagationStopped(false)
    , m_defaultPrevented(false)
    , m_defaultHandled(false)
    , m_cancelBubble(false)
    , m_eventPhase(0)
    , m_currentTarget(0)
    , m_createTime(convertSecondsToDOMTimeStamp(currentTime()))
{
}
Пример #13
0
Event::Event(const AtomicString& eventType, const EventInit& initializer)
    : m_type(eventType)
    , m_canBubble(initializer.bubbles)
    , m_cancelable(initializer.cancelable)
    , m_propagationStopped(false)
    , m_immediatePropagationStopped(false)
    , m_defaultPrevented(false)
    , m_defaultHandled(false)
    , m_cancelBubble(false)
    , m_eventPhase(0)
    , m_currentTarget(0)
    , m_createTime(convertSecondsToDOMTimeStamp(currentTime()))
{
}
Пример #14
0
Event::Event(const AtomicString& eventType, bool canBubbleArg, bool cancelableArg)
    : m_type(eventType)
    , m_canBubble(canBubbleArg)
    , m_cancelable(cancelableArg)
    , m_propagationStopped(false)
    , m_immediatePropagationStopped(false)
    , m_defaultPrevented(false)
    , m_defaultHandled(false)
    , m_cancelBubble(false)
    , m_eventPhase(0)
    , m_currentTarget(0)
    , m_createTime(convertSecondsToDOMTimeStamp(currentTime()))
{
}
Пример #15
0
static Geoposition* createGeoposition(GeolocationPosition* position)
{
    if (!position)
        return nullptr;

    Coordinates* coordinates = Coordinates::create(
        position->latitude(),
        position->longitude(),
        position->canProvideAltitude(),
        position->altitude(),
        position->accuracy(),
        position->canProvideAltitudeAccuracy(),
        position->altitudeAccuracy(),
        position->canProvideHeading(),
        position->heading(),
        position->canProvideSpeed(),
        position->speed());
    return Geoposition::create(coordinates, convertSecondsToDOMTimeStamp(position->timestamp()));
}
Пример #16
0
Event::Event()
    : m_createTime(convertSecondsToDOMTimeStamp(currentTime()))
{
}
Пример #17
0
void ScriptedAnimationController::animationTimerFired(Timer<ScriptedAnimationController>*)
{
    m_lastAnimationFrameTime = currentTime();
    serviceScriptedAnimations(convertSecondsToDOMTimeStamp(m_lastAnimationFrameTime));
}
Пример #18
0
void ChromeClientQt::serviceScriptedAnimations()
{
    m_webPage->mainFrame()->d->frame->view()->serviceScriptedAnimations(convertSecondsToDOMTimeStamp(currentTime()));
}