Ignore:
Timestamp:
12/28/08 02:05:59 (6 years ago)
Author:
ap@webkit.org
Message:

2008-12-28 Dmitry Titov <dimich@chromium.org>

Reviewed by Darin Adler.

https://bugs.webkit.org/show_bug.cgi?id=22755
Prepare to add create/remove timeout methods to JSWorkerContext by moving
timer-specific code from JSDOMWindowBase to DOMTimer.
Moved everything JS-related from DOMTimer to ScheduledAction.
Now ScheduledAction is what it wanted to be all the time: a JS engine-specific
container for timer callback that knows how to invoke it.
DOMTimer is not anymore JS-specific.

This is mostly moving the code around. No intended functional changes.

  • bindings/js/DOMTimer.cpp: (WebCore::DOMTimer::DOMTimer): (WebCore::DOMTimer::~DOMTimer): (WebCore::DOMTimer::install): (WebCore::DOMTimer::removeById): (WebCore::DOMTimer::fired): (WebCore::DOMTimer::stop):
  • bindings/js/DOMTimer.h:
  • bindings/js/JSDOMWindowBase.cpp: (WebCore::JSDOMWindowBase::installTimeout): (WebCore::JSDOMWindowBase::removeTimeout):
  • bindings/js/JSDOMWindowBase.h:
  • bindings/js/ScheduledAction.cpp: (WebCore::ScheduledAction::execute):
  • bindings/js/ScheduledAction.h:
  • dom/Document.cpp: (WebCore::Document::addTimeout):
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/bindings/js/ScheduledAction.cpp

    r38610 r39489  
    3232#include "JSDOMWindow.h" 
    3333#include "ScriptController.h" 
     34#include "ScriptExecutionContext.h" 
    3435#include "ScriptValue.h" 
    3536#include <runtime/JSLock.h> 
     
    4546    for (ArgList::const_iterator it = args.begin(); it != end; ++it) 
    4647        m_args.append((*it).jsValue(exec)); 
     48} 
     49 
     50void ScheduledAction::execute(ScriptExecutionContext* context) 
     51{ 
     52    // FIXME: make it work with Workers SEC too. 
     53    ASSERT(context->isDocument()); 
     54    Document* document = static_cast<Document*>(context); 
     55    if (JSDOMWindow* window = toJSDOMWindow(document->frame())) 
     56        execute(window->shell()); 
    4757} 
    4858 
Note: See TracChangeset for help on using the changeset viewer.