Revert "Fix broken channel icon in chrome://help on CrOS" and try again
[chromium-blink-merge.git] / net / spdy / hpack / hpack_string_util.cc
blob3f59291e4ed2e9fd6402cd0a54758af7f38771f4
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/hpack_string_util.h"
7 #include "base/basictypes.h"
9 namespace net {
11 bool StringPiecesEqualConstantTime(base::StringPiece str1,
12 base::StringPiece str2) {
13 size_t size = str1.size();
14 if (str2.size() != size)
15 return false;
17 uint8 x = 0;
18 for (size_t i = 0; i < size; ++i) {
19 x |= str1[i] ^ str2[i];
21 return x == 0;
24 } // namespace net