Example #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());
}
Example #2
0
JSValue jsStorageEventUrl(ExecState* exec, JSValue slotBase, const Identifier&)
{
    JSStorageEvent* castedThis = static_cast<JSStorageEvent*>(asObject(slotBase));
    UNUSED_PARAM(exec);
    StorageEvent* imp = static_cast<StorageEvent*>(castedThis->impl());
    JSValue result = jsString(exec, imp->url());
    return result;
}
Example #3
0
JSValue jsStorageEventStorageArea(ExecState* exec, JSValue slotBase, const Identifier&)
{
    JSStorageEvent* castedThis = static_cast<JSStorageEvent*>(asObject(slotBase));
    UNUSED_PARAM(exec);
    StorageEvent* imp = static_cast<StorageEvent*>(castedThis->impl());
    JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->storageArea()));
    return result;
}
void InspectorDOMStorageResource::handleEvent(ScriptExecutionContext*, Event* event)
{
    ASSERT(m_frontend);
    ASSERT(eventNames().storageEvent == event->type());
    StorageEvent* storageEvent = static_cast<StorageEvent*>(event);
    Storage* storage = storageEvent->storageArea();
    ExceptionCode ec = 0;
    bool isLocalStorage = (storage->frame()->domWindow()->localStorage(ec) == storage && !ec);
    if (isSameHostAndType(storage->frame(), isLocalStorage))
        m_frontend->updateDOMStorage(m_id);
}