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_data_length); | 21 FixedReceivedData(const char* data, size_t length); |
22 explicit FixedReceivedData(ReceivedData* data); | 22 explicit FixedReceivedData(ReceivedData* data); |
23 FixedReceivedData(const std::vector<char>& data, int encoded_data_length); | 23 FixedReceivedData(const std::vector<char>& data); |
24 ~FixedReceivedData() override; | 24 ~FixedReceivedData() override; |
25 | 25 |
26 const char* payload() const override; | 26 const char* payload() const override; |
27 int length() const override; | 27 int length() const override; |
28 int encoded_data_length() const override; | |
29 | 28 |
30 private: | 29 private: |
31 std::vector<char> data_; | 30 std::vector<char> data_; |
32 int encoded_data_length_; | |
33 | 31 |
34 DISALLOW_COPY_AND_ASSIGN(FixedReceivedData); | 32 DISALLOW_COPY_AND_ASSIGN(FixedReceivedData); |
35 }; | 33 }; |
36 | 34 |
37 } // namespace content | 35 } // namespace content |
38 | 36 |
39 #endif // CONTENT_PUBLIC_CHILD_FIXED_RECEIVED_DATA_H_ | 37 #endif // CONTENT_PUBLIC_CHILD_FIXED_RECEIVED_DATA_H_ |
OLD | NEW |