mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 03:57:43 +00:00
FileDescription: Disallow construction with a null File
It's not valid for a FileDescription to not have a file, so let's disallow it by taking a File& (or FIFO&) in the constructor.
This commit is contained in:
parent
0dc05a33c1
commit
752de9cd27
6 changed files with 18 additions and 19 deletions
|
@ -22,8 +22,8 @@ class SharedMemory;
|
|||
|
||||
class FileDescription : public RefCounted<FileDescription> {
|
||||
public:
|
||||
static NonnullRefPtr<FileDescription> create(RefPtr<Custody>&&);
|
||||
static NonnullRefPtr<FileDescription> create(RefPtr<File>, SocketRole = SocketRole::None);
|
||||
static NonnullRefPtr<FileDescription> create(Custody&);
|
||||
static NonnullRefPtr<FileDescription> create(File&, SocketRole = SocketRole::None);
|
||||
~FileDescription();
|
||||
|
||||
NonnullRefPtr<FileDescription> clone();
|
||||
|
@ -106,12 +106,12 @@ public:
|
|||
|
||||
private:
|
||||
friend class VFS;
|
||||
FileDescription(RefPtr<File>&&, SocketRole = SocketRole::None);
|
||||
FileDescription(File&, SocketRole = SocketRole::None);
|
||||
FileDescription(FIFO&, FIFO::Direction);
|
||||
|
||||
RefPtr<Custody> m_custody;
|
||||
RefPtr<Inode> m_inode;
|
||||
RefPtr<File> m_file;
|
||||
NonnullRefPtr<File> m_file;
|
||||
|
||||
off_t m_current_offset { 0 };
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue