Commit 9f54e0e2 authored by Victor Vasiliev's avatar Victor Vasiliev Committed by Commit Bot

Introduce SPDY_ARRAYSIZE into SPDY platform in order to remove discrepancies with google3

Merge internal change: 217614033

R=rch@chromium.org

Change-Id: I98840145bf0ce13e165e17acac196fb92af6f7af
Reviewed-on: https://chromium-review.googlesource.com/c/1288849
Commit-Queue: Victor Vasiliev <vasilvv@chromium.org>
Reviewed-by: default avatarRyan Hamilton <rch@chromium.org>
Cr-Commit-Position: refs/heads/master@{#600918}
parent fabbd969
......@@ -1636,6 +1636,7 @@ component("net") {
"third_party/spdy/core/spdy_protocol.h",
"third_party/spdy/core/write_scheduler.h",
"third_party/spdy/core/zero_copy_output_buffer.h",
"third_party/spdy/platform/api/spdy_arraysize.h",
"third_party/spdy/platform/api/spdy_estimate_memory_usage.h",
"third_party/spdy/platform/api/spdy_export.h",
"third_party/spdy/platform/api/spdy_flags.h",
......@@ -1644,6 +1645,7 @@ component("net") {
"third_party/spdy/platform/api/spdy_string.h",
"third_party/spdy/platform/api/spdy_string_piece.h",
"third_party/spdy/platform/api/spdy_string_utils.h",
"third_party/spdy/platform/impl/spdy_arraysize_impl.h",
"third_party/spdy/platform/impl/spdy_estimate_memory_usage_impl.h",
"third_party/spdy/platform/impl/spdy_export_impl.h",
"third_party/spdy/platform/impl/spdy_flags_impl.cc",
......
......@@ -11,6 +11,7 @@
#include "base/memory/singleton.h"
#include "net/third_party/spdy/core/hpack/hpack_huffman_table.h"
#include "net/third_party/spdy/core/hpack/hpack_static_table.h"
#include "net/third_party/spdy/platform/api/spdy_arraysize.h"
#include "net/third_party/spdy/platform/api/spdy_ptr_util.h"
namespace spdy {
......@@ -327,13 +328,13 @@ std::vector<HpackHuffmanSymbol> HpackHuffmanCode() {
{0xfffffffcul, 30, 256}, // EOS 11111111|11111111|11111111|111111
};
return std::vector<HpackHuffmanSymbol>(
kHpackHuffmanCode, kHpackHuffmanCode + arraysize(kHpackHuffmanCode));
kHpackHuffmanCode, kHpackHuffmanCode + SPDY_ARRAYSIZE(kHpackHuffmanCode));
}
// The "constructor" for a HpackStaticEntry that computes the lengths at
// compile time.
#define STATIC_ENTRY(name, value) \
{ name, arraysize(name) - 1, value, arraysize(value) - 1 }
{ name, SPDY_ARRAYSIZE(name) - 1, value, SPDY_ARRAYSIZE(value) - 1 }
std::vector<HpackStaticEntry> HpackStaticTableVector() {
static const HpackStaticEntry kHpackStaticTable[] = {
......@@ -400,7 +401,7 @@ std::vector<HpackStaticEntry> HpackStaticTableVector() {
STATIC_ENTRY("www-authenticate", ""), // 61
};
return std::vector<HpackStaticEntry>(
kHpackStaticTable, kHpackStaticTable + arraysize(kHpackStaticTable));
kHpackStaticTable, kHpackStaticTable + SPDY_ARRAYSIZE(kHpackStaticTable));
}
#undef STATIC_ENTRY
......
......@@ -22,6 +22,7 @@
#include "net/third_party/spdy/core/hpack/hpack_encoder.h"
#include "net/third_party/spdy/core/hpack/hpack_output_stream.h"
#include "net/third_party/spdy/core/spdy_test_utils.h"
#include "net/third_party/spdy/platform/api/spdy_arraysize.h"
#include "net/third_party/spdy/platform/api/spdy_string.h"
#include "net/third_party/spdy/platform/api/spdy_string_utils.h"
#include "testing/gmock/include/gmock/gmock.h"
......@@ -586,8 +587,8 @@ TEST_P(HpackDecoderAdapterTest, LiteralHeaderNoIndexing) {
// First header with indexed name, second header with string literal
// name.
const char input[] = "\x04\x0c/sample/path\x00\x06:path2\x0e/sample/path/2";
const SpdyHeaderBlock& header_set =
DecodeBlockExpectingSuccess(SpdyStringPiece(input, arraysize(input) - 1));
const SpdyHeaderBlock& header_set = DecodeBlockExpectingSuccess(
SpdyStringPiece(input, SPDY_ARRAYSIZE(input) - 1));
SpdyHeaderBlock expected_header_set;
expected_header_set[":path"] = "/sample/path";
......@@ -599,8 +600,8 @@ TEST_P(HpackDecoderAdapterTest, LiteralHeaderNoIndexing) {
// indexing and string literal names should work.
TEST_P(HpackDecoderAdapterTest, LiteralHeaderIncrementalIndexing) {
const char input[] = "\x44\x0c/sample/path\x40\x06:path2\x0e/sample/path/2";
const SpdyHeaderBlock& header_set =
DecodeBlockExpectingSuccess(SpdyStringPiece(input, arraysize(input) - 1));
const SpdyHeaderBlock& header_set = DecodeBlockExpectingSuccess(
SpdyStringPiece(input, SPDY_ARRAYSIZE(input) - 1));
SpdyHeaderBlock expected_header_set;
expected_header_set[":path"] = "/sample/path";
......
......@@ -14,6 +14,7 @@
#include "net/third_party/http2/hpack/huffman/hpack_huffman_decoder.h"
#include "net/third_party/spdy/core/hpack/hpack_constants.h"
#include "net/third_party/spdy/core/hpack/hpack_output_stream.h"
#include "net/third_party/spdy/platform/api/spdy_arraysize.h"
#include "net/third_party/spdy/platform/api/spdy_string_utils.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
......@@ -84,7 +85,7 @@ TEST_F(GenericHuffmanTableTest, InitializeEdgeCases) {
{bits32("11000000000000000000000000000000"), 3, 6},
{bits32("11100000000000000000000000000000"), 8, 7}};
HpackHuffmanTable table;
EXPECT_TRUE(table.Initialize(code, arraysize(code)));
EXPECT_TRUE(table.Initialize(code, SPDY_ARRAYSIZE(code)));
}
{
// But using 2 bits with one symbol overflows the code.
......@@ -98,7 +99,7 @@ TEST_F(GenericHuffmanTableTest, InitializeEdgeCases) {
{bits32("11100000000000000000000000000000"), 3, 6},
{bits32("00000000000000000000000000000000"), 8, 7}}; // Overflow.
HpackHuffmanTable table;
EXPECT_FALSE(table.Initialize(code, arraysize(code)));
EXPECT_FALSE(table.Initialize(code, SPDY_ARRAYSIZE(code)));
EXPECT_EQ(7, HpackHuffmanTablePeer(table).failed_symbol_id());
}
{
......@@ -109,7 +110,7 @@ TEST_F(GenericHuffmanTableTest, InitializeEdgeCases) {
{bits32("11000000000000000000000000000000"), 3, 2},
{bits32("11100000000000000000000000000000"), 8, 3}};
HpackHuffmanTable table;
EXPECT_TRUE(table.Initialize(code, arraysize(code)));
EXPECT_TRUE(table.Initialize(code, SPDY_ARRAYSIZE(code)));
}
{
// But repeating a length overflows the code.
......@@ -119,7 +120,7 @@ TEST_F(GenericHuffmanTableTest, InitializeEdgeCases) {
{bits32("11000000000000000000000000000000"), 2, 2},
{bits32("00000000000000000000000000000000"), 8, 3}}; // Overflow.
HpackHuffmanTable table;
EXPECT_FALSE(table.Initialize(code, arraysize(code)));
EXPECT_FALSE(table.Initialize(code, SPDY_ARRAYSIZE(code)));
EXPECT_EQ(3, HpackHuffmanTablePeer(table).failed_symbol_id());
}
{
......@@ -130,7 +131,7 @@ TEST_F(GenericHuffmanTableTest, InitializeEdgeCases) {
{bits32("11000000000000000000000000000000"), 3, 1}, // Repeat.
{bits32("11100000000000000000000000000000"), 8, 3}};
HpackHuffmanTable table;
EXPECT_FALSE(table.Initialize(code, arraysize(code)));
EXPECT_FALSE(table.Initialize(code, SPDY_ARRAYSIZE(code)));
EXPECT_EQ(2, HpackHuffmanTablePeer(table).failed_symbol_id());
}
{
......@@ -141,7 +142,7 @@ TEST_F(GenericHuffmanTableTest, InitializeEdgeCases) {
{bits32("10100000000000000000000000000000"), 4, 2},
{bits32("10110000000000000000000000000000"), 8, 3}};
HpackHuffmanTable table;
EXPECT_FALSE(table.Initialize(code, arraysize(code)));
EXPECT_FALSE(table.Initialize(code, SPDY_ARRAYSIZE(code)));
EXPECT_EQ(0, HpackHuffmanTablePeer(table).failed_symbol_id());
}
{
......@@ -152,7 +153,7 @@ TEST_F(GenericHuffmanTableTest, InitializeEdgeCases) {
{bits32("11000000000000000000000000000000"), 2, 2}, // Not canonical.
{bits32("10000000000000000000000000000000"), 8, 3}};
HpackHuffmanTable table;
EXPECT_FALSE(table.Initialize(code, arraysize(code)));
EXPECT_FALSE(table.Initialize(code, SPDY_ARRAYSIZE(code)));
EXPECT_EQ(2, HpackHuffmanTablePeer(table).failed_symbol_id());
}
{
......@@ -163,7 +164,7 @@ TEST_F(GenericHuffmanTableTest, InitializeEdgeCases) {
{bits32("11000000000000000000000000000000"), 3, 2},
{bits32("11100000000000000000000000000000"), 7, 3}};
HpackHuffmanTable table;
EXPECT_FALSE(table.Initialize(code, arraysize(code)));
EXPECT_FALSE(table.Initialize(code, SPDY_ARRAYSIZE(code)));
}
}
......@@ -177,10 +178,10 @@ TEST_F(GenericHuffmanTableTest, ValidateInternalsWithSmallCode) {
{bits32("10001000000000000000000000000000"), 5, 5}, // 6th.
{bits32("10011000000000000000000000000000"), 8, 6}, // 8th.
{bits32("10010000000000000000000000000000"), 5, 7}}; // 7th.
EXPECT_TRUE(table_.Initialize(code, arraysize(code)));
ASSERT_EQ(arraysize(code), peer_.code_by_id().size());
ASSERT_EQ(arraysize(code), peer_.length_by_id().size());
for (size_t i = 0; i < arraysize(code); ++i) {
EXPECT_TRUE(table_.Initialize(code, SPDY_ARRAYSIZE(code)));
ASSERT_EQ(SPDY_ARRAYSIZE(code), peer_.code_by_id().size());
ASSERT_EQ(SPDY_ARRAYSIZE(code), peer_.length_by_id().size());
for (size_t i = 0; i < SPDY_ARRAYSIZE(code); ++i) {
EXPECT_EQ(code[i].code, peer_.code_by_id()[i]);
EXPECT_EQ(code[i].length, peer_.length_by_id()[i]);
}
......@@ -188,11 +189,11 @@ TEST_F(GenericHuffmanTableTest, ValidateInternalsWithSmallCode) {
EXPECT_EQ(bits8("10011000"), peer_.pad_bits());
char input_storage[] = {2, 3, 2, 7, 4};
SpdyStringPiece input(input_storage, arraysize(input_storage));
SpdyStringPiece input(input_storage, SPDY_ARRAYSIZE(input_storage));
// By symbol: (2) 00 (3) 010 (2) 00 (7) 10010 (4) 10000 (6 as pad) 1001100.
char expect_storage[] = {bits8("00010001"), bits8("00101000"),
bits8("01001100")};
SpdyStringPiece expect(expect_storage, arraysize(expect_storage));
SpdyStringPiece expect(expect_storage, SPDY_ARRAYSIZE(expect_storage));
EXPECT_EQ(expect, EncodeString(input));
}
......@@ -231,7 +232,7 @@ TEST_F(HpackHuffmanTableTest, SpecRequestExamples) {
"custom-value",
};
// Round-trip each test example.
for (size_t i = 0; i != arraysize(test_table); i += 2) {
for (size_t i = 0; i != SPDY_ARRAYSIZE(test_table); i += 2) {
const SpdyString& encodedFixture(test_table[i]);
const SpdyString& decodedFixture(test_table[i + 1]);
DecodeString(encodedFixture, &buffer);
......@@ -260,7 +261,7 @@ TEST_F(HpackHuffmanTableTest, SpecResponseExamples) {
"foo=ASDJKHQKBZXOQWEOPIUAXQWEOIU; max-age=3600; version=1",
};
// Round-trip each test example.
for (size_t i = 0; i != arraysize(test_table); i += 2) {
for (size_t i = 0; i != SPDY_ARRAYSIZE(test_table); i += 2) {
const SpdyString& encodedFixture(test_table[i]);
const SpdyString& decodedFixture(test_table[i + 1]);
DecodeString(encodedFixture, &buffer);
......@@ -274,7 +275,7 @@ TEST_F(HpackHuffmanTableTest, RoundTripIndividualSymbols) {
for (size_t i = 0; i != 256; i++) {
char c = static_cast<char>(i);
char storage[3] = {c, c, c};
SpdyStringPiece input(storage, arraysize(storage));
SpdyStringPiece input(storage, SPDY_ARRAYSIZE(storage));
SpdyString buffer_in = EncodeString(input);
SpdyString buffer_out;
DecodeString(buffer_in, &buffer_out);
......@@ -288,7 +289,7 @@ TEST_F(HpackHuffmanTableTest, RoundTripSymbolSequence) {
storage[i] = static_cast<char>(i);
storage[511 - i] = static_cast<char>(i);
}
SpdyStringPiece input(storage, arraysize(storage));
SpdyStringPiece input(storage, SPDY_ARRAYSIZE(storage));
SpdyString buffer_in = EncodeString(input);
SpdyString buffer_out;
......@@ -308,12 +309,12 @@ TEST_F(HpackHuffmanTableTest, EncodedSizeAgreesWithEncodeString) {
};
for (size_t i = 0; i != 256; ++i) {
// Expand last |test_table| entry to cover all codes.
test_table[arraysize(test_table) - 1][i] = static_cast<char>(i);
test_table[SPDY_ARRAYSIZE(test_table) - 1][i] = static_cast<char>(i);
}
HpackOutputStream output_stream;
SpdyString encoding;
for (size_t i = 0; i != arraysize(test_table); ++i) {
for (size_t i = 0; i != SPDY_ARRAYSIZE(test_table); ++i) {
table_.EncodeString(test_table[i], &output_stream);
output_stream.TakeString(&encoding);
EXPECT_EQ(encoding.size(), table_.EncodedSize(test_table[i]));
......
......@@ -9,6 +9,7 @@
#include <memory>
#include "base/sys_byteorder.h"
#include "net/third_party/spdy/platform/api/spdy_arraysize.h"
#include "testing/platform_test.h"
namespace spdy {
......@@ -40,7 +41,7 @@ TEST(SpdyFrameReaderTest, ReadUInt32) {
};
SpdyFrameReader frame_reader(reinterpret_cast<const char*>(kFrameData),
arraysize(kFrameData) * sizeof(uint32_t));
SPDY_ARRAYSIZE(kFrameData) * sizeof(uint32_t));
EXPECT_FALSE(frame_reader.IsDoneReading());
uint32_t uint32_val;
......@@ -63,7 +64,7 @@ TEST(SpdyFrameReaderTest, ReadStringPiece16) {
0x20, 0x31, 0x2c, 0x20, 0x32, 0x2c, 0x20, 0x33, // "Testing, 1, 2, 3"
};
SpdyFrameReader frame_reader(kFrameData, arraysize(kFrameData));
SpdyFrameReader frame_reader(kFrameData, SPDY_ARRAYSIZE(kFrameData));
EXPECT_FALSE(frame_reader.IsDoneReading());
SpdyStringPiece stringpiece_val;
......@@ -86,7 +87,7 @@ TEST(SpdyFrameReaderTest, ReadStringPiece32) {
0x20, 0x34, 0x2c, 0x20, 0x35, 0x2c, 0x20, 0x36, // "Testing, 4, 5, 6"
};
SpdyFrameReader frame_reader(kFrameData, arraysize(kFrameData));
SpdyFrameReader frame_reader(kFrameData, SPDY_ARRAYSIZE(kFrameData));
EXPECT_FALSE(frame_reader.IsDoneReading());
SpdyStringPiece stringpiece_val;
......@@ -105,7 +106,7 @@ TEST(SpdyFrameReaderTest, ReadUInt16WithBufferTooSmall) {
0x00, // part of a uint16_t
};
SpdyFrameReader frame_reader(kFrameData, arraysize(kFrameData));
SpdyFrameReader frame_reader(kFrameData, SPDY_ARRAYSIZE(kFrameData));
EXPECT_FALSE(frame_reader.IsDoneReading());
uint16_t uint16_val;
......@@ -118,7 +119,7 @@ TEST(SpdyFrameReaderTest, ReadUInt32WithBufferTooSmall) {
0x00, 0x00, 0x00, // part of a uint32_t
};
SpdyFrameReader frame_reader(kFrameData, arraysize(kFrameData));
SpdyFrameReader frame_reader(kFrameData, SPDY_ARRAYSIZE(kFrameData));
EXPECT_FALSE(frame_reader.IsDoneReading());
uint32_t uint32_val;
......@@ -138,7 +139,7 @@ TEST(SpdyFrameReaderTest, ReadStringPiece16WithBufferTooSmall) {
0x48, 0x69, // "Hi"
};
SpdyFrameReader frame_reader(kFrameData, arraysize(kFrameData));
SpdyFrameReader frame_reader(kFrameData, SPDY_ARRAYSIZE(kFrameData));
EXPECT_FALSE(frame_reader.IsDoneReading());
SpdyStringPiece stringpiece_val;
......@@ -157,7 +158,7 @@ TEST(SpdyFrameReaderTest, ReadStringPiece16WithBufferWayTooSmall) {
0x00, // part of a uint16_t
};
SpdyFrameReader frame_reader(kFrameData, arraysize(kFrameData));
SpdyFrameReader frame_reader(kFrameData, SPDY_ARRAYSIZE(kFrameData));
EXPECT_FALSE(frame_reader.IsDoneReading());
SpdyStringPiece stringpiece_val;
......@@ -177,7 +178,7 @@ TEST(SpdyFrameReaderTest, ReadStringPiece32WithBufferTooSmall) {
0x48, 0x69, // "Hi"
};
SpdyFrameReader frame_reader(kFrameData, arraysize(kFrameData));
SpdyFrameReader frame_reader(kFrameData, SPDY_ARRAYSIZE(kFrameData));
EXPECT_FALSE(frame_reader.IsDoneReading());
SpdyStringPiece stringpiece_val;
......@@ -196,7 +197,7 @@ TEST(SpdyFrameReaderTest, ReadStringPiece32WithBufferWayTooSmall) {
0x00, 0x00, 0x00, // part of a uint32_t
};
SpdyFrameReader frame_reader(kFrameData, arraysize(kFrameData));
SpdyFrameReader frame_reader(kFrameData, SPDY_ARRAYSIZE(kFrameData));
EXPECT_FALSE(frame_reader.IsDoneReading());
SpdyStringPiece stringpiece_val;
......@@ -215,18 +216,18 @@ TEST(SpdyFrameReaderTest, ReadBytes) {
0x48, 0x69, // "Hi"
};
SpdyFrameReader frame_reader(kFrameData, arraysize(kFrameData));
SpdyFrameReader frame_reader(kFrameData, SPDY_ARRAYSIZE(kFrameData));
EXPECT_FALSE(frame_reader.IsDoneReading());
char dest1[3] = {};
EXPECT_TRUE(frame_reader.ReadBytes(&dest1, arraysize(dest1)));
EXPECT_TRUE(frame_reader.ReadBytes(&dest1, SPDY_ARRAYSIZE(dest1)));
EXPECT_FALSE(frame_reader.IsDoneReading());
EXPECT_EQ("foo", SpdyStringPiece(dest1, arraysize(dest1)));
EXPECT_EQ("foo", SpdyStringPiece(dest1, SPDY_ARRAYSIZE(dest1)));
char dest2[2] = {};
EXPECT_TRUE(frame_reader.ReadBytes(&dest2, arraysize(dest2)));
EXPECT_TRUE(frame_reader.ReadBytes(&dest2, SPDY_ARRAYSIZE(dest2)));
EXPECT_TRUE(frame_reader.IsDoneReading());
EXPECT_EQ("Hi", SpdyStringPiece(dest2, arraysize(dest2)));
EXPECT_EQ("Hi", SpdyStringPiece(dest2, SPDY_ARRAYSIZE(dest2)));
}
TEST(SpdyFrameReaderTest, ReadBytesWithBufferTooSmall) {
......@@ -235,11 +236,11 @@ TEST(SpdyFrameReaderTest, ReadBytesWithBufferTooSmall) {
0x01,
};
SpdyFrameReader frame_reader(kFrameData, arraysize(kFrameData));
SpdyFrameReader frame_reader(kFrameData, SPDY_ARRAYSIZE(kFrameData));
EXPECT_FALSE(frame_reader.IsDoneReading());
char dest[arraysize(kFrameData) + 2] = {};
EXPECT_FALSE(frame_reader.ReadBytes(&dest, arraysize(kFrameData) + 1));
char dest[SPDY_ARRAYSIZE(kFrameData) + 2] = {};
EXPECT_FALSE(frame_reader.ReadBytes(&dest, SPDY_ARRAYSIZE(kFrameData) + 1));
EXPECT_STREQ("", dest);
}
......
......@@ -23,6 +23,7 @@
#include "net/third_party/spdy/core/spdy_frame_reader.h"
#include "net/third_party/spdy/core/spdy_protocol.h"
#include "net/third_party/spdy/core/spdy_test_utils.h"
#include "net/third_party/spdy/platform/api/spdy_arraysize.h"
#include "net/third_party/spdy/platform/api/spdy_flags.h"
#include "net/third_party/spdy/platform/api/spdy_ptr_util.h"
#include "net/third_party/spdy/platform/api/spdy_string.h"
......@@ -1316,7 +1317,7 @@ TEST_P(SpdyFramerTest, UnclosedStreamDataCompressorsOneByteAtATime) {
const char bytes[] = "this is a test test test test test!";
SpdyDataIR data_ir(/* stream_id = */ 1,
SpdyStringPiece(bytes, arraysize(bytes)));
SpdyStringPiece(bytes, SPDY_ARRAYSIZE(bytes)));
data_ir.set_fin(true);
SpdySerializedFrame send_frame(framer_.SerializeData(data_ir));
......@@ -1336,7 +1337,7 @@ TEST_P(SpdyFramerTest, UnclosedStreamDataCompressorsOneByteAtATime) {
EXPECT_EQ(0, visitor.error_count_);
EXPECT_EQ(1, visitor.headers_frame_count_);
EXPECT_EQ(arraysize(bytes), static_cast<unsigned>(visitor.data_bytes_));
EXPECT_EQ(SPDY_ARRAYSIZE(bytes), static_cast<unsigned>(visitor.data_bytes_));
EXPECT_EQ(0, visitor.fin_frame_count_);
EXPECT_EQ(0, visitor.fin_flag_count_);
EXPECT_EQ(1, visitor.end_of_stream_count_);
......@@ -1361,7 +1362,7 @@ TEST_P(SpdyFramerTest, WindowUpdateFrame) {
0x12, 0x34, 0x56, 0x78, // Increment: 305419896
};
CompareFrame(kDescription, frame, kH2FrameData, arraysize(kH2FrameData));
CompareFrame(kDescription, frame, kH2FrameData, SPDY_ARRAYSIZE(kH2FrameData));
}
TEST_P(SpdyFramerTest, CreateDataFrame) {
......@@ -1381,7 +1382,8 @@ TEST_P(SpdyFramerTest, CreateDataFrame) {
SpdyDataIR data_ir(/* stream_id = */ 1, bytes);
SpdySerializedFrame frame(framer_.SerializeData(data_ir));
CompareFrame(kDescription, frame, kH2FrameData, arraysize(kH2FrameData));
CompareFrame(kDescription, frame, kH2FrameData,
SPDY_ARRAYSIZE(kH2FrameData));
SpdyDataIR data_header_ir(/* stream_id = */ 1);
data_header_ir.SetDataShallow(bytes);
......@@ -1436,7 +1438,8 @@ TEST_P(SpdyFramerTest, CreateDataFrame) {
// bytes.
data_ir.set_padding_len(248);
SpdySerializedFrame frame(framer_.SerializeData(data_ir));
CompareFrame(kDescription, frame, kH2FrameData, arraysize(kH2FrameData));
CompareFrame(kDescription, frame, kH2FrameData,
SPDY_ARRAYSIZE(kH2FrameData));
frame = framer_.SerializeDataFrameHeaderWithPaddingLengthField(data_ir);
CompareCharArraysWithHexError(
......@@ -1465,7 +1468,8 @@ TEST_P(SpdyFramerTest, CreateDataFrame) {
// 7 zeros and the pad length field make the overall padding to be 8 bytes.
data_ir.set_padding_len(8);
SpdySerializedFrame frame(framer_.SerializeData(data_ir));
CompareFrame(kDescription, frame, kH2FrameData, arraysize(kH2FrameData));
CompareFrame(kDescription, frame, kH2FrameData,
SPDY_ARRAYSIZE(kH2FrameData));
}
{
......@@ -1489,7 +1493,8 @@ TEST_P(SpdyFramerTest, CreateDataFrame) {
// payload is needed.
data_ir.set_padding_len(1);
SpdySerializedFrame frame(framer_.SerializeData(data_ir));
CompareFrame(kDescription, frame, kH2FrameData, arraysize(kH2FrameData));
CompareFrame(kDescription, frame, kH2FrameData,
SPDY_ARRAYSIZE(kH2FrameData));
frame = framer_.SerializeDataFrameHeaderWithPaddingLengthField(data_ir);
CompareCharArraysWithHexError(
......@@ -1508,7 +1513,8 @@ TEST_P(SpdyFramerTest, CreateDataFrame) {
};
SpdyDataIR data_ir(/* stream_id = */ 1, "\xff");
SpdySerializedFrame frame(framer_.SerializeData(data_ir));
CompareFrame(kDescription, frame, kH2FrameData, arraysize(kH2FrameData));
CompareFrame(kDescription, frame, kH2FrameData,
SPDY_ARRAYSIZE(kH2FrameData));
}
{
......@@ -1524,7 +1530,8 @@ TEST_P(SpdyFramerTest, CreateDataFrame) {
SpdyDataIR data_ir(/* stream_id = */ 1, "hello");
data_ir.set_fin(true);
SpdySerializedFrame frame(framer_.SerializeData(data_ir));
CompareFrame(kDescription, frame, kH2FrameData, arraysize(kH2FrameData));
CompareFrame(kDescription, frame, kH2FrameData,
SPDY_ARRAYSIZE(kH2FrameData));
}
{
......@@ -1537,7 +1544,8 @@ TEST_P(SpdyFramerTest, CreateDataFrame) {
};
SpdyDataIR data_ir(/* stream_id = */ 1, "");
SpdySerializedFrame frame(framer_.SerializeData(data_ir));
CompareFrame(kDescription, frame, kH2FrameData, arraysize(kH2FrameData));
CompareFrame(kDescription, frame, kH2FrameData,
SPDY_ARRAYSIZE(kH2FrameData));
frame = framer_.SerializeDataFrameHeaderWithPaddingLengthField(data_ir);
CompareCharArraysWithHexError(
......@@ -1558,7 +1566,8 @@ TEST_P(SpdyFramerTest, CreateDataFrame) {
SpdyDataIR data_ir(/* stream_id = */ 0x7fffffff, "hello");
data_ir.set_fin(true);
SpdySerializedFrame frame(framer_.SerializeData(data_ir));
CompareFrame(kDescription, frame, kH2FrameData, arraysize(kH2FrameData));
CompareFrame(kDescription, frame, kH2FrameData,
SPDY_ARRAYSIZE(kH2FrameData));
}
}
......@@ -1580,7 +1589,8 @@ TEST_P(SpdyFramerTest, CreateRstStream) {
ASSERT_TRUE(framer_.SerializeRstStream(rst_stream, &output_));
frame = SpdySerializedFrame(output_.Begin(), output_.Size(), false);
}
CompareFrame(kDescription, frame, kH2FrameData, arraysize(kH2FrameData));
CompareFrame(kDescription, frame, kH2FrameData,
SPDY_ARRAYSIZE(kH2FrameData));
}
{
......@@ -1601,7 +1611,7 @@ TEST_P(SpdyFramerTest, CreateRstStream) {
ASSERT_TRUE(framer_.SerializeRstStream(rst_stream, &output_));
frame = SpdySerializedFrame(output_.Begin(), output_.Size(), false);
}
CompareFrame(kDescription, frame, kH2FrameData, arraysize(kH2FrameData));
CompareFrame(kDescription, frame, kH2FrameData, SPDY_ARRAYSIZE(kH2FrameData));
}
{
......@@ -1621,7 +1631,7 @@ TEST_P(SpdyFramerTest, CreateRstStream) {
ASSERT_TRUE(framer_.SerializeRstStream(rst_stream, &output_));
frame = SpdySerializedFrame(output_.Begin(), output_.Size(), false);
}
CompareFrame(kDescription, frame, kH2FrameData, arraysize(kH2FrameData));
CompareFrame(kDescription, frame, kH2FrameData, SPDY_ARRAYSIZE(kH2FrameData));
}
}
......@@ -1648,7 +1658,7 @@ TEST_P(SpdyFramerTest, CreateSettings) {
ASSERT_TRUE(framer_.SerializeSettings(settings_ir, &output_));
frame = SpdySerializedFrame(output_.Begin(), output_.Size(), false);
}
CompareFrame(kDescription, frame, kH2FrameData, arraysize(kH2FrameData));
CompareFrame(kDescription, frame, kH2FrameData, SPDY_ARRAYSIZE(kH2FrameData));
}
{
......@@ -1683,7 +1693,7 @@ TEST_P(SpdyFramerTest, CreateSettings) {
frame = SpdySerializedFrame(output_.Begin(), output_.Size(), false);
}
CompareFrame(kDescription, frame, kH2FrameData, arraysize(kH2FrameData));
CompareFrame(kDescription, frame, kH2FrameData, SPDY_ARRAYSIZE(kH2FrameData));
}
{
......@@ -1702,7 +1712,7 @@ TEST_P(SpdyFramerTest, CreateSettings) {
frame = SpdySerializedFrame(output_.Begin(), output_.Size(), false);
}
CompareFrame(kDescription, frame, kH2FrameData, arraysize(kH2FrameData));
CompareFrame(kDescription, frame, kH2FrameData, SPDY_ARRAYSIZE(kH2FrameData));
}
}
......@@ -1734,7 +1744,7 @@ TEST_P(SpdyFramerTest, CreatePingFrame) {
ASSERT_TRUE(framer_.SerializePing(ping_ir, &output_));
frame = SpdySerializedFrame(output_.Begin(), output_.Size(), false);
}
CompareFrame(kDescription, frame, kH2FrameData, arraysize(kH2FrameData));
CompareFrame(kDescription, frame, kH2FrameData, SPDY_ARRAYSIZE(kH2FrameData));
// Tests SpdyPingIR when the ping is an ack.
ping_ir.set_is_ack(true);
......@@ -1745,7 +1755,7 @@ TEST_P(SpdyFramerTest, CreatePingFrame) {
frame = SpdySerializedFrame(output_.Begin(), output_.Size(), false);
}
CompareFrame(kDescription, frame, kH2FrameDataWithAck,
arraysize(kH2FrameDataWithAck));
SPDY_ARRAYSIZE(kH2FrameDataWithAck));
}
}
......@@ -1768,7 +1778,7 @@ TEST_P(SpdyFramerTest, CreateGoAway) {
ASSERT_TRUE(framer_.SerializeGoAway(goaway_ir, &output_));
frame = SpdySerializedFrame(output_.Begin(), output_.Size(), false);
}
CompareFrame(kDescription, frame, kH2FrameData, arraysize(kH2FrameData));
CompareFrame(kDescription, frame, kH2FrameData, SPDY_ARRAYSIZE(kH2FrameData));
}
{
......@@ -1790,7 +1800,7 @@ TEST_P(SpdyFramerTest, CreateGoAway) {
ASSERT_TRUE(framer_.SerializeGoAway(goaway_ir, &output_));
frame = SpdySerializedFrame(output_.Begin(), output_.Size(), false);
}
CompareFrame(kDescription, frame, kH2FrameData, arraysize(kH2FrameData));
CompareFrame(kDescription, frame, kH2FrameData, SPDY_ARRAYSIZE(kH2FrameData));
}
}
......@@ -1824,7 +1834,7 @@ TEST_P(SpdyFramerTest, CreateHeadersUncompressed) {
headers.SetHeader("foo", "bar");
SpdySerializedFrame frame(SpdyFramerPeer::SerializeHeaders(
&framer, headers, use_output_ ? &output_ : nullptr));
CompareFrame(kDescription, frame, kH2FrameData, arraysize(kH2FrameData));
CompareFrame(kDescription, frame, kH2FrameData, SPDY_ARRAYSIZE(kH2FrameData));
}
{
......@@ -1855,7 +1865,7 @@ TEST_P(SpdyFramerTest, CreateHeadersUncompressed) {
headers.SetHeader("foo", "bar");
SpdySerializedFrame frame(SpdyFramerPeer::SerializeHeaders(
&framer, headers, use_output_ ? &output_ : nullptr));
CompareFrame(kDescription, frame, kH2FrameData, arraysize(kH2FrameData));
CompareFrame(kDescription, frame, kH2FrameData, SPDY_ARRAYSIZE(kH2FrameData));
}
{
......@@ -1886,7 +1896,7 @@ TEST_P(SpdyFramerTest, CreateHeadersUncompressed) {
headers_ir.SetHeader("foo", "");
SpdySerializedFrame frame(SpdyFramerPeer::SerializeHeaders(
&framer, headers_ir, use_output_ ? &output_ : nullptr));
CompareFrame(kDescription, frame, kH2FrameData, arraysize(kH2FrameData));
CompareFrame(kDescription, frame, kH2FrameData, SPDY_ARRAYSIZE(kH2FrameData));
}
{
......@@ -1922,7 +1932,7 @@ TEST_P(SpdyFramerTest, CreateHeadersUncompressed) {
headers_ir.SetHeader("foo", "");
SpdySerializedFrame frame(SpdyFramerPeer::SerializeHeaders(
&framer, headers_ir, use_output_ ? &output_ : nullptr));
CompareFrame(kDescription, frame, kH2FrameData, arraysize(kH2FrameData));
CompareFrame(kDescription, frame, kH2FrameData, SPDY_ARRAYSIZE(kH2FrameData));
}
{
......@@ -1961,7 +1971,7 @@ TEST_P(SpdyFramerTest, CreateHeadersUncompressed) {
headers_ir.SetHeader("foo", "");
SpdySerializedFrame frame(SpdyFramerPeer::SerializeHeaders(
&framer, headers_ir, use_output_ ? &output_ : nullptr));
CompareFrame(kDescription, frame, kV4FrameData, arraysize(kV4FrameData));
CompareFrame(kDescription, frame, kV4FrameData, SPDY_ARRAYSIZE(kV4FrameData));
}
{
......@@ -2000,7 +2010,7 @@ TEST_P(SpdyFramerTest, CreateHeadersUncompressed) {
headers_ir.SetHeader("foo", "");
SpdySerializedFrame frame(SpdyFramerPeer::SerializeHeaders(
&framer, headers_ir, use_output_ ? &output_ : nullptr));
CompareFrame(kDescription, frame, kV4FrameData, arraysize(kV4FrameData));
CompareFrame(kDescription, frame, kV4FrameData, SPDY_ARRAYSIZE(kV4FrameData));
}
{
......@@ -2037,7 +2047,7 @@ TEST_P(SpdyFramerTest, CreateHeadersUncompressed) {
headers_ir.set_padding_len(6);
SpdySerializedFrame frame(SpdyFramerPeer::SerializeHeaders(
&framer, headers_ir, use_output_ ? &output_ : nullptr));
CompareFrame(kDescription, frame, kH2FrameData, arraysize(kH2FrameData));
CompareFrame(kDescription, frame, kH2FrameData, SPDY_ARRAYSIZE(kH2FrameData));
}
}
......@@ -2059,7 +2069,7 @@ TEST_P(SpdyFramerTest, CreateWindowUpdate) {
SpdyWindowUpdateIR(/* stream_id = */ 1, /* delta = */ 1), &output_));
frame = SpdySerializedFrame(output_.Begin(), output_.Size(), false);
}
CompareFrame(kDescription, frame, kH2FrameData, arraysize(kH2FrameData));
CompareFrame(kDescription, frame, kH2FrameData, SPDY_ARRAYSIZE(kH2FrameData));
}
{
......@@ -2080,7 +2090,7 @@ TEST_P(SpdyFramerTest, CreateWindowUpdate) {
&output_));
frame = SpdySerializedFrame(output_.Begin(), output_.Size(), false);
}
CompareFrame(kDescription, frame, kH2FrameData, arraysize(kH2FrameData));
CompareFrame(kDescription, frame, kH2FrameData, SPDY_ARRAYSIZE(kH2FrameData));
}
{
......@@ -2101,7 +2111,7 @@ TEST_P(SpdyFramerTest, CreateWindowUpdate) {
&output_));
frame = SpdySerializedFrame(output_.Begin(), output_.Size(), false);
}
CompareFrame(kDescription, frame, kH2FrameData, arraysize(kH2FrameData));
CompareFrame(kDescription, frame, kH2FrameData, SPDY_ARRAYSIZE(kH2FrameData));
}
}
......@@ -2139,7 +2149,7 @@ TEST_P(SpdyFramerTest, CreatePushPromiseUncompressed) {
push_promise.SetHeader("foo", "bar");
SpdySerializedFrame frame(SpdyFramerPeer::SerializePushPromise(
&framer, push_promise, use_output_ ? &output_ : nullptr));
CompareFrame(kDescription, frame, kFrameData, arraysize(kFrameData));
CompareFrame(kDescription, frame, kFrameData, SPDY_ARRAYSIZE(kFrameData));
}
{
......@@ -2179,7 +2189,7 @@ TEST_P(SpdyFramerTest, CreatePushPromiseUncompressed) {
SpdySerializedFrame frame(SpdyFramerPeer::SerializePushPromise(
&framer, push_promise, use_output_ ? &output_ : nullptr));
CompareFrame(kDescription, frame, kFrameData, arraysize(kFrameData));
CompareFrame(kDescription, frame, kFrameData, SPDY_ARRAYSIZE(kFrameData));
}
{
......@@ -2239,7 +2249,7 @@ TEST_P(SpdyFramerTest, CreatePushPromiseUncompressed) {
SpdySerializedFrame frame(SpdyFramerPeer::SerializePushPromise(
&framer, push_promise, use_output_ ? &output_ : nullptr));
CompareFrame(kDescription, frame, kFrameData, arraysize(kFrameData));
CompareFrame(kDescription, frame, kFrameData, SPDY_ARRAYSIZE(kFrameData));
}
}
......@@ -2293,7 +2303,7 @@ TEST_P(SpdyFramerTest, CreateContinuationUncompressed) {
ASSERT_TRUE(framer.SerializeContinuation(continuation, &output_));
frame = SpdySerializedFrame(output_.Begin(), output_.Size(), false);
}
CompareFrame(kDescription, frame, kFrameData, arraysize(kFrameData));
CompareFrame(kDescription, frame, kFrameData, SPDY_ARRAYSIZE(kFrameData));
}
// Test that if we send an unexpected CONTINUATION
......@@ -2425,15 +2435,16 @@ TEST_P(SpdyFramerTest, CreatePushPromiseThenContinuationUncompressed) {
// Partially compare the PUSH_PROMISE frame against the template.
const unsigned char* frame_data =
reinterpret_cast<const unsigned char*>(frame.data());
CompareCharArraysWithHexError(
kDescription, frame_data, arraysize(kPartialPushPromiseFrameData),
kPartialPushPromiseFrameData, arraysize(kPartialPushPromiseFrameData));
CompareCharArraysWithHexError(kDescription, frame_data,
SPDY_ARRAYSIZE(kPartialPushPromiseFrameData),
kPartialPushPromiseFrameData,
SPDY_ARRAYSIZE(kPartialPushPromiseFrameData));
// Compare the CONTINUATION frame against the template.
frame_data += kHttp2MaxControlFrameSendSize;
CompareCharArraysWithHexError(
kDescription, frame_data, arraysize(kContinuationFrameData),
kContinuationFrameData, arraysize(kContinuationFrameData));
kDescription, frame_data, SPDY_ARRAYSIZE(kContinuationFrameData),
kContinuationFrameData, SPDY_ARRAYSIZE(kContinuationFrameData));
}
}
......@@ -2460,7 +2471,7 @@ TEST_P(SpdyFramerTest, CreateAltSvc) {
EXPECT_EQ(framer_.SerializeFrame(altsvc_ir, &output_), frame.size());
frame = SpdySerializedFrame(output_.Begin(), output_.Size(), false);
}
CompareFrame(kDescription, frame, kFrameData, arraysize(kFrameData));
CompareFrame(kDescription, frame, kFrameData, SPDY_ARRAYSIZE(kFrameData));
}
TEST_P(SpdyFramerTest, CreatePriority) {
......@@ -2482,7 +2493,7 @@ TEST_P(SpdyFramerTest, CreatePriority) {
EXPECT_EQ(framer_.SerializeFrame(priority_ir, &output_), frame.size());
frame = SpdySerializedFrame(output_.Begin(), output_.Size(), false);
}
CompareFrame(kDescription, frame, kFrameData, arraysize(kFrameData));
CompareFrame(kDescription, frame, kFrameData, SPDY_ARRAYSIZE(kFrameData));
}
TEST_P(SpdyFramerTest, CreateUnknown) {
......@@ -2509,7 +2520,7 @@ TEST_P(SpdyFramerTest, CreateUnknown) {
EXPECT_EQ(framer_.SerializeFrame(unknown_ir, &output_), frame.size());
frame = SpdySerializedFrame(output_.Begin(), output_.Size(), false);
}
CompareFrame(kDescription, frame, kFrameData, arraysize(kFrameData));
CompareFrame(kDescription, frame, kFrameData, SPDY_ARRAYSIZE(kFrameData));
}
// Test serialization of a SpdyUnknownIR with a defined type, a length field
......@@ -2541,7 +2552,7 @@ TEST_P(SpdyFramerTest, CreateUnknownUnchecked) {
EXPECT_EQ(framer_.SerializeFrame(unknown_ir, &output_), frame.size());
frame = SpdySerializedFrame(output_.Begin(), output_.Size(), false);
}
CompareFrame(kDescription, frame, kFrameData, arraysize(kFrameData));
CompareFrame(kDescription, frame, kFrameData, SPDY_ARRAYSIZE(kFrameData));
}
TEST_P(SpdyFramerTest, ReadCompressedHeadersHeaderBlock) {
......@@ -3578,7 +3589,7 @@ TEST_P(SpdyFramerTest, ReadUnknownExtensionFrame) {
// Simulate the case where the stream id validation checks out.
visitor.on_unknown_frame_result_ = true;
visitor.SimulateInFramer(unknown_frame, arraysize(unknown_frame));
visitor.SimulateInFramer(unknown_frame, SPDY_ARRAYSIZE(unknown_frame));
EXPECT_EQ(0, visitor.error_count_);
// Follow it up with a valid control frame to make sure we handle
......@@ -3614,7 +3625,7 @@ TEST_P(SpdyFramerTest, ReadUnknownExtensionFrameWithExtension) {
TestSpdyVisitor visitor(SpdyFramer::DISABLE_COMPRESSION);
TestExtension extension;
visitor.set_extension_visitor(&extension);
visitor.SimulateInFramer(unknown_frame, arraysize(unknown_frame));
visitor.SimulateInFramer(unknown_frame, SPDY_ARRAYSIZE(unknown_frame));
EXPECT_EQ(0, visitor.error_count_);
EXPECT_EQ(0x7fffffffu, extension.stream_id_);
EXPECT_EQ(20u, extension.length_);
......@@ -3645,7 +3656,7 @@ TEST_P(SpdyFramerTest, ReadGarbageWithValidLength) {
0xff, 0xff, 0xff, 0xff, //
};
TestSpdyVisitor visitor(SpdyFramer::DISABLE_COMPRESSION);
visitor.SimulateInFramer(kFrameData, arraysize(kFrameData));
visitor.SimulateInFramer(kFrameData, SPDY_ARRAYSIZE(kFrameData));
EXPECT_EQ(1, visitor.error_count_);
}
......@@ -3664,7 +3675,7 @@ TEST_P(SpdyFramerTest, ReadGarbageHPACKEncoding) {
};
TestSpdyVisitor visitor(SpdyFramer::DISABLE_COMPRESSION);
visitor.SimulateInFramer(kInput, arraysize(kInput));
visitor.SimulateInFramer(kInput, SPDY_ARRAYSIZE(kInput));
EXPECT_EQ(1, visitor.error_count_);
}
......@@ -4189,7 +4200,7 @@ TEST_P(SpdyFramerTest, RstStreamStatusBounds) {
EXPECT_CALL(visitor, OnRstStream(1, ERROR_CODE_NO_ERROR));
deframer_.ProcessInput(reinterpret_cast<const char*>(kH2RstStreamInvalid),
arraysize(kH2RstStreamInvalid));
SPDY_ARRAYSIZE(kH2RstStreamInvalid));
EXPECT_EQ(Http2DecoderAdapter::SPDY_READY_FOR_FRAME, deframer_.state());
EXPECT_EQ(Http2DecoderAdapter::SPDY_NO_ERROR, deframer_.spdy_framer_error())
<< Http2DecoderAdapter::SpdyFramerErrorToString(
......@@ -4199,7 +4210,7 @@ TEST_P(SpdyFramerTest, RstStreamStatusBounds) {
EXPECT_CALL(visitor, OnRstStream(1, ERROR_CODE_INTERNAL_ERROR));
deframer_.ProcessInput(
reinterpret_cast<const char*>(kH2RstStreamNumStatusCodes),
arraysize(kH2RstStreamNumStatusCodes));
SPDY_ARRAYSIZE(kH2RstStreamNumStatusCodes));
EXPECT_EQ(Http2DecoderAdapter::SPDY_READY_FOR_FRAME, deframer_.state());
EXPECT_EQ(Http2DecoderAdapter::SPDY_NO_ERROR, deframer_.spdy_framer_error())
<< Http2DecoderAdapter::SpdyFramerErrorToString(
......@@ -4222,7 +4233,7 @@ TEST_P(SpdyFramerTest, GoAwayStatusBounds) {
EXPECT_CALL(visitor, OnGoAway(1, ERROR_CODE_INTERNAL_ERROR));
deframer_.ProcessInput(reinterpret_cast<const char*>(kH2FrameData),
arraysize(kH2FrameData));
SPDY_ARRAYSIZE(kH2FrameData));
EXPECT_EQ(Http2DecoderAdapter::SPDY_READY_FOR_FRAME, deframer_.state());
EXPECT_EQ(Http2DecoderAdapter::SPDY_NO_ERROR, deframer_.spdy_framer_error())
<< Http2DecoderAdapter::SpdyFramerErrorToString(
......@@ -4246,7 +4257,7 @@ TEST_P(SpdyFramerTest, GoAwayStreamIdBounds) {
EXPECT_CALL(visitor, OnGoAway(0x7fffffff, ERROR_CODE_NO_ERROR));
deframer_.ProcessInput(reinterpret_cast<const char*>(kH2FrameData),
arraysize(kH2FrameData));
SPDY_ARRAYSIZE(kH2FrameData));
EXPECT_EQ(Http2DecoderAdapter::SPDY_READY_FOR_FRAME, deframer_.state());
EXPECT_EQ(Http2DecoderAdapter::SPDY_NO_ERROR, deframer_.spdy_framer_error())
<< Http2DecoderAdapter::SpdyFramerErrorToString(
......@@ -4738,7 +4749,7 @@ TEST_P(SpdyFramerTest, SpdyFrameIRSize) {
SpdyFramer framer(SpdyFramer::DISABLE_COMPRESSION);
const char bytes[] = "this is a very short data frame";
SpdyDataIR data_ir(1, SpdyStringPiece(bytes, arraysize(bytes)));
SpdyDataIR data_ir(1, SpdyStringPiece(bytes, SPDY_ARRAYSIZE(bytes)));
CheckFrameAndIRSize(&data_ir, &framer, &output_);
SpdyRstStreamIR rst_ir(/* stream_id = */ 1, ERROR_CODE_PROTOCOL_ERROR);
......
#ifndef NET_THIRD_PARTY_SPDY_PLATFORM_API_SPDY_ARRAYSIZE_H_
#define NET_THIRD_PARTY_SPDY_PLATFORM_API_SPDY_ARRAYSIZE_H_
#include "net/third_party/spdy/platform/impl/spdy_arraysize_impl.h"
#define SPDY_ARRAYSIZE(x) SPDY_ARRAYSIZE_IMPL(x)
#endif // NET_THIRD_PARTY_SPDY_PLATFORM_API_SPDY_ARRAYSIZE_H_
#ifndef NET_THIRD_PARTY_SPDY_PLATFORM_IMPL_SPDY_ARRAYSIZE_IMPL_H_
#define NET_THIRD_PARTY_SPDY_PLATFORM_IMPL_SPDY_ARRAYSIZE_IMPL_H_
#include "base/macros.h"
#define SPDY_ARRAYSIZE_IMPL(x) arraysize(x)
#endif /* NET_THIRD_PARTY_SPDY_PLATFORM_IMPL_SPDY_ARRAYSIZE_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