Exemplo n.º 1
0
EncodedJSValue JSC_HOST_CALL jsStorageEventPrototypeFunctionInitStorageEvent(ExecState* exec)
{
    JSValue thisValue = exec->hostThisValue();
    if (!thisValue.inherits(&JSStorageEvent::s_info))
        return throwVMTypeError(exec);
    JSStorageEvent* castedThis = static_cast<JSStorageEvent*>(asObject(thisValue));
    StorageEvent* imp = static_cast<StorageEvent*>(castedThis->impl());
    const String& typeArg(ustringToString(exec->argument(0).toString(exec)));
    if (exec->hadException())
        return JSValue::encode(jsUndefined());
    bool canBubbleArg(exec->argument(1).toBoolean(exec));
    if (exec->hadException())
        return JSValue::encode(jsUndefined());
    bool cancelableArg(exec->argument(2).toBoolean(exec));
    if (exec->hadException())
        return JSValue::encode(jsUndefined());
    const String& keyArg(ustringToString(exec->argument(3).toString(exec)));
    if (exec->hadException())
        return JSValue::encode(jsUndefined());
    const String& oldValueArg(valueToStringWithNullCheck(exec, exec->argument(4)));
    if (exec->hadException())
        return JSValue::encode(jsUndefined());
    const String& newValueArg(valueToStringWithNullCheck(exec, exec->argument(5)));
    if (exec->hadException())
        return JSValue::encode(jsUndefined());
    const String& urlArg(ustringToString(exec->argument(6).toString(exec)));
    if (exec->hadException())
        return JSValue::encode(jsUndefined());
    Storage* storageAreaArg(toStorage(exec->argument(7)));
    if (exec->hadException())
        return JSValue::encode(jsUndefined());

    imp->initStorageEvent(typeArg, canBubbleArg, cancelableArg, keyArg, oldValueArg, newValueArg, urlArg, storageAreaArg);
    return JSValue::encode(jsUndefined());
}
Exemplo n.º 2
0
JSValue JSInjectedScriptHost::storageId(ExecState* exec)
{
    if (exec->argumentCount() < 1)
        return jsUndefined();
    Storage* storage = toStorage(exec->argument(0));
    if (storage)
        return jsString(exec, impl()->storageIdImpl(storage));
    return jsUndefined();
}
JSValue JSCommandLineAPIHost::storageId(ExecState* exec)
{
    if (exec->argumentCount() < 1)
        return jsUndefined();

    Storage* storage = toStorage(exec->uncheckedArgument(0));
    if (storage)
        return jsStringWithCache(exec, impl().storageIdImpl(storage));

    return jsUndefined();
}
JSValue JSInjectedScriptHost::selectDOMStorage(ExecState*, const ArgList& args)
{
    if (args.size() < 1)
        return jsUndefined();
    InspectorController* ic = impl()->inspectorController();
    if (!ic)
        return jsUndefined();

    Storage* storage = toStorage(args.at(0));
    if (storage)
        impl()->selectDOMStorage(storage);
    return jsUndefined();
}
JSValue JSInjectedScriptHost::selectDOMStorage(ExecState* exec)
{
    if (exec->argumentCount() < 1)
        return jsUndefined();
    InspectorController* ic = impl()->inspectorController();
    if (!ic)
        return jsUndefined();

    Storage* storage = toStorage(exec->argument(0));
    if (storage)
        impl()->selectDOMStorage(storage);
    return jsUndefined();
}
Exemplo n.º 6
0
void JSDictionary::convertValue(ExecState*, JSValue value, RefPtr<Storage>& result)
{
    result = toStorage(value);
}
Exemplo n.º 7
0
/*!
  \brief Destructs the private data object.
*/
SettingsPrivate::~SettingsPrivate()
{
  toStorage();
  clear();
}