~ubuntu-branches/ubuntu/karmic/webkit/karmic-proposed

« back to all changes in this revision

Viewing changes to WebCore/bindings/js/ScheduledAction.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Gustavo Noronha Silva
  • Date: 2009-05-15 18:30:58 UTC
  • mto: (4.4.1 sid) (1.2.2 upstream) (16.1.1 lucid)
  • mto: This revision was merged to the branch mainline in revision 8.
  • Revision ID: james.westby@ubuntu.com-20090515183058-35m5or0ufm5tutud
Tags: upstream-1.1.7
ImportĀ upstreamĀ versionĀ 1.1.7

Show diffs side-by-side

added added

removed removed

Lines of Context:
49
49
 
50
50
ScheduledAction* ScheduledAction::create(ExecState* exec, const ArgList& args)
51
51
{
52
 
    JSValuePtr v = args.at(exec, 0);
53
 
    if (v.isString())
54
 
        return new ScheduledAction(asString(v)->value());
 
52
    JSValue v = args.at(0);
55
53
    CallData callData;
56
 
    if (v.getCallData(callData) == CallTypeNone)
57
 
        return 0;
 
54
    if (v.getCallData(callData) == CallTypeNone) {
 
55
        UString string = v.toString(exec);
 
56
        if (exec->hadException())
 
57
            return 0;
 
58
        return new ScheduledAction(string);
 
59
    }
58
60
    ArgList argsTail;
59
61
    args.getSlice(2, argsTail);
60
 
    return new ScheduledAction(exec, v, argsTail);
 
62
    return new ScheduledAction(v, argsTail);
61
63
}
62
64
 
63
 
ScheduledAction::ScheduledAction(ExecState* exec, JSValuePtr function, const ArgList& args)
 
65
ScheduledAction::ScheduledAction(JSValue function, const ArgList& args)
64
66
    : m_function(function)
65
67
{
66
68
    ArgList::const_iterator end = args.end();
67
69
    for (ArgList::const_iterator it = args.begin(); it != end; ++it)
68
 
        m_args.append((*it).jsValue(exec));
 
70
        m_args.append(*it);
69
71
}
70
72
 
71
73
void ScheduledAction::execute(ScriptExecutionContext* context)
82
84
#endif
83
85
}
84
86
 
85
 
void ScheduledAction::executeFunctionInContext(JSGlobalObject* globalObject, JSValuePtr thisValue)
 
87
void ScheduledAction::executeFunctionInContext(JSGlobalObject* globalObject, JSValue thisValue)
86
88
{
87
89
    ASSERT(m_function);
88
90
    JSLock lock(false);
94
96
 
95
97
    ExecState* exec = globalObject->globalExec();
96
98
 
97
 
    ArgList args;
 
99
    MarkedArgumentBuffer args;
98
100
    size_t size = m_args.size();
99
101
    for (size_t i = 0; i < size; ++i)
100
102
        args.append(m_args[i]);