summaryrefslogtreecommitdiffstats
path: root/net/flip
diff options
context:
space:
mode:
authormbelshe@chromium.org <mbelshe@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-09 16:56:40 +0000
committermbelshe@chromium.org <mbelshe@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-09 16:56:40 +0000
commitb172068c7dea600ebda1c7fdfd31dca03d10b119 (patch)
tree99250f9a03bb5e55c04a4be64fe88a6deff22ae1 /net/flip
parent3f4a9c66370575e650a1c28353182cd3f9f77f14 (diff)
downloadchromium_src-b172068c7dea600ebda1c7fdfd31dca03d10b119.zip
chromium_src-b172068c7dea600ebda1c7fdfd31dca03d10b119.tar.gz
chromium_src-b172068c7dea600ebda1c7fdfd31dca03d10b119.tar.bz2
A few more misc fixes for the linux port.
Temporarily turn off SSL until the SSL full duplex patch can land. BUG=none TEST=none Review URL: http://codereview.chromium.org/272004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@28550 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/flip')
-rw-r--r--net/flip/flip_framer_test.cc18
-rw-r--r--net/flip/flip_session.cc12
-rw-r--r--net/flip/flip_session.h2
-rw-r--r--net/flip/flip_session_unittest.cc10
4 files changed, 18 insertions, 24 deletions
diff --git a/net/flip/flip_framer_test.cc b/net/flip/flip_framer_test.cc
index 473338d..847b83f 100644
--- a/net/flip/flip_framer_test.cc
+++ b/net/flip/flip_framer_test.cc
@@ -8,13 +8,7 @@
#include "flip_framer.h" // cross-google3 directory naming.
#include "flip_protocol.h"
#include "flip_frame_builder.h"
-#ifdef _WIN32
#include "testing/platform_test.h"
-#else
-#include "testing/base/public/gunit.h"
-
-#define PlatformTest ::testing::Test
-#endif
namespace flip {
@@ -90,12 +84,12 @@ class TestFlipVisitor : public FlipFramerVisitorInterface {
// Test our protocol constants
TEST_F(FlipFramerTest, ProtocolConstants) {
- EXPECT_EQ(8, sizeof(FlipFrame));
- EXPECT_EQ(8, sizeof(FlipDataFrame));
- EXPECT_EQ(12, sizeof(FlipControlFrame));
- EXPECT_EQ(16, sizeof(FlipSynStreamControlFrame));
- EXPECT_EQ(16, sizeof(FlipSynReplyControlFrame));
- EXPECT_EQ(16, sizeof(FlipFinStreamControlFrame));
+ EXPECT_EQ(8u, sizeof(FlipFrame));
+ EXPECT_EQ(8u, sizeof(FlipDataFrame));
+ EXPECT_EQ(12u, sizeof(FlipControlFrame));
+ EXPECT_EQ(16u, sizeof(FlipSynStreamControlFrame));
+ EXPECT_EQ(16u, sizeof(FlipSynReplyControlFrame));
+ EXPECT_EQ(16u, sizeof(FlipFinStreamControlFrame));
EXPECT_EQ(1, SYN_STREAM);
EXPECT_EQ(2, SYN_REPLY);
EXPECT_EQ(3, FIN_STREAM);
diff --git a/net/flip/flip_session.cc b/net/flip/flip_session.cc
index ef47540..30bec43 100644
--- a/net/flip/flip_session.cc
+++ b/net/flip/flip_session.cc
@@ -24,7 +24,7 @@
namespace {
// True if FLIP should run over SSL.
-static bool use_ssl_flip = true;
+static bool use_ssl_flip = false;
} // namespace
@@ -469,11 +469,11 @@ void FlipSession::WriteSocket() {
return;
while (queue_.size()) {
- const int kMaxSegmentSize = 1430;
- const int kMaxPayload = 4 * kMaxSegmentSize;
- int max_size = std::max(kMaxPayload, queue_.top().size());
+ const size_t kMaxSegmentSize = 1430;
+ const size_t kMaxPayload = 4 * kMaxSegmentSize;
+ size_t max_size = std::max(kMaxPayload, queue_.top().size());
- int bytes = 0;
+ size_t bytes = 0;
// If we have multiple IOs to do, accumulate up to 4 MSS's worth of data
// and send them in batch.
IOBufferWithSize* buffer = new IOBufferWithSize(max_size);
@@ -485,7 +485,7 @@ void FlipSession::WriteSocket() {
reinterpret_cast<flip::FlipFrame*>(next_buffer.buffer()->data());
scoped_array<flip::FlipFrame> compressed_frame(
flip_framer_.CompressFrame(uncompressed_frame));
- int size = compressed_frame.get()->length() + sizeof(flip::FlipFrame);
+ size_t size = compressed_frame.get()->length() + sizeof(flip::FlipFrame);
if (bytes + size > kMaxPayload)
break;
memcpy(buffer->data() + bytes, compressed_frame.get(), size);
diff --git a/net/flip/flip_session.h b/net/flip/flip_session.h
index ed2c9de..6d92c11 100644
--- a/net/flip/flip_session.h
+++ b/net/flip/flip_session.h
@@ -56,7 +56,7 @@ class PrioritizedIOBuffer {
IOBuffer* buffer() const { return buffer_; }
- int size() const { return buffer_->size(); }
+ size_t size() const { return buffer_->size(); }
void release() { buffer_ = NULL; }
diff --git a/net/flip/flip_session_unittest.cc b/net/flip/flip_session_unittest.cc
index 016a197..90bf938 100644
--- a/net/flip/flip_session_unittest.cc
+++ b/net/flip/flip_session_unittest.cc
@@ -17,18 +17,18 @@ class FlipSessionTest : public PlatformTest {
// Test the PrioritizedIOBuffer class.
TEST_F(FlipSessionTest, PrioritizedIOBuffer) {
std::priority_queue<PrioritizedIOBuffer> queue_;
- const int kQueueSize = 100;
+ const size_t kQueueSize = 100;
// Insert 100 items; pri 100 to 1.
- for (int index = 0; index < kQueueSize; ++index) {
+ for (size_t index = 0; index < kQueueSize; ++index) {
PrioritizedIOBuffer buffer(NULL, kQueueSize - index);
queue_.push(buffer);
}
// Insert several priority 0 items last.
- const int kNumDuplicates = 12;
+ const size_t kNumDuplicates = 12;
IOBufferWithSize* buffers[kNumDuplicates];
- for (int index = 0; index < kNumDuplicates; ++index) {
+ for (size_t index = 0; index < kNumDuplicates; ++index) {
buffers[index] = new IOBufferWithSize(index+1);
queue_.push(PrioritizedIOBuffer(buffers[index], 0));
}
@@ -36,7 +36,7 @@ TEST_F(FlipSessionTest, PrioritizedIOBuffer) {
EXPECT_EQ(kQueueSize + kNumDuplicates, queue_.size());
// Verify the P0 items come out in FIFO order.
- for (int index = 0; index < kNumDuplicates; ++index) {
+ for (size_t index = 0; index < kNumDuplicates; ++index) {
PrioritizedIOBuffer buffer = queue_.top();
EXPECT_EQ(0, buffer.priority());
EXPECT_EQ(index + 1, buffer.size());