| OLD | NEW | 
|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be | 
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. | 
| 4 | 4 | 
| 5 #ifndef NET_TOOLS_FLIP_SERVER_RING_BUFFER_H__ | 5 #ifndef NET_TOOLS_FLIP_SERVER_RING_BUFFER_H__ | 
| 6 #define NET_TOOLS_FLIP_SERVER_RING_BUFFER_H__ | 6 #define NET_TOOLS_FLIP_SERVER_RING_BUFFER_H__ | 
| 7 | 7 | 
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" | 
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" | 
| 10 #include "net/tools/balsa/buffer_interface.h" | 10 #include "net/tools/balsa/buffer_interface.h" | 
| (...skipping 29 matching lines...) Expand all  Loading... | 
| 40   // of what they do if the function isn't documented here. | 40   // of what they do if the function isn't documented here. | 
| 41   virtual int ReadableBytes() const OVERRIDE; | 41   virtual int ReadableBytes() const OVERRIDE; | 
| 42   virtual int BufferSize() const OVERRIDE; | 42   virtual int BufferSize() const OVERRIDE; | 
| 43   virtual int BytesFree() const OVERRIDE; | 43   virtual int BytesFree() const OVERRIDE; | 
| 44 | 44 | 
| 45   virtual bool Empty() const OVERRIDE; | 45   virtual bool Empty() const OVERRIDE; | 
| 46   virtual bool Full() const OVERRIDE; | 46   virtual bool Full() const OVERRIDE; | 
| 47 | 47 | 
| 48   // returns the number of characters written. | 48   // returns the number of characters written. | 
| 49   // appends up-to-'size' bytes to the ringbuffer. | 49   // appends up-to-'size' bytes to the ringbuffer. | 
| 50   virtual int Write(const char * bytes, int size) OVERRIDE; | 50   virtual int Write(const char* bytes, int size) OVERRIDE; | 
| 51 | 51 | 
| 52   // Stores a pointer into the ring buffer in *ptr,  and stores the number of | 52   // Stores a pointer into the ring buffer in *ptr,  and stores the number of | 
| 53   // characters which are allowed to be written in *size. | 53   // characters which are allowed to be written in *size. | 
| 54   // If there are no writable bytes available, then *size will contain 0. | 54   // If there are no writable bytes available, then *size will contain 0. | 
| 55   virtual void GetWritablePtr(char** ptr, int* size) const OVERRIDE; | 55   virtual void GetWritablePtr(char** ptr, int* size) const OVERRIDE; | 
| 56 | 56 | 
| 57   // Stores a pointer into the ring buffer in *ptr,  and stores the number of | 57   // Stores a pointer into the ring buffer in *ptr,  and stores the number of | 
| 58   // characters which are allowed to be read in *size. | 58   // characters which are allowed to be read in *size. | 
| 59   // If there are no readable bytes available, then *size will contain 0. | 59   // If there are no readable bytes available, then *size will contain 0. | 
| 60   virtual void GetReadablePtr(char** ptr, int* size) const OVERRIDE; | 60   virtual void GetReadablePtr(char** ptr, int* size) const OVERRIDE; | 
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 103   int read_idx_; | 103   int read_idx_; | 
| 104   int write_idx_; | 104   int write_idx_; | 
| 105 | 105 | 
| 106   RingBuffer(const RingBuffer&); | 106   RingBuffer(const RingBuffer&); | 
| 107   void operator=(const RingBuffer&); | 107   void operator=(const RingBuffer&); | 
| 108 }; | 108 }; | 
| 109 | 109 | 
| 110 }  // namespace net | 110 }  // namespace net | 
| 111 | 111 | 
| 112 #endif  // NET_TOOLS_FLIP_SERVER_RING_BUFFER_H__ | 112 #endif  // NET_TOOLS_FLIP_SERVER_RING_BUFFER_H__ | 
| 113 |  | 
| OLD | NEW | 
|---|