Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "content/public/child/request_peer.h" | |
|
jochen (gone - plz use gerrit)
2015/06/01 13:08:28
this file should go into content/public/child
yhirano
2015/06/02 02:08:47
Done.
| |
| 6 | |
| 7 namespace content { | |
| 8 | |
| 9 RequestPeer::FixedReceivedData::FixedReceivedData(const char* data, | |
| 10 size_t length, | |
| 11 int encoded_length) | |
| 12 : data_(data, data + length), encoded_length_(encoded_length) { | |
| 13 } | |
| 14 | |
| 15 RequestPeer::FixedReceivedData::FixedReceivedData( | |
| 16 scoped_ptr<RequestPeer::ReceivedData> data) | |
| 17 : FixedReceivedData(data->payload(), | |
| 18 data->encoded_length(), | |
| 19 data->encoded_length()) { | |
| 20 } | |
| 21 | |
| 22 RequestPeer::FixedReceivedData::FixedReceivedData(const std::vector<char>& data, | |
| 23 int encoded_length) | |
| 24 : data_(data), encoded_length_(encoded_length) { | |
| 25 } | |
| 26 | |
| 27 RequestPeer::FixedReceivedData::~FixedReceivedData() { | |
| 28 } | |
| 29 | |
| 30 const char* RequestPeer::FixedReceivedData::payload() const { | |
| 31 return data_.empty() ? nullptr : &data_[0]; | |
| 32 } | |
| 33 | |
| 34 int RequestPeer::FixedReceivedData::length() const { | |
| 35 return data_.size(); | |
| 36 } | |
| 37 | |
| 38 int RequestPeer::FixedReceivedData::encoded_length() const { | |
| 39 return encoded_length_; | |
| 40 } | |
| 41 | |
| 42 } // namespace content | |
| OLD | NEW |