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 #include "net/spdy/spdy_io_buffer.h" | 5 #include "net/spdy/spdy_io_buffer.h" |
6 #include "net/spdy/spdy_stream.h" | 6 #include "net/spdy/spdy_stream.h" |
7 | 7 |
8 namespace net { | 8 namespace net { |
9 | 9 |
10 // static | 10 // static |
11 uint64 SpdyIOBuffer::order_ = 0; | 11 uint64 SpdyIOBuffer::order_ = 0; |
12 | 12 |
13 SpdyIOBuffer::SpdyIOBuffer( | 13 SpdyIOBuffer::SpdyIOBuffer( |
14 IOBuffer* buffer, int size, RequestPriority priority, SpdyStream* stream) | 14 IOBuffer* buffer, int size, RequestPriority priority, SpdyStream* stream) |
15 : buffer_(new DrainableIOBuffer(buffer, size)), | 15 : buffer_(new DrainableIOBuffer(buffer, size)), |
16 priority_(priority), | 16 priority_(priority), |
17 position_(++order_), | 17 position_(++order_), |
18 stream_(stream) {} | 18 stream_(stream) {} |
19 | 19 |
20 SpdyIOBuffer::SpdyIOBuffer() : priority_(HIGHEST), position_(0), stream_(NULL) { | 20 SpdyIOBuffer::SpdyIOBuffer() : priority_(HIGHEST), position_(0), stream_(NULL) { |
21 } | 21 } |
22 | 22 |
| 23 SpdyIOBuffer::SpdyIOBuffer(const SpdyIOBuffer& rhs) { |
| 24 buffer_ = rhs.buffer_; |
| 25 priority_ = rhs.priority_; |
| 26 position_ = rhs.position_; |
| 27 stream_ = rhs.stream_; |
| 28 } |
| 29 |
23 SpdyIOBuffer::~SpdyIOBuffer() {} | 30 SpdyIOBuffer::~SpdyIOBuffer() {} |
24 | 31 |
| 32 SpdyIOBuffer& SpdyIOBuffer::operator=(const SpdyIOBuffer& rhs) { |
| 33 buffer_ = rhs.buffer_; |
| 34 priority_ = rhs.priority_; |
| 35 position_ = rhs.position_; |
| 36 stream_ = rhs.stream_; |
| 37 return *this; |
| 38 } |
| 39 |
25 void SpdyIOBuffer::release() { | 40 void SpdyIOBuffer::release() { |
26 buffer_ = NULL; | 41 buffer_ = NULL; |
27 stream_ = NULL; | 42 stream_ = NULL; |
28 } | 43 } |
29 | 44 |
30 } // namespace net | 45 } // namespace net |
OLD | NEW |