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

Unified 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: And removing tabs from net.gyp... 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 side-by-side diff with in-line comments
Download patch
Index: net/spdy/hpack_string_util.cc
diff --git a/net/spdy/hpack_string_util.cc b/net/spdy/hpack_string_util.cc
new file mode 100644
index 0000000000000000000000000000000000000000..5c0b131a2e11cfa8de8bf1ecf7baa4ce59672ba6
--- /dev/null
+++ b/net/spdy/hpack_string_util.cc
@@ -0,0 +1,20 @@
+#include "net/spdy/hpack_string_util.h"
+
+#include "base/basictypes.h"
+
+namespace net {
+
+bool StringPiecesEqualConstantTime(base::StringPiece str1,
+ base::StringPiece str2) {
+ size_t size = str1.size();
+ if (str2.size() != size)
+ return false;
+
+ uint8 x = 0;
+ for (size_t i = 0; i < size; ++i) {
+ x |= str1[i] ^ str2[i];
+ }
+ return x == 0;
+}
+
+} // namespace net

Powered by Google App Engine
This is Rietveld 408576698