mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 16:45:03 +00:00
Kernel: Move KBufferBuilder to the fallible KBuffer API
KBufferBuilder::build() now returns an OwnPtr<KBuffer> and can fail. Clients of the API have been updated to handle that situation.
This commit is contained in:
@@ -612,10 +612,14 @@ void Process::finalize()
|
||||
if (!description_or_error.is_error()) {
|
||||
auto& description = description_or_error.value();
|
||||
auto json = m_perf_event_buffer->to_json(m_pid, m_executable ? m_executable->absolute_path() : "");
|
||||
auto json_buffer = UserOrKernelBuffer::for_kernel_buffer(json.data());
|
||||
auto result = description->write(json_buffer, json.size());
|
||||
if (result.is_error()) {
|
||||
dbgln("Error while writing perfcore file: {}", result.error().error());
|
||||
if (!json) {
|
||||
dbgln("Error generating perfcore JSON");
|
||||
} else {
|
||||
auto json_buffer = UserOrKernelBuffer::for_kernel_buffer(json->data());
|
||||
auto result = description->write(json_buffer, json->size());
|
||||
if (result.is_error()) {
|
||||
dbgln("Error while writing perfcore file: {}", result.error().error());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -840,7 +844,7 @@ void Process::FileDescriptionAndFlags::set(NonnullRefPtr<FileDescription>&& desc
|
||||
m_flags = flags;
|
||||
}
|
||||
|
||||
KBuffer Process::backtrace() const
|
||||
OwnPtr<KBuffer> Process::backtrace() const
|
||||
{
|
||||
KBufferBuilder builder;
|
||||
for_each_thread([&](Thread& thread) {
|
||||
|
||||
Reference in New Issue
Block a user