当前位置: 首页>>代码示例>>C++>>正文


C++ DOMTimer类代码示例

本文整理汇总了C++中DOMTimer的典型用法代码示例。如果您正苦于以下问题:C++ DOMTimer类的具体用法?C++ DOMTimer怎么用?C++ DOMTimer使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了DOMTimer类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: didChangeTimerAlignmentInterval

void ScriptExecutionContext::didChangeTimerAlignmentInterval()
{
    for (TimeoutMap::iterator iter = m_timeouts.begin(); iter != m_timeouts.end(); ++iter) {
        DOMTimer* timer = iter->value;
        timer->didChangeAlignmentInterval();
    }
}
开发者ID:,项目名称:,代码行数:7,代码来源:

示例2: adjustMinimumTimerInterval

void ScriptExecutionContext::adjustMinimumTimerInterval(double oldMinimumTimerInterval)
{
    if (minimumTimerInterval() != oldMinimumTimerInterval) {
        for (TimeoutMap::iterator iter = m_timeouts.begin(); iter != m_timeouts.end(); ++iter) {
            DOMTimer* timer = iter->second;
            timer->adjustMinimumTimerInterval(oldMinimumTimerInterval);
        }
    }
}
开发者ID:DreamOnTheGo,项目名称:src,代码行数:9,代码来源:ScriptExecutionContext.cpp

示例3: removeByID

void DOMTimer::removeByID(ExecutionContext* context, int timeoutID)
{
    DOMTimer* timer = context->timers()->removeTimeoutByID(timeoutID);
    TRACE_EVENT_INSTANT1("devtools.timeline", "TimerRemove", TRACE_EVENT_SCOPE_THREAD, "data", InspectorTimerRemoveEvent::data(context, timeoutID));
    InspectorInstrumentation::NativeBreakpoint nativeBreakpoint(context, "clearTimer", true);
    // Eagerly unregister as ExecutionContext observer.
    if (timer)
        timer->clearContext();
}
开发者ID:endlessm,项目名称:chromium-browser,代码行数:9,代码来源:DOMTimer.cpp

示例4: removeTimeoutByID

DOMTimer* DOMTimerCoordinator::removeTimeoutByID(int timeoutID) {
  if (timeoutID <= 0)
    return nullptr;

  DOMTimer* removedTimer = m_timers.take(timeoutID);
  if (removedTimer)
    removedTimer->stop();

  return removedTimer;
}
开发者ID:mirror,项目名称:chromium,代码行数:10,代码来源:DOMTimerCoordinator.cpp

示例5: DOMTimer

int DOMTimer::install(ScriptExecutionContext* context, PassOwnPtr<ScheduledAction> action, int timeout, bool singleShot)
{
    // DOMTimer constructor links the new timer into a list of ActiveDOMObjects held by the 'context'.
    // The timer is deleted when context is deleted (DOMTimer::contextDestroyed) or explicitly via DOMTimer::removeById(),
    // or if it is a one-time timer and it has fired (DOMTimer::fired).
    DOMTimer* timer = new DOMTimer(context, action, timeout, singleShot);

    timer->suspendIfNeeded();
    InspectorInstrumentation::didInstallTimer(context, timer->m_timeoutId, timeout, singleShot);

    return timer->m_timeoutId;
}
开发者ID:jiezh,项目名称:h5vcc,代码行数:12,代码来源:DOMTimer.cpp

示例6: ASSERT

int DOMTimerCoordinator::installNewTimeout(ExecutionContext* context, ScheduledAction* action, int timeout, bool singleShot)
{
    // FIXME: DOMTimers depends heavily on ExecutionContext. Decouple them.
    ASSERT(context->timers() == this);
    int timeoutID = nextID();
    TimeoutMap::AddResult result = m_timers.add(timeoutID, DOMTimer::create(context, action, timeout, singleShot, timeoutID));
    ASSERT(result.isNewEntry);
    DOMTimer* timer = result.storedValue->value.get();

    timer->suspendIfNeeded();

    return timeoutID;
}
开发者ID:endlessm,项目名称:chromium-browser,代码行数:13,代码来源:DOMTimerCoordinator.cpp

示例7: while

int ExecutionContext::installNewTimeout(PassOwnPtr<ScheduledAction> action, int timeout, bool singleShot)
{
    int timeoutID;
    while (true) {
        timeoutID = circularSequentialID();
        if (!m_timeouts.contains(timeoutID))
            break;
    }
    TimeoutMap::AddResult result = m_timeouts.add(timeoutID, DOMTimer::create(this, action, timeout, singleShot, timeoutID));
    ASSERT(result.isNewEntry);
    DOMTimer* timer = result.storedValue->value.get();

    timer->suspendIfNeeded();

    return timer->timeoutID();
}
开发者ID:glenkim-dev,项目名称:blink-crosswalk,代码行数:16,代码来源:ExecutionContext.cpp

示例8: DOMTimer

int DOMTimer::install(ScriptExecutionContext* context, PassOwnPtr<ScheduledAction> action, int timeout, bool singleShot)
{
    // DOMTimer constructor links the new timer into a list of ActiveDOMObjects held by the 'context'.
    // The timer is deleted when context is deleted (DOMTimer::contextDestroyed) or explicitly via DOMTimer::removeById(),
    // or if it is a one-time timer and it has fired (DOMTimer::fired).
    DOMTimer* timer = new DOMTimer(context, action, timeout, singleShot);
#if PLATFORM(IOS)
    if (context->isDocument()) {
        Document& document = toDocument(*context);
        bool didDeferTimeout = document.frame() && document.frame()->timersPaused();
        if (!didDeferTimeout && timeout <= 100 && singleShot) {
            WKSetObservedContentChange(WKContentIndeterminateChange);
            WebThreadAddObservedContentModifier(timer); // Will only take affect if not already visibility change.
        }
    }
#endif

    timer->suspendIfNeeded();
    InspectorInstrumentation::didInstallTimer(context, timer->m_timeoutId, timeout, singleShot);

    return timer->m_timeoutId;
}
开发者ID:CannedFish,项目名称:webkitgtk,代码行数:22,代码来源:DOMTimer.cpp

示例9: DOMTimer

int DOMTimer::install(ScriptExecutionContext* context, std::unique_ptr<ScheduledAction> action, int timeout, bool singleShot)
{
    // DOMTimer constructor passes ownership of the initial ref on the object to the constructor.
    // This reference will be released automatically when a one-shot timer fires, when the context
    // is destroyed, or if explicitly cancelled by removeById. 
    DOMTimer* timer = new DOMTimer(context, WTF::move(action), timeout, singleShot);
#if PLATFORM(IOS)
    if (context->isDocument()) {
        Document& document = toDocument(*context);
        bool didDeferTimeout = document.frame() && document.frame()->timersPaused();
        if (!didDeferTimeout && timeout <= 100 && singleShot) {
            WKSetObservedContentChange(WKContentIndeterminateChange);
            WebThreadAddObservedContentModifier(timer); // Will only take affect if not already visibility change.
        }
    }
#endif

    timer->suspendIfNeeded();
    InspectorInstrumentation::didInstallTimer(context, timer->m_timeoutId, timeout, singleShot);

    return timer->m_timeoutId;
}
开发者ID:highweb-project,项目名称:highweb-parallelwebkit,代码行数:22,代码来源:DOMTimer.cpp


注:本文中的DOMTimer类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。