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

Unified Diff: net/base/io_buffer.h

Issue 18390: Change URLRequest to use a ref-counted buffer for actual IO.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 11 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/gzip_filter_unittest.cc ('k') | net/base/sdch_filter_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 0)
+++ net/base/io_buffer.h (revision 0)
@@ -0,0 +1,32 @@
+// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef NET_BASE_IO_BUFFER_H_
+#define NET_BASE_IO_BUFFER_H_
+
+#include "base/ref_counted.h"
+
+namespace net {
+
+// This is a simple wrapper around a buffer that provides ref counting for
+// easier asynchronous IO handling.
+class IOBuffer : public base::RefCountedThreadSafe<IOBuffer> {
+ public:
+ explicit IOBuffer(int buffer_size) {
+ data_ = new char[buffer_size];
+ }
+ explicit IOBuffer(char* buffer) : data_(buffer) {}
+ virtual ~IOBuffer() {
+ delete[] data_;
+ }
+
+ char* data() { return data_; }
+
+ protected:
+ char* data_;
+};
+
+} // namespace net
+
+#endif // NET_BASE_IO_BUFFER_H_
Property changes on: net\base\io_buffer.h
___________________________________________________________________
Added: svn:eol-style
+ LF
« no previous file with comments | « net/base/gzip_filter_unittest.cc ('k') | net/base/sdch_filter_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698