next_proto.h 913 B

1234567891011121314151617181920212223242526272829303132333435
  1. // Copyright (c) 2012 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #ifndef NET_SOCKET_NEXT_PROTO_H_
  5. #define NET_SOCKET_NEXT_PROTO_H_
  6. #include <vector>
  7. #include "base/strings/string_piece.h"
  8. #include "net/base/net_export.h"
  9. namespace net {
  10. // This enum is used in Net.SSLNegotiatedAlpnProtocol histogram.
  11. // Do not change or re-use values.
  12. enum NextProto {
  13. kProtoUnknown = 0,
  14. kProtoHTTP11 = 1,
  15. kProtoHTTP2 = 2,
  16. kProtoQUIC = 3,
  17. kProtoLast = kProtoQUIC
  18. };
  19. // List of protocols to use for ALPN, used for configuring HttpNetworkSessions.
  20. typedef std::vector<NextProto> NextProtoVector;
  21. NET_EXPORT_PRIVATE NextProto
  22. NextProtoFromString(base::StringPiece proto_string);
  23. NET_EXPORT_PRIVATE const char* NextProtoToString(NextProto next_proto);
  24. } // namespace net
  25. #endif // NET_SOCKET_NEXT_PROTO_H_