示例#1
0
void JSGeolocationOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context)
{
    JSGeolocation* jsGeolocation = jsCast<JSGeolocation*>(handle.get().asCell());
    DOMWrapperWorld& world = *static_cast<DOMWrapperWorld*>(context);
    uncacheWrapper(world, &jsGeolocation->impl(), jsGeolocation);
    jsGeolocation->releaseImpl();
}
示例#2
0
bool JSGeolocationOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)
{
    JSGeolocation* jsGeolocation = jsCast<JSGeolocation*>(handle.get().asCell());
    if (!isObservable(jsGeolocation))
        return false;
    Frame* root = jsGeolocation->impl().frame();
    if (!root)
        return false;
    return visitor.containsOpaqueRoot(root);
}
示例#3
0
EncodedJSValue JSC_HOST_CALL jsGeolocationPrototypeFunctionClearWatch(ExecState* exec)
{
    JSValue thisValue = exec->hostThisValue();
    if (!thisValue.inherits(&JSGeolocation::s_info))
        return throwVMTypeError(exec);
    JSGeolocation* castedThis = static_cast<JSGeolocation*>(asObject(thisValue));
    Geolocation* imp = static_cast<Geolocation*>(castedThis->impl());
    int watchId = exec->argument(0).toInt32(exec);

    imp->clearWatch(watchId);
    return JSValue::encode(jsUndefined());
}
示例#4
0
EncodedJSValue JSC_HOST_CALL jsGeolocationPrototypeFunctionClearWatch(ExecState* exec)
{
    JSValue thisValue = exec->hostThisValue();
    JSGeolocation* castedThis = jsDynamicCast<JSGeolocation*>(thisValue);
    if (!castedThis)
        return throwVMTypeError(exec);
    ASSERT_GC_OBJECT_INHERITS(castedThis, JSGeolocation::info());
    Geolocation& impl = castedThis->impl();
    if (exec->argumentCount() < 1)
        return throwVMError(exec, createNotEnoughArgumentsError(exec));
    int watchID(toInt32(exec, exec->argument(0), NormalConversion));
    if (exec->hadException())
        return JSValue::encode(jsUndefined());
    impl.clearWatch(watchID);
    return JSValue::encode(jsUndefined());
}