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.
5 #include "content/public/child/fixed_received_data.h"
9 FixedReceivedData::FixedReceivedData(const char* data
,
12 : data_(data
, data
+ length
), encoded_length_(encoded_length
) {
15 FixedReceivedData::FixedReceivedData(ReceivedData
* data
)
16 : FixedReceivedData(data
->payload(),
18 data
->encoded_length()) {
21 FixedReceivedData::FixedReceivedData(const std::vector
<char>& data
,
23 : data_(data
), encoded_length_(encoded_length
) {
26 FixedReceivedData::~FixedReceivedData() {
29 const char* FixedReceivedData::payload() const {
30 return data_
.empty() ? nullptr : &data_
[0];
33 int FixedReceivedData::length() const {
34 return static_cast<int>(data_
.size());
37 int FixedReceivedData::encoded_length() const {
38 return encoded_length_
;
41 } // namespace content