Changeset 46324 in webkit


Ignore:
Timestamp:
Jul 24, 2009 12:28:44 AM (15 years ago)
Author:
abarth@webkit.org
Message:

2009-07-24 Mike Fenton <mike.fenton@torchmobile.com>

Reviewed by Eric Seidel.

Update WebCore/page/DOMTimer.cpp/h to conform to WebKit
Style Guidelines as identified by cpplint.py.
https://bugs.webkit.org/show_bug.cgi?id=27618

  • page/DOMTimer.cpp: (WebCore::DOMTimer::DOMTimer): (WebCore::DOMTimer::~DOMTimer): (WebCore::DOMTimer::fired): (WebCore::DOMTimer::suspend): (WebCore::DOMTimer::resume): (WebCore::DOMTimer::canSuspend):
  • page/DOMTimer.h: (WebCore::DOMTimer::minTimerInterval): (WebCore::DOMTimer::setMinTimerInterval):
Location:
trunk/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r46322 r46324  
     12009-07-24  Mike Fenton  <mike.fenton@torchmobile.com>
     2
     3        Reviewed by Eric Seidel.
     4
     5        Update WebCore/page/DOMTimer.cpp/h to conform to WebKit
     6        Style Guidelines as identified by cpplint.py.
     7        https://bugs.webkit.org/show_bug.cgi?id=27618
     8
     9        * page/DOMTimer.cpp:
     10        (WebCore::DOMTimer::DOMTimer):
     11        (WebCore::DOMTimer::~DOMTimer):
     12        (WebCore::DOMTimer::fired):
     13        (WebCore::DOMTimer::suspend):
     14        (WebCore::DOMTimer::resume):
     15        (WebCore::DOMTimer::canSuspend):
     16        * page/DOMTimer.h:
     17        (WebCore::DOMTimer::minTimerInterval):
     18        (WebCore::DOMTimer::setMinTimerInterval):
     19
    1202009-07-24  Eric Seidel  <eric@webkit.org>
    221
  • trunk/WebCore/page/DOMTimer.cpp

    r41878 r46324  
    5555        lastUsedTimeoutId = 1;
    5656    m_timeoutId = lastUsedTimeoutId;
    57    
     57
    5858    m_nestingLevel = timerNestingLevel + 1;
    5959
     
    7575DOMTimer::~DOMTimer()
    7676{
    77     if (scriptExecutionContext()) {
     77    if (scriptExecutionContext())
    7878        scriptExecutionContext()->removeTimeout(m_timeoutId);
    79     }
    8079}
    81    
     80
    8281int DOMTimer::install(ScriptExecutionContext* context, ScheduledAction* action, int timeout, bool singleShot)
    8382{
     
    111110                augmentRepeatInterval(s_minTimerInterval - repeatInterval());
    112111        }
    113        
     112
    114113        // No access to member variables after this point, it can delete the timer.
    115114        m_action->execute(context);
     
    122121    // No access to member variables after this point.
    123122    delete this;
    124    
     123
    125124    action->execute(context);
    126125    delete action;
     
    148147}
    149148
    150 void DOMTimer::suspend() 
    151 { 
    152     ASSERT(m_nextFireInterval == 0 && m_repeatInterval == 0);
     149void DOMTimer::suspend()
     150{
     151    ASSERT(!m_nextFireInterval && !m_repeatInterval);
    153152    m_nextFireInterval = nextFireInterval();
    154153    m_repeatInterval = repeatInterval();
    155154    TimerBase::stop();
    156 } 
    157  
    158 void DOMTimer::resume() 
    159 { 
     155}
     156
     157void DOMTimer::resume()
     158{
    160159    start(m_nextFireInterval, m_repeatInterval);
    161160    m_nextFireInterval = 0;
    162161    m_repeatInterval = 0;
    163 } 
    164  
    165  
    166 bool DOMTimer::canSuspend() const 
    167 { 
     162}
     163
     164
     165bool DOMTimer::canSuspend() const
     166{
    168167    return true;
    169168}
  • trunk/WebCore/page/DOMTimer.h

    r41878 r46324  
    3434namespace WebCore {
    3535
    36 class ScheduledAction;
     36    class ScheduledAction;
    3737
    38 class DOMTimer : public TimerBase, public ActiveDOMObject {
    39 public:
    40     virtual ~DOMTimer();
    41     // Creates a new timer owned by specified ScriptExecutionContext, starts it
    42     // and returns its Id.
    43     static int install(ScriptExecutionContext*, ScheduledAction*, int timeout, bool singleShot);
    44     static void removeById(ScriptExecutionContext*, int timeoutId);
     38    class DOMTimer : public TimerBase, public ActiveDOMObject {
     39    public:
     40        virtual ~DOMTimer();
     41        // Creates a new timer owned by specified ScriptExecutionContext, starts it
     42        // and returns its Id.
     43        static int install(ScriptExecutionContext*, ScheduledAction*, int timeout, bool singleShot);
     44        static void removeById(ScriptExecutionContext*, int timeoutId);
    4545
    46     // ActiveDOMObject
    47     virtual bool hasPendingActivity() const;
    48     virtual void contextDestroyed();
    49     virtual void stop();
    50     virtual bool canSuspend() const;
    51     virtual void suspend();
    52     virtual void resume();
     46        // ActiveDOMObject
     47        virtual bool hasPendingActivity() const;
     48        virtual void contextDestroyed();
     49        virtual void stop();
     50        virtual bool canSuspend() const;
     51        virtual void suspend();
     52        virtual void resume();
    5353
    54     // The lowest allowable timer setting (in seconds, 0.001 == 1 ms).
    55     // Default is 10ms.
    56     // Chromium uses a non-default timeout.
    57     static double minTimerInterval() { return s_minTimerInterval; }
    58     static void setMinTimerInterval(double value) { s_minTimerInterval = value; }
     54        // The lowest allowable timer setting (in seconds, 0.001 == 1 ms).
     55        // Default is 10ms.
     56        // Chromium uses a non-default timeout.
     57        static double minTimerInterval() { return s_minTimerInterval; }
     58        static void setMinTimerInterval(double value) { s_minTimerInterval = value; }
    5959
    60 private:
    61     DOMTimer(ScriptExecutionContext*, ScheduledAction*, int timeout, bool singleShot);
    62     virtual void fired();
     60    private:
     61        DOMTimer(ScriptExecutionContext*, ScheduledAction*, int timeout, bool singleShot);
     62        virtual void fired();
    6363
    64     int m_timeoutId;
    65     int m_nestingLevel;
    66     OwnPtr<ScheduledAction> m_action;
    67     double m_nextFireInterval;
    68     double m_repeatInterval;
    69     static double s_minTimerInterval;
    70 };
     64        int m_timeoutId;
     65        int m_nestingLevel;
     66        OwnPtr<ScheduledAction> m_action;
     67        double m_nextFireInterval;
     68        double m_repeatInterval;
     69        static double s_minTimerInterval;
     70    };
    7171
    7272} // namespace WebCore
Note: See TracChangeset for help on using the changeset viewer.