diff --git a/Libraries/LibCore/EventReceiver.h b/Libraries/LibCore/EventReceiver.h index 2cea2600504..97f4c3137aa 100644 --- a/Libraries/LibCore/EventReceiver.h +++ b/Libraries/LibCore/EventReceiver.h @@ -19,21 +19,16 @@ namespace Core { -#define C_OBJECT(klass) \ -public: \ - virtual StringView class_name() const override \ - { \ - return #klass##sv; \ - } \ - template \ - static NonnullRefPtr construct(Args&&... args) \ - { \ - return adopt_ref(*new Klass(::forward(args)...)); \ - } \ - template \ - static ErrorOr> try_create(Args&&... args) \ - { \ - return adopt_nonnull_ref_or_enomem(new (nothrow) Klass(::forward(args)...)); \ +#define C_OBJECT(klass) \ +public: \ + virtual StringView class_name() const override \ + { \ + return #klass##sv; \ + } \ + template \ + static NonnullRefPtr construct(Args&&... args) \ + { \ + return adopt_ref(*new Klass(::forward(args)...)); \ } #define C_OBJECT_ABSTRACT(klass) \ diff --git a/Libraries/LibCore/FileWatcherLinux.cpp b/Libraries/LibCore/FileWatcherLinux.cpp index 97de7c6a8ed..923c2ce07eb 100644 --- a/Libraries/LibCore/FileWatcherLinux.cpp +++ b/Libraries/LibCore/FileWatcherLinux.cpp @@ -99,7 +99,7 @@ ErrorOr> FileWatcher::create(FileWatcherFlags flags) if (watcher_fd < 0) return Error::from_errno(errno); - auto notifier = TRY(Notifier::try_create(watcher_fd, Notifier::Type::Read)); + auto notifier = Notifier::construct(watcher_fd, Notifier::Type::Read); return adopt_nonnull_ref_or_enomem(new (nothrow) FileWatcher(watcher_fd, move(notifier))); } diff --git a/Libraries/LibCore/FileWatcherMacOS.mm b/Libraries/LibCore/FileWatcherMacOS.mm index 81e5a33a9c6..49f6b9b54d4 100644 --- a/Libraries/LibCore/FileWatcherMacOS.mm +++ b/Libraries/LibCore/FileWatcherMacOS.mm @@ -65,7 +65,7 @@ public: // NOTE: This isn't actually used on macOS, but is needed for FileWatcherBase. // Creating it with an FD of -1 will effectively disable the notifier. - auto notifier = TRY(Notifier::try_create(-1, Notifier::Type::None)); + auto notifier = Notifier::construct(-1, Notifier::Type::None); return adopt_nonnull_ref_or_enomem(new (nothrow) FileWatcherMacOS(move(context), dispatch_queue, move(notifier))); } diff --git a/Libraries/LibWeb/HTML/HTMLImageElement.cpp b/Libraries/LibWeb/HTML/HTMLImageElement.cpp index e4124141a0f..accdf679193 100644 --- a/Libraries/LibWeb/HTML/HTMLImageElement.cpp +++ b/Libraries/LibWeb/HTML/HTMLImageElement.cpp @@ -49,7 +49,7 @@ GC_DEFINE_ALLOCATOR(HTMLImageElement); HTMLImageElement::HTMLImageElement(DOM::Document& document, DOM::QualifiedName qualified_name) : HTMLElement(document, move(qualified_name)) { - m_animation_timer = Core::Timer::try_create().release_value_but_fixme_should_propagate_errors(); + m_animation_timer = Core::Timer::create(); m_animation_timer->on_timeout = [this] { animate(); }; document.register_viewport_client(*this); diff --git a/Libraries/LibWeb/Platform/TimerSerenity.cpp b/Libraries/LibWeb/Platform/TimerSerenity.cpp index e72cb3bc86f..fed22343f75 100644 --- a/Libraries/LibWeb/Platform/TimerSerenity.cpp +++ b/Libraries/LibWeb/Platform/TimerSerenity.cpp @@ -17,7 +17,7 @@ GC::Ref TimerSerenity::create(GC::Heap& heap) } TimerSerenity::TimerSerenity() - : m_timer(Core::Timer::try_create().release_value_but_fixme_should_propagate_errors()) + : m_timer(Core::Timer::create()) { m_timer->on_timeout = [this] { if (on_timeout) diff --git a/Libraries/LibWeb/SVG/SVGImageElement.cpp b/Libraries/LibWeb/SVG/SVGImageElement.cpp index bf9f0dc9ce9..f15723fcedd 100644 --- a/Libraries/LibWeb/SVG/SVGImageElement.cpp +++ b/Libraries/LibWeb/SVG/SVGImageElement.cpp @@ -23,7 +23,7 @@ namespace Web::SVG { SVGImageElement::SVGImageElement(DOM::Document& document, DOM::QualifiedName qualified_name) : SVGGraphicsElement(document, move(qualified_name)) { - m_animation_timer = Core::Timer::try_create().release_value_but_fixme_should_propagate_errors(); + m_animation_timer = Core::Timer::create(); m_animation_timer->on_timeout = [this] { animate(); }; } diff --git a/Libraries/LibWebView/BrowserProcess.cpp b/Libraries/LibWebView/BrowserProcess.cpp index bcc857700cf..3c1f9034ca0 100644 --- a/Libraries/LibWebView/BrowserProcess.cpp +++ b/Libraries/LibWebView/BrowserProcess.cpp @@ -67,7 +67,7 @@ ErrorOr BrowserProcess::connect_as_server(ByteString const& socket_path) // TODO: Mach IPC auto socket_fd = TRY(Process::create_ipc_socket(socket_path)); m_socket_path = socket_path; - auto local_server = TRY(Core::LocalServer::try_create()); + auto local_server = Core::LocalServer::construct(); TRY(local_server->take_over_fd(socket_fd)); m_server_connection = TRY(IPC::MultiServer::try_create(move(local_server))); diff --git a/Services/WebContent/main.cpp b/Services/WebContent/main.cpp index 6d0d4a1cc80..1db23f1977e 100644 --- a/Services/WebContent/main.cpp +++ b/Services/WebContent/main.cpp @@ -220,7 +220,7 @@ ErrorOr ladybird_main(Main::Arguments arguments) // TODO: Mach IPC auto webcontent_socket = TRY(Core::take_over_socket_from_system_server("WebContent"sv)); - auto webcontent_client = TRY(WebContent::ConnectionFromClient::try_create(make(move(webcontent_socket)))); + auto webcontent_client = WebContent::ConnectionFromClient::construct(make(move(webcontent_socket))); webcontent_client->on_request_server_connection = [&](auto const& socket_file) { if (auto result = reinitialize_resource_loader(socket_file); result.is_error()) diff --git a/Services/WebDriver/Session.cpp b/Services/WebDriver/Session.cpp index 7d608342280..1f155100f79 100644 --- a/Services/WebDriver/Session.cpp +++ b/Services/WebDriver/Session.cpp @@ -201,7 +201,7 @@ ErrorOr> Session::create_server(NonnullRefPtrlisten(*m_web_content_socket_path); server->on_accept = [this, promise](auto client_socket) {