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

Add GetSpdyReloadableFlag() macro.

Also move FLAGS_chromium_http2_flag_h2_on_stream_pad_length from
spdy/chromium/spdy_flags.{h,cc} to
spdy/platform/impl/spdy_flags_impl.{h,cc}, and rename to
h2_on_stream_pad_length.

This CL merges server side changes 182949930 by jtoohill
and 182975401 by diannahu.

Bug: 488484
Change-Id: I1dc62b04a0529261bc72f498dd2987a8dd2f748c
Reviewed-on: https://chromium-review.googlesource.com/887903Reviewed-by: default avatarHelen Li <xunjieli@chromium.org>
Commit-Queue: Bence Béky <bnc@chromium.org>
Cr-Commit-Position: refs/heads/master@{#532107}
parent 4fc511da
......@@ -1605,8 +1605,6 @@ component("net") {
"spdy/chromium/spdy_buffer.h",
"spdy/chromium/spdy_buffer_producer.cc",
"spdy/chromium/spdy_buffer_producer.h",
"spdy/chromium/spdy_flags.cc",
"spdy/chromium/spdy_flags.h",
"spdy/chromium/spdy_http_stream.cc",
"spdy/chromium/spdy_http_stream.h",
"spdy/chromium/spdy_http_utils.cc",
......@@ -1671,6 +1669,7 @@ component("net") {
"spdy/core/zero_copy_output_buffer.h",
"spdy/platform/api/spdy_estimate_memory_usage.h",
"spdy/platform/api/spdy_export.h",
"spdy/platform/api/spdy_flags.h",
"spdy/platform/api/spdy_mem_slice.h",
"spdy/platform/api/spdy_ptr_util.h",
"spdy/platform/api/spdy_string.h",
......@@ -1678,6 +1677,8 @@ component("net") {
"spdy/platform/api/spdy_string_utils.h",
"spdy/platform/impl/spdy_estimate_memory_usage_impl.h",
"spdy/platform/impl/spdy_export_impl.h",
"spdy/platform/impl/spdy_flags_impl.cc",
"spdy/platform/impl/spdy_flags_impl.h",
"spdy/platform/impl/spdy_mem_slice_impl.cc",
"spdy/platform/impl/spdy_mem_slice_impl.h",
"spdy/platform/impl/spdy_ptr_util_impl.h",
......
......@@ -9,8 +9,8 @@
#include "base/logging.h"
#include "base/strings/string_util.h"
#include "net/spdy/chromium/spdy_flags.h"
#include "net/spdy/platform/api/spdy_estimate_memory_usage.h"
#include "net/spdy/platform/api/spdy_flags.h"
namespace net {
......@@ -24,7 +24,7 @@ size_t kGoAwayDebugDataMaxSize = 1024;
BufferedSpdyFramer::BufferedSpdyFramer(uint32_t max_header_list_size,
const NetLogWithSource& net_log)
: spdy_framer_(SpdyFramer::ENABLE_COMPRESSION),
deframer_(FLAGS_chromium_http2_flag_h2_on_stream_pad_length),
deframer_(GetSpdyReloadableFlag(h2_on_stream_pad_length)),
visitor_(NULL),
frames_received_(0),
max_header_list_size_(max_header_list_size),
......
......@@ -16,7 +16,6 @@
#include "base/macros.h"
#include "base/strings/string_number_conversions.h"
#include "net/quic/platform/api/quic_flags.h"
#include "net/spdy/chromium/spdy_flags.h"
#include "net/spdy/core/array_output_buffer.h"
#include "net/spdy/core/hpack/hpack_constants.h"
#include "net/spdy/core/mock_spdy_framer_visitor.h"
......@@ -25,6 +24,7 @@
#include "net/spdy/core/spdy_frame_reader.h"
#include "net/spdy/core/spdy_protocol.h"
#include "net/spdy/core/spdy_test_utils.h"
#include "net/spdy/platform/api/spdy_flags.h"
#include "net/spdy/platform/api/spdy_ptr_util.h"
#include "net/spdy/platform/api/spdy_string.h"
#include "net/spdy/platform/api/spdy_string_utils.h"
......@@ -371,7 +371,7 @@ class TestSpdyVisitor : public SpdyFramerVisitorInterface,
explicit TestSpdyVisitor(SpdyFramer::CompressionOption option)
: framer_(option),
deframer_(FLAGS_chromium_http2_flag_h2_on_stream_pad_length),
deframer_(GetSpdyReloadableFlag(h2_on_stream_pad_length)),
error_count_(0),
headers_frame_count_(0),
push_promise_frame_count_(0),
......@@ -737,7 +737,7 @@ class SpdyFramerTest : public ::testing::TestWithParam<Output> {
SpdyFramerTest()
: output_(output_buffer, kSize),
framer_(SpdyFramer::ENABLE_COMPRESSION),
deframer_(FLAGS_chromium_http2_flag_h2_on_stream_pad_length) {}
deframer_(GetSpdyReloadableFlag(h2_on_stream_pad_length)) {}
protected:
void SetUp() override {
......@@ -959,7 +959,7 @@ TEST_P(SpdyFramerTest, CorrectlySizedDataPaddingNoError) {
{
testing::InSequence seq;
EXPECT_CALL(visitor, OnDataFrameHeader(1, 5, false));
if (FLAGS_chromium_http2_flag_h2_on_stream_pad_length) {
if (GetSpdyReloadableFlag(h2_on_stream_pad_length)) {
EXPECT_CALL(visitor, OnStreamPadLength(1, 4));
} else {
EXPECT_CALL(visitor, OnStreamPadding(1, 1));
......@@ -3270,7 +3270,7 @@ TEST_P(SpdyFramerTest, ProcessDataFrameWithPadding) {
bytes_consumed += kDataFrameMinimumSize;
// Send the padding length field.
if (FLAGS_chromium_http2_flag_h2_on_stream_pad_length) {
if (GetSpdyReloadableFlag(h2_on_stream_pad_length)) {
EXPECT_CALL(visitor, OnStreamPadLength(1, kPaddingLen - 1));
} else {
EXPECT_CALL(visitor, OnStreamPadding(1, 1));
......
// 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_SPDY_PLATFORM_API_SPDY_FLAGS_H_
#define NET_SPDY_PLATFORM_API_SPDY_FLAGS_H_
#include "net/spdy/platform/impl/spdy_flags_impl.h"
#define GetSpdyReloadableFlag(flag) GetSpdyReloadableFlagImpl(flag)
#endif // NET_SPDY_PLATFORM_API_SPDY_FLAGS_H_
// Copyright 2016 The Chromium Authors. All rights reserved.
// 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.
#include "net/spdy/chromium/spdy_flags.h"
#include "net/spdy/platform/impl/spdy_flags_impl.h"
namespace net {
// Deliver OnPaddingLength separately from OnPadding.
bool FLAGS_chromium_http2_flag_h2_on_stream_pad_length = true;
bool h2_on_stream_pad_length = true;
} // namespace net
// Copyright 2016 The Chromium Authors. All rights reserved.
// 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_SPDY_CHROMIUM_SPDY_FLAGS_H_
#define NET_SPDY_CHROMIUM_SPDY_FLAGS_H_
#ifndef NET_SPDY_PLATFORM_IMPL_SPDY_FLAGS_IMPL_H_
#define NET_SPDY_PLATFORM_IMPL_SPDY_FLAGS_IMPL_H_
#include "net/base/net_export.h"
namespace net {
NET_EXPORT_PRIVATE extern bool
FLAGS_chromium_http2_flag_h2_on_stream_pad_length;
NET_EXPORT_PRIVATE extern bool h2_on_stream_pad_length;
inline bool GetSpdyReloadableFlagImpl(bool flag) {
return flag;
}
} // namespace net
#endif // NET_SPDY_CHROMIUM_SPDY_FLAGS_H_
#endif // NET_SPDY_PLATFORM_IMPL_SPDY_FLAGS_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