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

Unified Diff: net/base/io_buffer.h

Issue 338049: Handle out of memory in GrowableIOBuffer more gracefully.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 2 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 | « no previous file | net/base/io_buffer.cc » ('j') | net/base/io_buffer.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/io_buffer.h
===================================================================
--- net/base/io_buffer.h (revision 30229)
+++ net/base/io_buffer.h (working copy)
@@ -106,12 +106,15 @@
GrowableIOBuffer() : IOBuffer(), capacity_(0), offset_(0) {}
~GrowableIOBuffer() { data_ = NULL; }
+
+ // realloc memory to the specified capacity. On failure, the capacity
wtc 2009/10/27 22:42:10 You need to document that true means success and f
+ // and buffer are unchanged.
+ bool SetCapacity(int capacity);
int capacity() { return capacity_; }
- void set_capacity(int capacity);
// |offset| moves the |data_| pointer, allowing "seeking" in the data.
+ void set_offset(int offset);
int offset() { return offset_; }
- void set_offset(int offset);
int RemainingCapacity() { return capacity_ - offset_; }
char* StartOfBuffer() { return real_data_.get(); }
« no previous file with comments | « no previous file | net/base/io_buffer.cc » ('j') | net/base/io_buffer.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698