| | 130 | Summary: With [CallWith], a WebCore method is called with additional information. |
| | 131 | |
| | 132 | Usage: The possible usage is [CallWith=X1|X2|X3|...], where X1, X2, X3, ... is "ScriptExecutionContext", "ScriptState", "ScriptArguments" or "CallStack". |
| | 133 | "ScriptExecutionContext", "ScriptState" and "CallStack" can be specified on methods or attributes, |
| | 134 | but "ScriptArguments" can be specified on methods only: |
| | 135 | {{{ |
| | 136 | interface HTMLFoo { |
| | 137 | attribute [CallWith=ScriptExecutionContext] DOMString str; |
| | 138 | [CallWith=ScriptExecutionContext] void func1(in int a, in int b); |
| | 139 | [CallWith=ScriptState] void func2(in int a, in int b); |
| | 140 | [CallWith=ScriptArguments|CallStack] void func3(in int a, in int b); |
| | 141 | [CallWith=CallStack|ScriptArguments] void func4(in int a, in int b); |
| | 142 | } |
| | 143 | }}} |
| | 144 | |
| | 145 | In case of func1(...), HTMLFoo::func1(ScriptExecutionContext* context, int a, int b) is called. |
| | 146 | Thus, in HTMLFoo::func1(...) you can retrieve document or window through context. |
| | 147 | |
| | 148 | In case of func2(...), HTMLFoo::func2(ScriptState* state, int a, int b) is called. |
| | 149 | |
| | 150 | In case of func3(...), HTMLFoo::func3(ScriptArguments* arguments, ScriptCallStack* callstack, int a, int b) is called. |
| | 151 | |
| | 152 | In this way, the additional information is added at the head of normal arguments. |
| | 153 | The order of additional information is "ScriptExecutionContext", "ScriptState", "ScriptArguments", and then "CallStack", |
| | 154 | despite the order of [CallWith=X1|X2|X3|...]. Thus, in case of func4(...), |
| | 155 | HTMLFoo::func3(ScriptArguments* arguments, ScriptCallStack* callstack, int a, int b) is called. |
| | 156 | |