summaryrefslogtreecommitdiffstats
path: root/net/flip
diff options
context:
space:
mode:
authormbelshe@chromium.org <mbelshe@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-07 01:55:21 +0000
committermbelshe@chromium.org <mbelshe@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-07 01:55:21 +0000
commitd8c21a50746fefcf8fcffc8bdbd2556327f9fed7 (patch)
tree9ef7ca3eae5cafc1730cfd4aef3bd3042a53c276 /net/flip
parent35d6eed02986291766d65cfce79d01c9556cfad6 (diff)
downloadchromium_src-d8c21a50746fefcf8fcffc8bdbd2556327f9fed7.zip
chromium_src-d8c21a50746fefcf8fcffc8bdbd2556327f9fed7.tar.gz
chromium_src-d8c21a50746fefcf8fcffc8bdbd2556327f9fed7.tar.bz2
Remove VLOG statements which aren't needed and don't work well in chrome.
BUG=none TEST=none Review URL: http://codereview.chromium.org/257074 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@28212 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/flip')
-rw-r--r--net/flip/flip_frame_builder.cc9
-rw-r--r--net/flip/flip_frame_builder.h29
-rw-r--r--net/flip/flip_framer.cc15
-rw-r--r--net/flip/flip_framer_test.cc3
4 files changed, 10 insertions, 46 deletions
diff --git a/net/flip/flip_frame_builder.cc b/net/flip/flip_frame_builder.cc
index 28d156c..50d9607 100644
--- a/net/flip/flip_frame_builder.cc
+++ b/net/flip/flip_frame_builder.cc
@@ -64,14 +64,11 @@ bool FlipFrameBuilder::ReadString(void** iter, std::string* result) const {
DCHECK(iter);
uint16 len;
- if (!ReadUInt16(iter, &len)) {
- VLOG(1) << "Unable to read length";
+ if (!ReadUInt16(iter, &len))
return false;
- }
- if (!IteratorHasRoomFor(*iter, len)) {
- VLOG(1) << "!IteratorHasRoomFor";
+
+ if (!IteratorHasRoomFor(*iter, len))
return false;
- }
char* chars = reinterpret_cast<char*>(*iter);
result->assign(chars, len);
diff --git a/net/flip/flip_frame_builder.h b/net/flip/flip_frame_builder.h
index 809f451..0640630 100644
--- a/net/flip/flip_frame_builder.h
+++ b/net/flip/flip_frame_builder.h
@@ -16,11 +16,6 @@
#include "base/logging.h"
#include "flip_protocol.h" // cross-google3 directory naming.
-#ifdef WIN32
-#undef VLOG
-#define VLOG(x) LOG_IF(INFO, false)
-#endif // WIN32
-
namespace flip {
// This class provides facilities for basic binary value packing and unpacking
@@ -114,26 +109,12 @@ class FlipFrameBuilder {
// payload, returns false.
bool IteratorHasRoomFor(const void* iter, int len) const {
const char* end_of_region = reinterpret_cast<const char*>(iter) + len;
- VLOG(1) << "len: " << len;
- if (len < 0) {
- VLOG(1) << "Len < 0";
- return false;
- } else if (iter < buffer_) {
- VLOG(1) << "iter < buffer_";
- return false;
- } else if (iter > end_of_payload()) {
- VLOG(1) << "iter > end_of_payload())";
- return false;
- } else if (iter > end_of_region) {
- VLOG(1) << "iter > end_of_region)";
- return false;
- } else if (end_of_region > end_of_payload()) {
- VLOG(1) << "end_of_region > end_of_payload()";
- VLOG(1) << "end_of_region - end_of_payload(): "
- << (end_of_region - end_of_payload());
-
+ if (len < 0 ||
+ iter < buffer_ ||
+ iter > end_of_payload() ||
+ iter > end_of_region ||
+ end_of_region > end_of_payload())
return false;
- }
// Watch out for overflow in pointer calculation, which wraps.
return (iter <= end_of_region) && (end_of_region <= end_of_payload());
diff --git a/net/flip/flip_framer.cc b/net/flip/flip_framer.cc
index cb07dc1..a8a4dc8 100644
--- a/net/flip/flip_framer.cc
+++ b/net/flip/flip_framer.cc
@@ -9,11 +9,7 @@
#include "flip_frame_builder.h"
#include "flip_bitmasks.h"
-#ifdef WIN32
#include "third_party/zlib/zlib.h"
-#else
-#include "third_party/zlib/v1_2_3/zlib.h"
-#endif
namespace flip {
@@ -385,18 +381,13 @@ bool FlipFramer::ParseHeaderBlock(const FlipFrame* frame,
void* iter = NULL;
uint16 num_headers;
if (builder.ReadUInt16(&iter, &num_headers)) {
- VLOG(2) << "found num_headers: " << num_headers;
for (int index = 0; index < num_headers; ++index) {
std::string name;
std::string value;
- if (!builder.ReadString(&iter, &name)) {
- VLOG(1) << "couldn't read string (key)!";
+ if (!builder.ReadString(&iter, &name))
break;
- }
- if (!builder.ReadString(&iter, &value)) {
- VLOG(1) << "couldn't read string (value)!";
+ if (!builder.ReadString(&iter, &value))
break;
- }
if (block->empty()) {
(*block)[name] = value;
} else {
@@ -410,8 +401,6 @@ bool FlipFramer::ParseHeaderBlock(const FlipFrame* frame,
}
}
return true;
- } else {
- VLOG(2) << "didn't find headers";
}
return false;
}
diff --git a/net/flip/flip_framer_test.cc b/net/flip/flip_framer_test.cc
index a786bc2..473338d 100644
--- a/net/flip/flip_framer_test.cc
+++ b/net/flip/flip_framer_test.cc
@@ -61,18 +61,15 @@ class TestFlipVisitor : public FlipFramerVisitorInterface {
reinterpret_cast<const FlipFrame*>(frame), &headers);
DCHECK(parsed_headers);
syn_frame_count_++;
- VLOG(2) << "OnSyn(" << frame->stream_id() << ")\n";
break;
case SYN_REPLY:
parsed_headers = framer_->ParseHeaderBlock(
reinterpret_cast<const FlipFrame*>(frame), &headers);
DCHECK(parsed_headers);
syn_reply_frame_count_++;
- VLOG(2) << "OnSynReply(" << frame->stream_id() << ")\n";
break;
case FIN_STREAM:
fin_frame_count_++;
- VLOG(2) << "OnFin(" << frame->stream_id() << ")\n";
break;
default:
DCHECK(false); // Error!