HPACK:  Check pseudo-header order in decoder.

Treat a header block with a pseudo-header field following a regular one as
malformed, as required by HTTP/2 draft-14 Section 8.1.2.1.

This lands server change 74067938 by bnc.

BUG=400336

Review URL: https://codereview.chromium.org/531253004

Cr-Commit-Position: refs/heads/master@{#293534}
bool HpackDecoder::DecodeNextName(
    HpackInputStream* input_stream, StringPiece* next_name) {
  uint32 index_or_zero = 0;
  if (!input_stream->DecodeNextUint32(&index_or_zero))
    return false;

  if (index_or_zero == 0)
    return DecodeNextStringLiteral(input_stream, true, next_name);

  const HpackEntry* entry = header_table_.GetByIndex(index_or_zero);
  if (entry == NULL) {
    return false;
  } else if (entry->IsStatic()) {
    *next_name = entry->name();
  } else {
    key_buffer_.assign(entry->name());
    *next_name = key_buffer_;
  }
  return true;
}

bool HpackDecoder::DecodeNextName(
    HpackInputStream* input_stream, StringPiece* next_name) {
  uint32 index_or_zero = 0;
  if (!input_stream->DecodeNextUint32(&index_or_zero))
    return false;

  if (index_or_zero == 0)
    return DecodeNextStringLiteral(input_stream, true, next_name);

  const HpackEntry* entry = header_table_.GetByIndex(index_or_zero);
  if (entry == NULL) {
    return false;
  } else if (entry->IsStatic()) {
    *next_name = entry->name();
  } else {
    key_buffer_.assign(entry->name());
    *next_name = key_buffer_;
  }
  return true;
}
