Skip to content

Commit

Permalink
Merge pull request #2601 from cloudflare/felix/082324-io-cleanup
Browse files Browse the repository at this point in the history
[nfc] 08-23-24 build cleanup
  • Loading branch information
fhanau authored Aug 26, 2024
2 parents 5a05c73 + dfc6952 commit accbbec
Show file tree
Hide file tree
Showing 46 changed files with 136 additions and 93 deletions.
1 change: 1 addition & 0 deletions compile_flags.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
-isystemexternal/sqlite3
-isystemexternal/perfetto-sdk/sdk
-D_FORTIFY_SOURCE=1
-D_LIBCPP_REMOVE_TRANSITIVE_INCLUDES
-DCAPNP_VERSION=11000
-DDEBUG
-DGOOGLE3
Expand Down
6 changes: 4 additions & 2 deletions src/workerd/api/actor-state.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@
// See actor.h for APIs used by other Workers to talk to Actors.

#include <workerd/jsg/jsg.h>
#include <workerd/io/io-context.h>
#include <workerd/io/actor-storage.capnp.h>
#include <workerd/io/actor-id.h>
#include <workerd/io/compatibility-date.capnp.h>
#include <workerd/io/io-own.h>
#include <workerd/io/worker.h>
#include <kj/async.h>
#include <workerd/io/actor-cache.h>

Expand Down
5 changes: 5 additions & 0 deletions src/workerd/api/api-rtti-test.c++
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,21 @@
#include <workerd/api/cache.h>
#include <workerd/api/crypto/crypto.h>
#include <workerd/api/encoding.h>
#include <workerd/api/events.h>
#include <workerd/api/eventsource.h>
#include <workerd/api/global-scope.h>
#include <workerd/api/html-rewriter.h>
#include <workerd/api/queue.h>
#include <workerd/api/scheduled.h>
#include <workerd/api/streams.h>
#include <workerd/api/sockets.h>
#include <workerd/api/sql.h>
#include <workerd/api/streams/standard.h>
#include <workerd/api/trace.h>
#include <workerd/api/url-standard.h>
#include <workerd/api/urlpattern.h>
#include <workerd/jsg/rtti.h>
#include <workerd/io/compatibility-date.h>

// Test building rtti for various APIs.

Expand Down
2 changes: 1 addition & 1 deletion src/workerd/api/basics.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// TODO(cleanp): Rename to events.h?

#include <workerd/jsg/jsg.h>
#include <workerd/io/io-context.h>
#include <workerd/io/io-own.h>
#include <workerd/util/canceler.h>
#include <kj/function.h>
#include <kj/map.h>
Expand Down
2 changes: 1 addition & 1 deletion src/workerd/api/blob.c++
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
// https://opensource.org/licenses/Apache-2.0

#include "blob.h"
#include "streams.h"
#include "util.h"
#include <workerd/api/streams/readable.h>
#include <workerd/io/observer.h>
#include <workerd/util/mimetype.h>

Expand Down
5 changes: 3 additions & 2 deletions src/workerd/api/crypto/aes.c++
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@
#include <algorithm>
#include <cstdint>
#include <openssl/aes.h>
#include <openssl/base.h>
#include <openssl/bn.h>
#include <openssl/crypto.h>
#include <openssl/err.h>
#include <openssl/cipher.h>
#include <openssl/mem.h>
#include <workerd/io/io-context.h>

namespace workerd::api {
Expand Down
4 changes: 2 additions & 2 deletions src/workerd/api/crypto/crypto.c++
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
#include "crypto.h"
#include "impl.h"
#include <workerd/api/streams/standard.h>
#include <openssl/crypto.h>
#include <openssl/err.h>
#include <openssl/digest.h>
#include <openssl/mem.h>
#include <workerd/api/util.h>
#include <workerd/jsg/jsg.h>
#include <workerd/io/io-context.h>
Expand Down
4 changes: 2 additions & 2 deletions src/workerd/api/crypto/crypto.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
#include <workerd/jsg/buffersource.h>
#include <workerd/jsg/jsg.h>
#include <workerd/jsg/buffersource.h>
#include <openssl/err.h>
#include "../streams.h"
#include <workerd/api/streams/writable.h>
#include <openssl/base.h> // for EVP_MD_CTX, X509

namespace workerd::api {
namespace node {
Expand Down
3 changes: 1 addition & 2 deletions src/workerd/api/crypto/ec.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

#include "impl.h"
#include "keys.h"
#include <openssl/bn.h>
#include <openssl/ec.h>
#include <openssl/base.h>
#include <kj/common.h>

namespace workerd::api {
Expand Down
3 changes: 2 additions & 1 deletion src/workerd/api/crypto/impl.c++
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@
#include <openssl/bn.h>
#include <openssl/err.h>
#include <openssl/ec.h>
#include <openssl/evp.h>
#include <openssl/rsa.h>
#include <openssl/rand.h>
#include <openssl/crypto.h>
#include <workerd/jsg/setup.h>
#include <workerd/jsg/memory.h>

namespace workerd::api {
namespace {
Expand Down
5 changes: 3 additions & 2 deletions src/workerd/api/crypto/impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@
#include "crypto.h"
#include <workerd/api/util.h>
#include <kj/encoding.h>
#include <openssl/evp.h>
#include <openssl/bio.h>
#include <openssl/base.h>
#include <openssl/bn.h>
#include <openssl/err.h>

typedef struct bignum_st BIGNUM;

Expand Down
3 changes: 2 additions & 1 deletion src/workerd/api/crypto/pbkdf2.c++
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@

#include "impl.h"
#include <workerd/api/crypto/kdf.h>
#include <openssl/crypto.h>
#include <openssl/evp.h>
#include <openssl/mem.h>

namespace workerd::api {
namespace {
Expand Down
2 changes: 1 addition & 1 deletion src/workerd/api/crypto/rsa.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#include "crypto.h"
#include "keys.h"
#include <openssl/rsa.h>
#include <openssl/base.h>
#include <openssl/evp.h>
#include <kj/common.h>

Expand Down
2 changes: 1 addition & 1 deletion src/workerd/api/crypto/scrypt.c++
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

#include "impl.h"
#include <workerd/api/crypto/kdf.h>
#include <openssl/crypto.h>
#include <openssl/evp.h>

namespace workerd::api {

Expand Down
1 change: 1 addition & 0 deletions src/workerd/api/global-scope.c++
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include <workerd/api/cache.h>
#include <workerd/api/crypto/crypto.h>
#include <workerd/api/events.h>
#include <workerd/api/eventsource.h>
#include <workerd/api/scheduled.h>
#include <workerd/api/system-streams.h>
#include <workerd/api/trace.h>
Expand Down
7 changes: 5 additions & 2 deletions src/workerd/api/global-scope.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@

#include <workerd/jsg/jsg.h>
#include "basics.h"
#include "events.h"
#include "http.h"
#include "eventsource.h"
#include "hibernation-event-params.h"
#include <workerd/io/io-timers.h>
#ifdef WORKERD_EXPERIMENTAL_ENABLE_WEBGPU
Expand All @@ -26,12 +24,17 @@ class Cache;
class CacheStorage;
class Crypto;
class CryptoKey;
class ErrorEvent;
class EventSource;
class FixedLengthStream;
class SubtleCrypto;
class TextDecoder;
class TextEncoder;
class HTMLRewriter;
class IdentityTransformStream;
class Response;
class TraceItem;
class TransformStream;
class ScheduledController;
class ScheduledEvent;
class ReadableStream;
Expand Down
1 change: 1 addition & 0 deletions src/workerd/api/hibernatable-web-socket.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include <kj/debug.h>
#include <kj/time.h>

#include <workerd/io/worker.h>
#include <workerd/io/worker-interface.capnp.h>
#include <workerd/io/worker-interface.h>
#include <workerd/api/basics.h>
Expand Down
1 change: 1 addition & 0 deletions src/workerd/api/http.c++
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include <kj/memory.h>
#include <kj/parse/char.h>
#include <workerd/io/features.h>
#include <workerd/util/abortable.h>
#include <workerd/util/http-util.h>
#include <workerd/util/mimetype.h>
#include <workerd/util/stream-utils.h>
Expand Down
6 changes: 1 addition & 5 deletions src/workerd/api/http.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,21 @@

#include <workerd/jsg/jsg.h>
#include <workerd/jsg/async-context.h>
#include <workerd/util/abortable.h>
#include <kj/compat/http.h>
#include <map>
#include "basics.h"
#include "cf-property.h"
#include "streams.h"
#include <workerd/api/streams/readable.h>
#include "form-data.h"
#include "web-socket.h"
#include "url.h"
#include "url-standard.h"
#include "blob.h"
#include <workerd/io/compatibility-date.capnp.h>
#include "worker-rpc.h"
#include "queue.h"

namespace workerd::api {

struct QueueResponse;

class Headers final: public jsg::Object {
private:
template <typename T>
Expand Down
8 changes: 6 additions & 2 deletions src/workerd/api/kv.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,14 @@

#pragma once

#include <workerd/jsg/jsg.h>
#include "streams.h"
#include <workerd/api/streams/readable.h>
#include <workerd/io/limit-enforcer.h>
#include <workerd/jsg/jsg.h>

namespace kj {
class HttpClient;
class HttpHeaders;
} // namespace kj
namespace workerd {
class IoContext;
}
Expand Down
1 change: 0 additions & 1 deletion src/workerd/api/modules.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#pragma once

#include <workerd/api/node/node.h>
#include <workerd/api/unsafe.h>
#include <workerd/api/pyodide/pyodide.h>
#include <workerd/api/rtti.h>
#include <workerd/api/sockets.h>
Expand Down
1 change: 1 addition & 0 deletions src/workerd/api/node/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ wd_test(
)

wd_test(
size = "large",
src = "tests/crypto_scrypt-test.wd-test",
args = ["--experimental"],
data = ["tests/crypto_scrypt-test.js"],
Expand Down
1 change: 0 additions & 1 deletion src/workerd/api/node/crypto.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
#include <workerd/api/crypto/digest.h>
#include <workerd/api/crypto/dh.h>
#include <workerd/api/crypto/x509.h>
#include <openssl/evp.h>

namespace workerd::api::node {

Expand Down
5 changes: 1 addition & 4 deletions src/workerd/api/r2-bucket.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,7 @@
#include "r2-rpc.h"

#include <workerd/jsg/jsg.h>
#include "streams.h"
#include <workerd/api/r2-api.capnp.h>
#include <capnp/compat/json.h>
#include <workerd/util/http-util.h>
#include <workerd/api/streams/readable.h>

namespace workerd::api {
class Headers;
Expand Down
5 changes: 4 additions & 1 deletion src/workerd/api/r2-rpc.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,13 @@

#pragma once

#include <workerd/api/basics.h>
#include <workerd/api/blob.h>
#include <workerd/jsg/jsg.h>

namespace kj {
class HttpClient;
}

namespace workerd::api {

class ReadableStreamSource;
Expand Down
3 changes: 3 additions & 0 deletions src/workerd/api/rtti.c++
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include <workerd/api/sockets.h>
#include <workerd/api/scheduled.h>
#include <workerd/api/sql.h>
#include <workerd/api/streams.h>
#include <workerd/api/streams/standard.h>
#include <workerd/api/trace.h>
#include <workerd/api/urlpattern.h>
Expand All @@ -32,8 +33,10 @@
#include <workerd/api/hyperdrive.h>
#include <workerd/api/eventsource.h>
#include <workerd/api/unsafe.h>
#include <workerd/api/url-standard.h>
#include <workerd/api/memory-cache.h>
#include <workerd/api/worker-rpc.h>
#include <workerd/io/compatibility-date.h>

#include <cloudflare/cloudflare.capnp.h>

Expand Down
2 changes: 1 addition & 1 deletion src/workerd/api/rtti.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

#include <kj/array.h>
#include <kj/string.h>
#include <workerd/io/compatibility-date.h>
#include <workerd/jsg/jsg.h>
#include <workerd/jsg/modules.h>
#include <workerd/jsg/modules-new.h>
#include <workerd/jsg/url.h>
Expand Down
1 change: 1 addition & 0 deletions src/workerd/api/scheduled.c++
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// https://opensource.org/licenses/Apache-2.0

#include "scheduled.h"
#include <workerd/io/io-context.h>

namespace workerd::api {

Expand Down
4 changes: 4 additions & 0 deletions src/workerd/api/sockets.c++
Original file line number Diff line number Diff line change
Expand Up @@ -460,4 +460,8 @@ jsg::Promise<void> Socket::maybeCloseWriteSide(jsg::Lock& js) {
}));
}

jsg::Ref<Socket> SocketsModule::connect(
jsg::Lock& js, AnySocketAddress address, jsg::Optional<SocketOptions> options) {
return connectImpl(js, kj::none, kj::mv(address), kj::mv(options));
}
} // namespace workerd::api
7 changes: 3 additions & 4 deletions src/workerd/api/sockets.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
#include <workerd/jsg/modules.h>
#include <workerd/jsg/modules-new.h>
#include <workerd/jsg/url.h>
#include "streams.h"
#include <workerd/api/streams/readable.h>
#include <workerd/api/streams/writable.h>

namespace workerd::api {

Expand Down Expand Up @@ -240,9 +241,7 @@ class SocketsModule final: public jsg::Object {
SocketsModule(jsg::Lock&, const jsg::Url&) {}

jsg::Ref<Socket> connect(
jsg::Lock& js, AnySocketAddress address, jsg::Optional<SocketOptions> options) {
return connectImpl(js, kj::none, kj::mv(address), kj::mv(options));
}
jsg::Lock& js, AnySocketAddress address, jsg::Optional<SocketOptions> options);

JSG_RESOURCE_TYPE(SocketsModule) {
JSG_METHOD(connect);
Expand Down
3 changes: 1 addition & 2 deletions src/workerd/api/sql.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,10 @@
#include <workerd/util/sqlite.h>
#include <workerd/io/compatibility-date.capnp.h>
#include <workerd/io/io-context.h>
#include <workerd/api/actor-state.h>

namespace workerd::api {

class DurableObjectStorage;

class SqlStorage final: public jsg::Object, private SqliteDatabase::Regulator {
public:
SqlStorage(SqliteDatabase& sqlite, jsg::Ref<DurableObjectStorage> storage);
Expand Down
1 change: 1 addition & 0 deletions src/workerd/api/streams/internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#pragma once

#include "common.h"
#include "writable.h"
#include <workerd/io/io-context.h>
#include <deque>

Expand Down
Loading

0 comments on commit accbbec

Please sign in to comment.