xref: /aosp_15_r20/external/cronet/net/base/idempotency.h (revision 6777b5387eb2ff775bb5750e3f5d96f37fb7352b)
1 // Copyright 2012 The Chromium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #ifndef NET_BASE_IDEMPOTENCY_H_
6 #define NET_BASE_IDEMPOTENCY_H_
7 
8 namespace net {
9 
10 // Idempotency of the request, which determines that if it is safe to enable
11 // 0-RTT for the request. By default, 0-RTT is only enabled for safe
12 // HTTP methods, i.e., GET, HEAD, OPTIONS, and TRACE. For other methods,
13 // enabling 0-RTT may cause security issues since a network observer can replay
14 // the request. If the request has any side effects, those effects can happen
15 // multiple times. It is only safe to enable the 0-RTT if it is known that
16 // the request is idempotent.
17 // A Java counterpart will be generated for this enum.
18 // GENERATED_JAVA_ENUM_PACKAGE: org.chromium.net
19 // GENERATED_JAVA_CLASS_NAME_OVERRIDE: Idempotency
20 enum Idempotency {
21   DEFAULT_IDEMPOTENCY = 0,
22   IDEMPOTENT = 1,
23   NOT_IDEMPOTENT = 2,
24 };
25 
26 }  // namespace net
27 
28 #endif  // NET_BASE_IDEMPOTENCY_H_
29