mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2026-04-18 09:50:27 +00:00
We had skipped some steps in the spec and were: * Always broadcasting an old value of null, instead of what it actually was previously. * Still broadcasting a storage event even if the value had not changed in storage compared to the last value. Fix both issues by returning what the old value is in the setter and implementing the missing logic.
23 lines
524 B
C++
23 lines
524 B
C++
/*
|
|
* Copyright (c) 2025, Aliaksandr Kalenik <kalenik.aliaksandr@gmail.com>
|
|
* Copyright (c) 2025, Shannon Booth <shannon@serenityos.org>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <AK/Optional.h>
|
|
#include <AK/String.h>
|
|
#include <AK/Types.h>
|
|
|
|
namespace WebView {
|
|
|
|
enum class StorageOperationError : u8 {
|
|
QuotaExceededError,
|
|
};
|
|
|
|
// Error setting the storage item, or the old value if the operation was successful.
|
|
using StorageSetResult = Variant<StorageOperationError, Optional<String>>;
|
|
|
|
}
|