OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 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 CONTENT_PUBLIC_CHILD_FIXED_RECEIVED_DATA_H_ | 5 #ifndef CONTENT_PUBLIC_CHILD_FIXED_RECEIVED_DATA_H_ |
6 #define CONTENT_PUBLIC_CHILD_FIXED_RECEIVED_DATA_H_ | 6 #define CONTENT_PUBLIC_CHILD_FIXED_RECEIVED_DATA_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "base/macros.h" | 12 #include "base/macros.h" |
13 #include "content/common/content_export.h" | 13 #include "content/common/content_export.h" |
14 #include "content/public/child/request_peer.h" | 14 #include "content/public/child/request_peer.h" |
15 | 15 |
16 namespace content { | 16 namespace content { |
17 | 17 |
18 class CONTENT_EXPORT FixedReceivedData final | 18 class CONTENT_EXPORT FixedReceivedData final |
19 : public RequestPeer::ThreadSafeReceivedData { | 19 : public RequestPeer::ThreadSafeReceivedData { |
20 public: | 20 public: |
21 FixedReceivedData(const char* data, size_t length, int encoded_length); | 21 FixedReceivedData(const char* data, |
| 22 size_t length, |
| 23 int encoded_data_length, |
| 24 int encoded_body_length); |
22 explicit FixedReceivedData(ReceivedData* data); | 25 explicit FixedReceivedData(ReceivedData* data); |
23 FixedReceivedData(const std::vector<char>& data, int encoded_length); | 26 FixedReceivedData(const std::vector<char>& data, |
| 27 int encoded_data_length, |
| 28 int encoded_body_length); |
24 ~FixedReceivedData() override; | 29 ~FixedReceivedData() override; |
25 | 30 |
26 const char* payload() const override; | 31 const char* payload() const override; |
27 int length() const override; | 32 int length() const override; |
28 int encoded_length() const override; | 33 int encoded_data_length() const override; |
| 34 int encoded_body_length() const override; |
29 | 35 |
30 private: | 36 private: |
31 std::vector<char> data_; | 37 std::vector<char> data_; |
32 int encoded_length_; | 38 int encoded_data_length_; |
| 39 int encoded_body_length_; |
33 | 40 |
34 DISALLOW_COPY_AND_ASSIGN(FixedReceivedData); | 41 DISALLOW_COPY_AND_ASSIGN(FixedReceivedData); |
35 }; | 42 }; |
36 | 43 |
37 } // namespace content | 44 } // namespace content |
38 | 45 |
39 #endif // CONTENT_PUBLIC_CHILD_FIXED_RECEIVED_DATA_H_ | 46 #endif // CONTENT_PUBLIC_CHILD_FIXED_RECEIVED_DATA_H_ |
OLD | NEW |