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

Unified Diff: net/base/io_buffer.h

Issue 20134: Extend the IOBuffer to the disk cache. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 10 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 | « net/base/completion_callback.h ('k') | net/disk_cache/backend_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/io_buffer.h
===================================================================
--- net/base/io_buffer.h (revision 9323)
+++ net/base/io_buffer.h (working copy)
@@ -19,7 +19,7 @@
DCHECK(buffer_size);
data_ = new char[buffer_size];
}
- explicit IOBuffer(char* buffer) : data_(buffer) {}
+ explicit IOBuffer(char* data) : data_(data) {}
virtual ~IOBuffer() {
delete[] data_;
}
@@ -30,6 +30,17 @@
char* data_;
};
+// This class allows the creation of a temporary IOBuffer that doesn't really
+// owns the underlying buffer. Please use this class only as a last resort.
darin (slow to review) 2009/02/10 04:40:27 nit: s/owns/own/ maybe you could also more clearl
+class WrappedIOBuffer : public net::IOBuffer {
+ public:
+ explicit WrappedIOBuffer(const char* data)
+ : net::IOBuffer(const_cast<char*>(data)) {}
+ ~WrappedIOBuffer() {
+ data_ = NULL;
+ }
+};
+
} // namespace net
#endif // NET_BASE_IO_BUFFER_H_
« no previous file with comments | « net/base/completion_callback.h ('k') | net/disk_cache/backend_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698