QUICHE team | fd50a40 | 2018-12-07 22:54:05 -0500 | [diff] [blame] | 1 | // Copyright 2016 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 | |
| 5 | #include "net/third_party/quiche/src/http2/decoder/decode_status.h" |
| 6 | |
QUICHE team | fd50a40 | 2018-12-07 22:54:05 -0500 | [diff] [blame] | 7 | #include "net/third_party/quiche/src/http2/platform/api/http2_bug_tracker.h" |
QUICHE team | 61940b4 | 2019-03-07 23:32:27 -0500 | [diff] [blame] | 8 | #include "net/third_party/quiche/src/http2/platform/api/http2_logging.h" |
QUICHE team | fd50a40 | 2018-12-07 22:54:05 -0500 | [diff] [blame] | 9 | |
| 10 | namespace http2 { |
| 11 | |
| 12 | std::ostream& operator<<(std::ostream& out, DecodeStatus v) { |
| 13 | switch (v) { |
| 14 | case DecodeStatus::kDecodeDone: |
| 15 | return out << "DecodeDone"; |
| 16 | case DecodeStatus::kDecodeInProgress: |
| 17 | return out << "DecodeInProgress"; |
| 18 | case DecodeStatus::kDecodeError: |
| 19 | return out << "DecodeError"; |
| 20 | } |
| 21 | // Since the value doesn't come over the wire, only a programming bug should |
| 22 | // result in reaching this point. |
| 23 | int unknown = static_cast<int>(v); |
| 24 | HTTP2_BUG << "Unknown DecodeStatus " << unknown; |
| 25 | return out << "DecodeStatus(" << unknown << ")"; |
| 26 | } |
| 27 | |
| 28 | } // namespace http2 |