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 "quiche/http2/decoder/decode_status.h" 6 7 #include "quiche/common/platform/api/quiche_bug_tracker.h" 8 #include "quiche/common/platform/api/quiche_logging.h" 9 10 namespace http2 { 11 operator <<(std::ostream & out,DecodeStatus v)12std::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 QUICHE_BUG(http2_bug_147_1) << "Unknown DecodeStatus " << unknown; 25 return out << "DecodeStatus(" << unknown << ")"; 26 } 27 28 } // namespace http2 29