Skip to content

Truly independent web browser

LibCore: Remove unused convenience APIs

Shannon Booth757665afcb76
diff --git a/Libraries/LibCore/ConfigFile.h b/Libraries/LibCore/ConfigFile.h
index e5b8cc87f03..e0026c2d613 100644
--- a/Libraries/LibCore/ConfigFile.h
+++ b/Libraries/LibCore/ConfigFile.h
@@ -38,15 +38,6 @@ public:
Optional<ByteString> read_entry_optional(ByteString const& group, ByteString const& key) const;
bool read_bool_entry(ByteString const& group, ByteString const& key, bool default_value = false) const;
- template<Integral T = int>
- T read_num_entry(ByteString const& group, ByteString const& key, T default_value = 0) const
- {
- if (!has_key(group, key))
- return default_value;
-
- return read_entry(group, key, "").to_number<T>().value_or(default_value);
- }
-
private:
ConfigFile(ByteString const& filename, OwnPtr<InputBufferedFile> open_file);
diff --git a/Libraries/LibCore/EventLoopImplementationUnix.h b/Libraries/LibCore/EventLoopImplementationUnix.h
index 9c787dc75b0..bc37562cb6d 100644
--- a/Libraries/LibCore/EventLoopImplementationUnix.h
+++ b/Libraries/LibCore/EventLoopImplementationUnix.h
@@ -33,7 +33,6 @@ public:
virtual void unregister_signal(int handler_id) override;
void wait_for_events(EventLoopImplementation::PumpMode);
- static Optional<MonotonicTime> get_next_timer_expiration();
private:
void dispatch_signal(int signal_number);
diff --git a/Libraries/LibCore/File.cpp b/Libraries/LibCore/File.cpp
index f7d612ed5d4..41510b227e4 100644
--- a/Libraries/LibCore/File.cpp
+++ b/Libraries/LibCore/File.cpp
@@ -50,11 +50,6 @@ ErrorOr<NonnullOwnPtr<File>> File::standard_output()
{
return File::adopt_fd(STDOUT_FILENO, OpenMode::Write, ShouldCloseFileDescriptor::No);
}
-ErrorOr<NonnullOwnPtr<File>> File::standard_error()
-{
- return File::adopt_fd(STDERR_FILENO, OpenMode::Write, ShouldCloseFileDescriptor::No);
-}
-
ErrorOr<ByteBuffer> File::read_until_eof(size_t block_size)
{
// Note: This is used as a heuristic, it's not valid for devices or virtual files.
diff --git a/Libraries/LibCore/File.h b/Libraries/LibCore/File.h
index a3e34262fe9..31781584060 100644
--- a/Libraries/LibCore/File.h
+++ b/Libraries/LibCore/File.h
@@ -54,8 +54,6 @@ public:
static ErrorOr<NonnullOwnPtr<File>> standard_input();
static ErrorOr<NonnullOwnPtr<File>> standard_output();
- static ErrorOr<NonnullOwnPtr<File>> standard_error();
-
File(File&& other) { operator=(move(other)); }
File& operator=(File&& other)
diff --git a/Libraries/LibCore/ThreadedPromise.h b/Libraries/LibCore/ThreadedPromise.h
index e2dd0038129..453febce9fe 100644
--- a/Libraries/LibCore/ThreadedPromise.h
+++ b/Libraries/LibCore/ThreadedPromise.h
@@ -118,20 +118,6 @@ public:
return *this;
}
- template<typename T, CallableAs<NonnullRefPtr<ThreadedPromise<T, ErrorType>>, ResultType&&> ChainedResolution>
- NonnullRefPtr<ThreadedPromise<T, ErrorType>> chain_promise(ChainedResolution chained_resolution)
- {
- auto new_promise = ThreadedPromise<T, ErrorType>::create();
- when_resolved([=, chained_resolution = move(chained_resolution)](ResultType&& result) mutable -> ErrorOr<void> {
- chained_resolution(forward<ResultType>(result))
- ->when_resolved([=](auto&& new_result) { new_promise->resolve(move(new_result)); })
- .when_rejected([=](ErrorType&& error) { new_promise->reject(move(error)); });
- return {};
- });
- when_rejected([=](ErrorType&& error) { new_promise->reject(move(error)); });
- return new_promise;
- }
-
template<typename T, CallableAs<ErrorOr<T, ErrorType>, ResultType&&> MappingFunction>
NonnullRefPtr<ThreadedPromise<T, ErrorType>> map(MappingFunction mapping_function)
{