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

Unified Diff: blimp/net/test_common.cc

Issue 1825263003: Blimp: add packet-level DEFLATE compression using zlib. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: wez feedback Created 4 years, 9 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
« no previous file with comments | « blimp/net/test_common.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: blimp/net/test_common.cc
diff --git a/blimp/net/test_common.cc b/blimp/net/test_common.cc
index 92a951d17ab3b1f398182b04c2eb8023e9eef1c2..261401e5b7a585678e3c726bd0eb99c13f3ce7a8 100644
--- a/blimp/net/test_common.cc
+++ b/blimp/net/test_common.cc
@@ -72,9 +72,11 @@ std::string EncodeHeader(size_t size) {
return std::string(serialized.get(), kPacketHeaderSizeBytes);
}
-bool BufferStartsWith(net::GrowableIOBuffer* buf, const std::string& str) {
- return (static_cast<size_t>(buf->capacity()) > str.size() &&
- str == std::string(buf->StartOfBuffer(), str.size()));
+bool BufferStartsWith(net::GrowableIOBuffer* buf,
+ size_t buf_size,
+ const std::string& str) {
+ return (buf_size >= str.size() &&
+ str == std::string(buf->data(), str.size()));
}
} // namespace blimp
« no previous file with comments | « blimp/net/test_common.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698