Skip to content

Commit d8586e7

Browse files
DavidSchinazicopybara-github
authored andcommitted
Explictly mark ChunkedObliviousHttpClient as movable but not copyable
PiperOrigin-RevId: 860198615
1 parent b320640 commit d8586e7

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

quiche/oblivious_http/oblivious_http_client.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,16 @@ class QUICHE_EXPORT ObliviousHttpClient {
8888
// cycle.
8989
class QUICHE_EXPORT ChunkedObliviousHttpClient {
9090
public:
91+
// Movable but not copyable.
92+
ChunkedObliviousHttpClient(const ChunkedObliviousHttpClient& other) = delete;
93+
ChunkedObliviousHttpClient& operator=(
94+
const ChunkedObliviousHttpClient& other) = delete;
95+
ChunkedObliviousHttpClient(ChunkedObliviousHttpClient&& other) = default;
96+
// Move assignment disabled because chunk_handler_ is a reference. If we
97+
// ever need move assignment, we'll have to switch that to a pointer.
98+
ChunkedObliviousHttpClient& operator=(ChunkedObliviousHttpClient&& other) =
99+
delete;
100+
91101
// Creates a new ChunkedObliviousHttpClient. Does not take ownership of
92102
// `chunk_handler`, which must refer to a valid handler that outlives this
93103
// client. The `seed` parameter is used to initialize the HPKE sender context.

0 commit comments

Comments
 (0)