mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-26 01:20:25 +00:00
79fa9765ca
We now use AK::Error and AK::ErrorOr<T> in both kernel and userspace! This was a slightly tedious refactoring that took a long time, so it's not unlikely that some bugs crept in. Nevertheless, it does pass basic functionality testing, and it's just real nice to finally see the same pattern in all contexts. :^)
36 lines
867 B
C++
36 lines
867 B
C++
/*
|
|
* Copyright (c) 2020, Andreas Kling <kling@serenityos.org>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#include <Kernel/FileSystem/Inode.h>
|
|
#include <Kernel/Memory/PrivateInodeVMObject.h>
|
|
|
|
namespace Kernel::Memory {
|
|
|
|
ErrorOr<NonnullRefPtr<PrivateInodeVMObject>> PrivateInodeVMObject::try_create_with_inode(Inode& inode)
|
|
{
|
|
return adopt_nonnull_ref_or_enomem(new (nothrow) PrivateInodeVMObject(inode, inode.size()));
|
|
}
|
|
|
|
ErrorOr<NonnullRefPtr<VMObject>> PrivateInodeVMObject::try_clone()
|
|
{
|
|
return adopt_nonnull_ref_or_enomem<VMObject>(new (nothrow) PrivateInodeVMObject(*this));
|
|
}
|
|
|
|
PrivateInodeVMObject::PrivateInodeVMObject(Inode& inode, size_t size)
|
|
: InodeVMObject(inode, size)
|
|
{
|
|
}
|
|
|
|
PrivateInodeVMObject::PrivateInodeVMObject(PrivateInodeVMObject const& other)
|
|
: InodeVMObject(other)
|
|
{
|
|
}
|
|
|
|
PrivateInodeVMObject::~PrivateInodeVMObject()
|
|
{
|
|
}
|
|
|
|
}
|