summaryrefslogtreecommitdiffstats
path: root/net/flip/flip_framer.h
diff options
context:
space:
mode:
authormbelshe@chromium.org <mbelshe@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-07 22:12:13 +0000
committermbelshe@chromium.org <mbelshe@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-07 22:12:13 +0000
commita23a90aeb11a1be89c52712c8866bbc195b422d5 (patch)
treec20bc592167d3e670dcd8ba4ce872759f71b4638 /net/flip/flip_framer.h
parentb89b00b655ac2359585ae39f1ebdd65e93da0aa4 (diff)
downloadchromium_src-a23a90aeb11a1be89c52712c8866bbc195b422d5.zip
chromium_src-a23a90aeb11a1be89c52712c8866bbc195b422d5.tar.gz
chromium_src-a23a90aeb11a1be89c52712c8866bbc195b422d5.tar.bz2
Change many of the int and uint32 uses to size_t.
I think we should avoid using uint32 except where we're defining protocol elements which specifically are intended to be 32 bits. Using size_t for lengths is a good way to avoid any accidental signed/unsigned comparisons. This cleanup is a result of the linux port, which gets lots of unsigned/signed warnings (which we treat as errors). BUG=none TEST=none Review URL: http://codereview.chromium.org/263004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@28318 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/flip/flip_framer.h')
-rw-r--r--net/flip/flip_framer.h22
1 files changed, 11 insertions, 11 deletions
diff --git a/net/flip/flip_framer.h b/net/flip/flip_framer.h
index e50cc83..b7a2cc0 100644
--- a/net/flip/flip_framer.h
+++ b/net/flip/flip_framer.h
@@ -48,9 +48,9 @@ class FlipFramerVisitorInterface {
virtual void OnControl(const FlipControlFrame* frame) = 0;
// Called when data is received.
- virtual void OnStreamFrameData(uint32 sream_id,
+ virtual void OnStreamFrameData(flip::FlipStreamId stream_id,
const char* data,
- uint32 len) = 0;
+ size_t len) = 0;
// TODO(fenix): Implement me!
virtual void OnLameDuck() = 0;
@@ -99,7 +99,7 @@ class FlipFramer {
// Pass data into the framer for parsing.
// Returns the number of bytes consumed. It is safe to pass more bytes in
// than may be consumed.
- uint32 ProcessInput(const char* data, uint32 len);
+ size_t ProcessInput(const char* data, size_t len);
// Resets the framer state after a frame has been successfully decoded.
// TODO(mbelshe): can we make this private?
@@ -183,21 +183,21 @@ class FlipFramer {
private:
// Internal breakout from ProcessInput. Returns the number of bytes
// consumed from the data.
- uint32 ProcessCommonHeader(const char* data, uint32 len);
- uint32 ProcessControlFramePayload(const char* data, uint32 len);
+ size_t ProcessCommonHeader(const char* data, size_t len);
+ size_t ProcessControlFramePayload(const char* data, size_t len);
// Initialize the ZLib state.
bool InitializeCompressor();
bool InitializeDecompressor();
// Not used (yet)
- uint32 BytesSafeToRead() const;
+ size_t BytesSafeToRead() const;
// Set the error code.
void set_error(FlipError error);
// Expands the control frame buffer to accomodate a particular payload size.
- void ExpandControlFrameBuffer(int size);
+ void ExpandControlFrameBuffer(size_t size);
// Given a frame, breakdown the variable payload length, the static header
// header length, and variable payload pointer.
@@ -207,12 +207,12 @@ class FlipFramer {
FlipState state_;
FlipError error_code_;
- uint32 remaining_payload_;
- uint32 remaining_control_payload_;
+ size_t remaining_payload_;
+ size_t remaining_control_payload_;
char* current_frame_buffer_;
- int current_frame_len_; // Number of bytes read into the current_frame_.
- int current_frame_capacity_;
+ size_t current_frame_len_; // Number of bytes read into the current_frame_.
+ size_t current_frame_capacity_;
bool enable_compression_;
scoped_ptr<z_stream> compressor_;