mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 04:47:35 +00:00
Libraries: Fix visibility of Object-derivative constructors
Derivatives of Core::Object should be constructed through ClassName::construct(), to avoid handling ref-counted objects with refcount zero. Fixing the visibility means that misuses like this are more difficult.
This commit is contained in:
parent
3796d417e0
commit
b3e9a4e603
19 changed files with 62 additions and 50 deletions
|
@ -125,7 +125,7 @@ pid_t EventLoop::s_pid;
|
|||
|
||||
class InspectorServerConnection : public Object {
|
||||
C_OBJECT(InspectorServerConnection)
|
||||
public:
|
||||
private:
|
||||
explicit InspectorServerConnection(RefPtr<LocalSocket> socket)
|
||||
: m_socket(move(socket))
|
||||
, m_client_id(s_id_allocator->allocate())
|
||||
|
@ -162,6 +162,7 @@ public:
|
|||
inspected_object->decrement_inspector_count({});
|
||||
}
|
||||
|
||||
public:
|
||||
void send_response(const JsonObject& response)
|
||||
{
|
||||
auto serialized = response.to_string();
|
||||
|
|
|
@ -14,9 +14,6 @@ template<typename Result>
|
|||
class Promise : public Object {
|
||||
C_OBJECT(Promise);
|
||||
|
||||
private:
|
||||
Optional<Result> m_pending;
|
||||
|
||||
public:
|
||||
Function<void(Result&)> on_resolved;
|
||||
|
||||
|
@ -51,5 +48,10 @@ public:
|
|||
};
|
||||
return new_promise;
|
||||
}
|
||||
|
||||
private:
|
||||
Promise() = default;
|
||||
|
||||
Optional<Result> m_pending;
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue