std::unique_ptr<Connection> -> Ref<Connection>

This commit is contained in:
2025-09-12 18:31:57 -04:00
parent 1fa3381e4b
commit de6f38694f
11 changed files with 79 additions and 92 deletions

View File

@@ -32,11 +32,11 @@ struct MockConnectionHandler : public ConnectionHandler {
bool write_progress_called = false;
bool write_buffer_drained_called = false;
void on_write_progress(std::unique_ptr<Connection> &) override {
void on_write_progress(Ref<Connection> &) override {
write_progress_called = true;
}
void on_write_buffer_drained(std::unique_ptr<Connection> &) override {
void on_write_buffer_drained(Ref<Connection> &) override {
write_buffer_drained_called = true;
}
};
@@ -50,7 +50,7 @@ TEST_CASE("ConnectionHandler hooks") {
CHECK_FALSE(handler.write_buffer_drained_called);
// Would normally be called by Server during write operations
std::unique_ptr<Connection> null_conn;
Ref<Connection> null_conn;
handler.on_write_progress(null_conn);
handler.on_write_buffer_drained(null_conn);

View File

@@ -11,7 +11,7 @@
PERFETTO_TRACK_EVENT_STATIC_STORAGE();
struct Message {
std::unique_ptr<Connection> conn;
Ref<Connection> conn;
std::string data;
bool done;
};
@@ -27,7 +27,7 @@ public:
: pipeline(pipeline) {}
void on_data_arrived(std::string_view data,
std::unique_ptr<Connection> &conn_ptr) override {
Ref<Connection> &conn_ptr) override {
assert(conn_ptr);
auto guard = pipeline.push(1, true);
for (auto &message : guard.batch) {