~oif-team/ubuntu/natty/qt4-x11/xi2.1

« back to all changes in this revision

Viewing changes to src/3rdparty/webkit/WebCore/bindings/js/ScheduledAction.h

  • Committer: Bazaar Package Importer
  • Author(s): Alessandro Ghersi
  • Date: 2009-11-02 18:30:08 UTC
  • mfrom: (1.2.2 upstream)
  • mto: (15.2.5 experimental)
  • mto: This revision was merged to the branch mainline in revision 88.
  • Revision ID: james.westby@ubuntu.com-20091102183008-b6a4gcs128mvfb3m
Tags: upstream-4.6.0~beta1
ImportĀ upstreamĀ versionĀ 4.6.0~beta1

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
2
 *  Copyright (C) 2000 Harri Porten (porten@kde.org)
3
 
 *  Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reseved.
 
3
 *  Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reseved.
4
4
 *
5
5
 *  This library is free software; you can redistribute it and/or
6
6
 *  modify it under the terms of the GNU Lesser General Public
24
24
#include <runtime/Protect.h>
25
25
#include <wtf/Vector.h>
26
26
 
 
27
namespace JSC {
 
28
    class JSGlobalObject;
 
29
}
 
30
 
27
31
namespace WebCore {
28
32
 
29
 
    class JSDOMWindowShell;
 
33
    class Document;
30
34
    class ScriptExecutionContext;
 
35
    class WorkerContext;
31
36
 
32
37
   /* An action (either function or string) to be executed after a specified
33
38
    * time interval, either once or repeatedly. Used for window.setTimeout()
35
40
    */
36
41
    class ScheduledAction {
37
42
    public:
38
 
        ScheduledAction(JSC::ExecState* exec, JSC::JSValuePtr function, const JSC::ArgList&);
 
43
        static ScheduledAction* create(JSC::ExecState*, const JSC::ArgList&);
 
44
 
 
45
        void execute(ScriptExecutionContext*);
 
46
 
 
47
    private:
 
48
        ScheduledAction(JSC::JSValue function, const JSC::ArgList&);
39
49
        ScheduledAction(const String& code)
40
50
            : m_code(code)
41
51
        {
42
52
        }
43
 
         
44
 
        void execute(ScriptExecutionContext*);
45
 
 
46
 
    private:
47
 
        void execute(JSDOMWindowShell*);
48
 
 
49
 
        JSC::ProtectedJSValuePtr m_function;
50
 
        Vector<JSC::ProtectedJSValuePtr> m_args;
 
53
 
 
54
        void executeFunctionInContext(JSC::JSGlobalObject*, JSC::JSValue thisValue);
 
55
        void execute(Document*);
 
56
#if ENABLE(WORKERS)        
 
57
        void execute(WorkerContext*);
 
58
#endif
 
59
 
 
60
        JSC::ProtectedJSValue m_function;
 
61
        Vector<JSC::ProtectedJSValue> m_args;
51
62
        String m_code;
52
63
    };
53
64