Commit 86819fbc authored by Bence Béky's avatar Bence Béky Committed by Commit Bot

Define HTTP2_FLAG_COUNT and use it for http2_varint_decode_64_bits.

This CL lands server change 221616382 by bnc.

BUG=488484

Change-Id: I2f8d913b85d57a565da11572e8dc87b6c3a6495b
Reviewed-on: https://chromium-review.googlesource.com/c/1341092Reviewed-by: default avatarDianna Hu <diannahu@chromium.org>
Commit-Queue: Ryan Hamilton <rch@chromium.org>
Cr-Commit-Position: refs/heads/master@{#611350}
parent 993fb6b5
...@@ -1209,6 +1209,7 @@ component("net") { ...@@ -1209,6 +1209,7 @@ component("net") {
"third_party/http2/http2_structures.h", "third_party/http2/http2_structures.h",
"third_party/http2/platform/api/http2_arraysize.h", "third_party/http2/platform/api/http2_arraysize.h",
"third_party/http2/platform/api/http2_export.h", "third_party/http2/platform/api/http2_export.h",
"third_party/http2/platform/api/http2_flag_utils.h",
"third_party/http2/platform/api/http2_flags.h", "third_party/http2/platform/api/http2_flags.h",
"third_party/http2/platform/api/http2_optional.h", "third_party/http2/platform/api/http2_optional.h",
"third_party/http2/platform/api/http2_ptr_util.h", "third_party/http2/platform/api/http2_ptr_util.h",
...@@ -1218,6 +1219,7 @@ component("net") { ...@@ -1218,6 +1219,7 @@ component("net") {
"third_party/http2/platform/api/http2_string_utils.h", "third_party/http2/platform/api/http2_string_utils.h",
"third_party/http2/platform/impl/http2_arraysize_impl.h", "third_party/http2/platform/impl/http2_arraysize_impl.h",
"third_party/http2/platform/impl/http2_export_impl.h", "third_party/http2/platform/impl/http2_export_impl.h",
"third_party/http2/platform/impl/http2_flag_utils_impl.h",
"third_party/http2/platform/impl/http2_flags_impl.cc", "third_party/http2/platform/impl/http2_flags_impl.cc",
"third_party/http2/platform/impl/http2_flags_impl.h", "third_party/http2/platform/impl/http2_flags_impl.h",
"third_party/http2/platform/impl/http2_optional_impl.h", "third_party/http2/platform/impl/http2_optional_impl.h",
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
#include "net/third_party/http2/hpack/varint/hpack_varint_decoder.h" #include "net/third_party/http2/hpack/varint/hpack_varint_decoder.h"
#include "net/third_party/http2/platform/api/http2_flag_utils.h"
#include "net/third_party/http2/platform/api/http2_string_utils.h" #include "net/third_party/http2/platform/api/http2_string_utils.h"
namespace http2 { namespace http2 {
...@@ -43,6 +44,7 @@ DecodeStatus HpackVarintDecoder::StartExtended(uint8_t prefix_length, ...@@ -43,6 +44,7 @@ DecodeStatus HpackVarintDecoder::StartExtended(uint8_t prefix_length,
DecodeStatus HpackVarintDecoder::Resume(DecodeBuffer* db) { DecodeStatus HpackVarintDecoder::Resume(DecodeBuffer* db) {
if (decode_64_bits_) { if (decode_64_bits_) {
HTTP2_FLAG_COUNT(chromium_flag_http2_varint_decode_64_bits);
// There can be at most 10 continuation bytes. Offset is zero for the // There can be at most 10 continuation bytes. Offset is zero for the
// first one and increases by 7 for each subsequent one. // first one and increases by 7 for each subsequent one.
const uint8_t kMaxOffset = 63; const uint8_t kMaxOffset = 63;
......
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef NET_THIRD_PARTY_HTTP2_PLATFORM_API_HTTP2_FLAG_UTILS_H_
#define NET_THIRD_PARTY_HTTP2_PLATFORM_API_HTTP2_FLAG_UTILS_H_
#include "net/third_party/http2/platform/impl/http2_flag_utils_impl.h"
#define HTTP2_FLAG_COUNT HTTP2_FLAG_COUNT_IMPL
#define HTTP2_FLAG_COUNT_N HTTP2_FLAG_COUNT_N_IMPL
#define HTTP2_CODE_COUNT HTTP2_CODE_COUNT_IMPL
#define HTTP2_CODE_COUNT_N HTTP2_CODE_COUNT_N_IMPL
#endif // NET_THIRD_PARTY_HTTP2_PLATFORM_API_HTTP2_FLAG_UTILS_H_
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef NET_THIRD_PARTY_HTTP2_PLATFORM_IMPL_HTTP2_FLAG_UTILS_IMPL_H_
#define NET_THIRD_PARTY_HTTP2_PLATFORM_IMPL_HTTP2_FLAG_UTILS_IMPL_H_
#include "base/logging.h"
#define HTTP2_FLAG_COUNT_IMPL(flag) \
DVLOG(1) << "FLAG_" #flag ": " << FLAGS_##flag
#define HTTP2_FLAG_COUNT_N_IMPL(flag, instance, total) \
HTTP2_FLAG_COUNT_IMPL(flag)
#define HTTP2_CODE_COUNT_IMPL(name) \
do { \
} while (0)
#define HTTP2_CODE_COUNT_N_IMPL(name, instance, total) \
do { \
} while (0)
#endif // NET_THIRD_PARTY_HTTP2_PLATFORM_IMPL_HTTP2_FLAG_UTILS_IMPL_H_
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment