#ifndef ScheduledAction_h
#define ScheduledAction_h
#include "PlatformString.h"
#include <JSDOMBinding.h>
#include <runtime/JSCell.h>
#include <runtime/Protect.h>
#include <wtf/PassOwnPtr.h>
#include <wtf/Vector.h>
namespace JSC {
class JSGlobalObject;
}
namespace WebCore {
class Document;
class ScriptExecutionContext;
class WorkerContext;
class ScheduledAction : public Noncopyable {
public:
static PassOwnPtr<ScheduledAction> create(JSC::ExecState*, const JSC::ArgList&, DOMWrapperWorld* isolatedWorld);
void execute(ScriptExecutionContext*);
private:
ScheduledAction(JSC::JSValue function, const JSC::ArgList&, DOMWrapperWorld* isolatedWorld);
ScheduledAction(const String& code, DOMWrapperWorld* isolatedWorld)
: m_code(code)
, m_isolatedWorld(isolatedWorld)
{
}
void executeFunctionInContext(JSC::JSGlobalObject*, JSC::JSValue thisValue);
void execute(Document*);
#if ENABLE(WORKERS)
void execute(WorkerContext*);
#endif
JSC::ProtectedJSValue m_function;
Vector<JSC::ProtectedJSValue> m_args;
String m_code;
RefPtr<DOMWrapperWorld> m_isolatedWorld;
};
}
#endif // ScheduledAction_h