LibWeb: Implement NavigatorStorage mixin interface

Co-authored-by: Tim Flynn <trflynn89@serenityos.org>
This commit is contained in:
Jamie Mansfield 2024-08-13 20:56:19 +01:00 committed by Tim Flynn
commit e3b3041a0c
Notes: github-actions[bot] 2024-08-16 15:23:10 +00:00
12 changed files with 93 additions and 3 deletions

View file

@ -0,0 +1,22 @@
/*
* Copyright (c) 2024, Jamie Mansfield <jmansfield@cadixdev.org>
* Copyright (c) 2024, Tim Flynn <trflynn89@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <LibJS/Runtime/Realm.h>
#include <LibWeb/HTML/Scripting/Environments.h>
#include <LibWeb/StorageAPI/NavigatorStorage.h>
#include <LibWeb/StorageAPI/StorageManager.h>
namespace Web::StorageAPI {
// https://storage.spec.whatwg.org/#dom-navigatorstorage-storage
JS::NonnullGCPtr<StorageManager> NavigatorStorage::storage()
{
// The storage getter steps are to return thiss relevant settings objects StorageManager object.
return HTML::relevant_settings_object(this_navigator_storage_object()).storage_manager();
}
}