OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_BASE_IO_BUFFER_H_ | 5 #ifndef NET_BASE_IO_BUFFER_H_ |
6 #define NET_BASE_IO_BUFFER_H_ | 6 #define NET_BASE_IO_BUFFER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
108 | 108 |
109 int size_; | 109 int size_; |
110 }; | 110 }; |
111 | 111 |
112 // This is a read only IOBuffer. The data is stored in a string and | 112 // This is a read only IOBuffer. The data is stored in a string and |
113 // the IOBuffer interface does not provide a proper way to modify it. | 113 // the IOBuffer interface does not provide a proper way to modify it. |
114 class NET_EXPORT StringIOBuffer : public IOBuffer { | 114 class NET_EXPORT StringIOBuffer : public IOBuffer { |
115 public: | 115 public: |
116 explicit StringIOBuffer(const std::string& s); | 116 explicit StringIOBuffer(const std::string& s); |
117 | 117 |
118 int size() const { return string_data_.size(); } | 118 int size() const { return static_cast<int>(string_data_.size()); } |
Ryan Hamilton
2013/01/30 20:33:53
You're way more familiar with the 64 bit safe-ific
jschuh
2013/01/30 20:54:14
I *really* *really* wanted to, but it bleeds throu
| |
119 | 119 |
120 private: | 120 private: |
121 virtual ~StringIOBuffer(); | 121 virtual ~StringIOBuffer(); |
122 | 122 |
123 std::string string_data_; | 123 std::string string_data_; |
124 }; | 124 }; |
125 | 125 |
126 // This version wraps an existing IOBuffer and provides convenient functions | 126 // This version wraps an existing IOBuffer and provides convenient functions |
127 // to progressively read all the data. | 127 // to progressively read all the data. |
128 // | 128 // |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
235 public: | 235 public: |
236 explicit WrappedIOBuffer(const char* data); | 236 explicit WrappedIOBuffer(const char* data); |
237 | 237 |
238 protected: | 238 protected: |
239 virtual ~WrappedIOBuffer(); | 239 virtual ~WrappedIOBuffer(); |
240 }; | 240 }; |
241 | 241 |
242 } // namespace net | 242 } // namespace net |
243 | 243 |
244 #endif // NET_BASE_IO_BUFFER_H_ | 244 #endif // NET_BASE_IO_BUFFER_H_ |
OLD | NEW |