Add definition to build moq_chat client in standalone QUICHE for interop testing. Also cleaned up a couple of compiler warnings. Verified that moq_chat builds in standalone QUICHE. PiperOrigin-RevId: 826627858
diff --git a/quiche/BUILD.bazel b/quiche/BUILD.bazel index 8e0fc4c..aecb643 100644 --- a/quiche/BUILD.bazel +++ b/quiche/BUILD.bazel
@@ -629,6 +629,18 @@ ], ) +cc_binary( + name = "moq_chat", + srcs = ["quic/moqt/tools/chat_client_bin.cc"], + deps = [ + ":io_tool_support", + ":moqt_core", + ":quiche_core", + ":quiche_tool_support", + "@com_google_absl//absl/strings", + ], +) + # Indicate that QUICHE APIs are explicitly unstable by providing only # appropriately named aliases as publicly visible targets. alias(
diff --git a/quiche/quic/moqt/moqt_fetch_task.h b/quiche/quic/moqt/moqt_fetch_task.h index b770684..318beea 100644 --- a/quiche/quic/moqt/moqt_fetch_task.h +++ b/quiche/quic/moqt/moqt_fetch_task.h
@@ -73,7 +73,7 @@ absl::Status GetStatus() override { return status_; } void SetObjectAvailableCallback( ObjectsAvailableCallback /*callback*/) override {} - void SetFetchResponseCallback(FetchResponseCallback callback) { + void SetFetchResponseCallback(FetchResponseCallback callback) override { MoqtFetchError error; error.request_id = 0; error.error_code = StatusToRequestErrorCode(status_);
diff --git a/quiche/quic/moqt/moqt_framer.h b/quiche/quic/moqt/moqt_framer.h index e5a4a52..85253ac 100644 --- a/quiche/quic/moqt/moqt_framer.h +++ b/quiche/quic/moqt/moqt_framer.h
@@ -25,8 +25,7 @@ // different streams. class QUICHE_EXPORT MoqtFramer { public: - MoqtFramer(quiche::QuicheBufferAllocator* allocator, bool using_webtrans) - : allocator_(allocator), using_webtrans_(using_webtrans) {} + MoqtFramer(bool using_webtrans) : using_webtrans_(using_webtrans) {} // Serialize functions. Takes structured data and serializes it into a // QuicheBuffer for delivery to the stream. @@ -95,8 +94,6 @@ // Returns true if the metadata is internally consistent. static bool ValidateObjectMetadata(const MoqtObject& object, bool is_datagram); - - quiche::QuicheBufferAllocator* allocator_; bool using_webtrans_; };
diff --git a/quiche/quic/moqt/moqt_framer_test.cc b/quiche/quic/moqt/moqt_framer_test.cc index 47c2fe2..14270f5 100644 --- a/quiche/quic/moqt/moqt_framer_test.cc +++ b/quiche/quic/moqt/moqt_framer_test.cc
@@ -114,8 +114,7 @@ MoqtFramerTest() : message_type_(GetParam().message_type), webtrans_(GetParam().uses_web_transport), - buffer_allocator_(quiche::SimpleBufferAllocator::Get()), - framer_(buffer_allocator_, GetParam().uses_web_transport) {} + framer_(GetParam().uses_web_transport) {} std::unique_ptr<TestMessageBase> MakeMessage(MoqtMessageType message_type) { return CreateTestMessage(message_type, webtrans_); @@ -252,7 +251,6 @@ MoqtMessageType message_type_; bool webtrans_; - quiche::SimpleBufferAllocator* buffer_allocator_; MoqtFramer framer_; }; @@ -272,13 +270,9 @@ class MoqtFramerSimpleTest : public quic::test::QuicTest { public: - MoqtFramerSimpleTest() - : buffer_allocator_(quiche::SimpleBufferAllocator::Get()), - framer_(buffer_allocator_, /*web_transport=*/true) {} + MoqtFramerSimpleTest() : framer_(/*web_transport=*/true) {} - quiche::SimpleBufferAllocator* buffer_allocator_; MoqtFramer framer_; - // Obtain a pointer to an arbitrary offset in a serialized buffer. const uint8_t* BufferAtOffset(quiche::QuicheBuffer& buffer, size_t offset) { const char* data = buffer.data();
diff --git a/quiche/quic/moqt/moqt_session.cc b/quiche/quic/moqt/moqt_session.cc index 6518125..4727d5b 100644 --- a/quiche/quic/moqt/moqt_session.cc +++ b/quiche/quic/moqt/moqt_session.cc
@@ -48,7 +48,6 @@ #include "quiche/common/quiche_mem_slice.h" #include "quiche/common/quiche_stream.h" #include "quiche/common/quiche_weak_ptr.h" -#include "quiche/common/simple_buffer_allocator.h" #include "quiche/web_transport/web_transport.h" #define ENDPOINT \ @@ -101,7 +100,7 @@ : session_(session), parameters_(parameters), callbacks_(std::move(callbacks)), - framer_(quiche::SimpleBufferAllocator::Get(), parameters.using_webtrans), + framer_(parameters.using_webtrans), publisher_(DefaultPublisher::GetInstance()), local_max_request_id_(parameters.max_request_id), alarm_factory_(std::move(alarm_factory)),
diff --git a/quiche/quic/moqt/moqt_session_test.cc b/quiche/quic/moqt/moqt_session_test.cc index 3f2b500..23f82e8 100644 --- a/quiche/quic/moqt/moqt_session_test.cc +++ b/quiche/quic/moqt/moqt_session_test.cc
@@ -40,7 +40,6 @@ #include "quiche/common/quiche_buffer_allocator.h" #include "quiche/common/quiche_mem_slice.h" #include "quiche/common/quiche_stream.h" -#include "quiche/common/simple_buffer_allocator.h" #include "quiche/web_transport/test_tools/in_memory_stream.h" #include "quiche/web_transport/test_tools/mock_web_transport.h" #include "quiche/web_transport/web_transport.h" @@ -192,7 +191,7 @@ webtransport::test::MockStream* stream, std::unique_ptr<webtransport::StreamVisitor>& visitor, MockSubscribeRemoteTrackVisitor* track_visitor) { - MoqtFramer framer(quiche::SimpleBufferAllocator::Get(), true); + MoqtFramer framer(true); quiche::QuicheBuffer buffer = framer.SerializeObjectHeader( object, MoqtDataStreamType::Subgroup(object.subgroup_id, object.object_id, @@ -2741,7 +2740,7 @@ /*subgroup=*/0, /*payload_length=*/3, }; - MoqtFramer framer(quiche::SimpleBufferAllocator::Get(), true); + MoqtFramer framer(true); quiche::QuicheBuffer header = framer.SerializeObjectHeader( object, MoqtDataStreamType::Fetch(), std::nullopt); @@ -2997,7 +2996,7 @@ /*subgroup=*/0, /*payload_length=*/3, }; - MoqtFramer framer_(quiche::SimpleBufferAllocator::Get(), true); + MoqtFramer framer_(true); for (int i = 0; i < 4; ++i) { object.object_id = i; headers.push(framer_.SerializeObjectHeader( @@ -3069,7 +3068,7 @@ /*subgroup=*/0, /*payload_length=*/3, }; - MoqtFramer framer_(quiche::SimpleBufferAllocator::Get(), true); + MoqtFramer framer_(true); for (int i = 0; i < 4; ++i) { object.object_id = i; headers.push(framer_.SerializeObjectHeader( @@ -3162,7 +3161,7 @@ /*subgroup=*/0, /*payload_length=*/6, }; - MoqtFramer framer_(quiche::SimpleBufferAllocator::Get(), true); + MoqtFramer framer_(true); quiche::QuicheBuffer header = framer_.SerializeObjectHeader( object, MoqtDataStreamType::Fetch(), std::nullopt); stream.Receive(header.AsStringView(), false);
diff --git a/quiche/quic/moqt/test_tools/moqt_framer_utils.cc b/quiche/quic/moqt/test_tools/moqt_framer_utils.cc index 6073b87..f36c006 100644 --- a/quiche/quic/moqt/test_tools/moqt_framer_utils.cc +++ b/quiche/quic/moqt/test_tools/moqt_framer_utils.cc
@@ -18,7 +18,6 @@ #include "quiche/common/platform/api/quiche_test.h" #include "quiche/common/quiche_buffer_allocator.h" #include "quiche/common/quiche_stream.h" -#include "quiche/common/simple_buffer_allocator.h" #include "quiche/web_transport/test_tools/in_memory_stream.h" namespace moqt::test { @@ -236,7 +235,7 @@ std::string SerializeGenericMessage(const MoqtGenericFrame& frame, bool use_webtrans) { - MoqtFramer framer(quiche::SimpleBufferAllocator::Get(), use_webtrans); + MoqtFramer framer(use_webtrans); return std::string(std::visit(FramingVisitor{framer}, frame).AsStringView()); }
diff --git a/quiche/quic/moqt/tools/chat_client_bin.cc b/quiche/quic/moqt/tools/chat_client_bin.cc index c391c8c..8339582 100644 --- a/quiche/quic/moqt/tools/chat_client_bin.cc +++ b/quiche/quic/moqt/tools/chat_client_bin.cc
@@ -37,7 +37,7 @@ // Writes messages to a file, when directed from the command line. class FileOutput : public ChatUserInterface { public: - explicit FileOutput(absl::string_view filename, absl::string_view username) + explicit FileOutput(std::string filename, absl::string_view username) : username_(username) { output_file_.open(filename); output_file_ << "Chat transcript:\n";
diff --git a/quiche/quic/moqt/tools/moqt_relay.cc b/quiche/quic/moqt/tools/moqt_relay.cc index 554bc62..648cab5 100644 --- a/quiche/quic/moqt/tools/moqt_relay.cc +++ b/quiche/quic/moqt/tools/moqt_relay.cc
@@ -45,8 +45,7 @@ absl::string_view default_upstream, bool ignore_certificate, quic::QuicEventLoop* client_event_loop) - : ignore_certificate_(ignore_certificate), - client_event_loop_(client_event_loop), + : client_event_loop_(client_event_loop), // TODO(martinduke): Extend MoqtServer so that partial objects can be // received. server_(std::make_unique<MoqtServer>(std::move(proof_source),
diff --git a/quiche/quic/moqt/tools/moqt_relay.h b/quiche/quic/moqt/tools/moqt_relay.h index 239a1eb..4aabde3 100644 --- a/quiche/quic/moqt/tools/moqt_relay.h +++ b/quiche/quic/moqt/tools/moqt_relay.h
@@ -70,7 +70,6 @@ absl::string_view path); bool is_closing_ = false; - const bool ignore_certificate_; quic::QuicEventLoop* client_event_loop_; MoqtRelayPublisher publisher_;