1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "net/spdy/hpack_string_util.h"
7 #include "base/basictypes.h"
11 bool StringPiecesEqualConstantTime(base::StringPiece str1
,
12 base::StringPiece str2
) {
13 size_t size
= str1
.size();
14 if (str2
.size() != size
)
18 for (size_t i
= 0; i
< size
; ++i
) {
19 x
|= str1
[i
] ^ str2
[i
];