#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include <stddef.h>
#include <iterator>
#include <string>
#include <string_view>
#include <vector>
#include "base/ranges/algorithm.h"
#include "base/time/time.h"
#include "base/timer/elapsed_timer.h"
#include "net/websockets/websocket_frame.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "testing/perf/perf_result_reporter.h"
namespace net {
namespace {
constexpr int kIterations = …;
constexpr int kLongPayloadSize = …;
constexpr std::string_view kMaskingKey = …;
static constexpr char kMetricPrefixWebSocketFrame[] = …;
static constexpr char kMetricMaskTimeMs[] = …;
perf_test::PerfResultReporter SetUpWebSocketFrameMaskReporter(
const std::string& story) { … }
static_assert …;
class WebSocketFrameTestMaskBenchmark : public ::testing::Test { … };
TEST_F(WebSocketFrameTestMaskBenchmark, BenchmarkMaskShortPayload) { … }
TEST_F(WebSocketFrameTestMaskBenchmark, BenchmarkMaskLongPayload) { … }
TEST_F(WebSocketFrameTestMaskBenchmark, Benchmark31BytePayload) { … }
}
}