Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(328)

Side by Side Diff: net/spdy/hpack_string_util.cc

Issue 138243003: Implement basic classes for HPACK (HTTP/2 compression) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Adding license to new HPACK sources. Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « net/spdy/hpack_string_util.h ('k') | net/spdy/hpack_string_util_test.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 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.
4
5 #include "net/spdy/hpack_string_util.h"
6
7 #include "base/basictypes.h"
8
9 namespace net {
10
11 bool StringPiecesEqualConstantTime(base::StringPiece str1,
12 base::StringPiece str2) {
13 size_t size = str1.size();
14 if (str2.size() != size)
15 return false;
16
17 uint8 x = 0;
18 for (size_t i = 0; i < size; ++i) {
19 x |= str1[i] ^ str2[i];
20 }
21 return x == 0;
22 }
23
24 } // namespace net
OLDNEW
« no previous file with comments | « net/spdy/hpack_string_util.h ('k') | net/spdy/hpack_string_util_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698