| Index: Source/bindings/v8/custom/V8WorkerGlobalScopeCustom.cpp
|
| diff --git a/Source/bindings/v8/custom/V8WorkerGlobalScopeCustom.cpp b/Source/bindings/v8/custom/V8WorkerGlobalScopeCustom.cpp
|
| index 53ee451d9b0a5bb74fecba287bc4119bcbef9a4f..11cadb38731fad9ff8fbbbc8c88b053363d88f3f 100644
|
| --- a/Source/bindings/v8/custom/V8WorkerGlobalScopeCustom.cpp
|
| +++ b/Source/bindings/v8/custom/V8WorkerGlobalScopeCustom.cpp
|
| @@ -48,7 +48,7 @@
|
|
|
| namespace WebCore {
|
|
|
| -void SetTimeoutOrInterval(const v8::FunctionCallbackInfo<v8::Value>& args, bool singleShot)
|
| +void SetTimeoutOrInterval(const v8::FunctionCallbackInfo<v8::Value>& args, DOMTimer::Type timerType)
|
| {
|
| WorkerGlobalScope* workerGlobalScope = V8WorkerGlobalScope::toNative(args.Holder());
|
|
|
| @@ -87,10 +87,14 @@ void SetTimeoutOrInterval(const v8::FunctionCallbackInfo<v8::Value>& args, bool
|
|
|
| int32_t timeout = argumentCount >= 2 ? args[1]->Int32Value() : 0;
|
| int timerId;
|
| - if (singleShot)
|
| + switch (timerType) {
|
| + case DOMTimer::TimeoutType:
|
| timerId = DOMWindowTimers::setTimeout(workerGlobalScope, action.release(), timeout);
|
| - else
|
| + break;
|
| + case DOMTimer::IntervalType:
|
| timerId = DOMWindowTimers::setInterval(workerGlobalScope, action.release(), timeout);
|
| + break;
|
| + }
|
|
|
| v8SetReturnValue(args, timerId);
|
| }
|
| @@ -120,12 +124,12 @@ void V8WorkerGlobalScope::importScriptsMethodCustom(const v8::FunctionCallbackIn
|
|
|
| void V8WorkerGlobalScope::setTimeoutMethodCustom(const v8::FunctionCallbackInfo<v8::Value>& args)
|
| {
|
| - return SetTimeoutOrInterval(args, true);
|
| + return SetTimeoutOrInterval(args, DOMTimer::TimeoutType);
|
| }
|
|
|
| void V8WorkerGlobalScope::setIntervalMethodCustom(const v8::FunctionCallbackInfo<v8::Value>& args)
|
| {
|
| - return SetTimeoutOrInterval(args, false);
|
| + return SetTimeoutOrInterval(args, DOMTimer::IntervalType);
|
| }
|
|
|
| v8::Handle<v8::Value> toV8(WorkerGlobalScope* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
|
|
|