| 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_CHILD_SHARED_MEMORY_RECEIVED_DATA_FACTORY_H_ | 5 #ifndef CONTENT_CHILD_SHARED_MEMORY_RECEIVED_DATA_FACTORY_H_ |
| 6 #define CONTENT_CHILD_SHARED_MEMORY_RECEIVED_DATA_FACTORY_H_ | 6 #define CONTENT_CHILD_SHARED_MEMORY_RECEIVED_DATA_FACTORY_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 | 26 |
| 27 class CONTENT_EXPORT SharedMemoryReceivedDataFactory final | 27 class CONTENT_EXPORT SharedMemoryReceivedDataFactory final |
| 28 : public base::RefCounted<SharedMemoryReceivedDataFactory> { | 28 : public base::RefCounted<SharedMemoryReceivedDataFactory> { |
| 29 public: | 29 public: |
| 30 SharedMemoryReceivedDataFactory(IPC::Sender* message_sender, | 30 SharedMemoryReceivedDataFactory(IPC::Sender* message_sender, |
| 31 int request_id, | 31 int request_id, |
| 32 linked_ptr<base::SharedMemory> memory); | 32 linked_ptr<base::SharedMemory> memory); |
| 33 | 33 |
| 34 std::unique_ptr<RequestPeer::ReceivedData> Create(int offset, | 34 std::unique_ptr<RequestPeer::ReceivedData> Create(int offset, |
| 35 int length, | 35 int length, |
| 36 int encoded_length); | 36 int encoded_data_length, |
| 37 int encoded_body_length); |
| 37 | 38 |
| 38 // Stops this factory. After calling this function, releasing issued data | 39 // Stops this factory. After calling this function, releasing issued data |
| 39 // won't send ack signal to the browser process. | 40 // won't send ack signal to the browser process. |
| 40 void Stop(); | 41 void Stop(); |
| 41 | 42 |
| 42 private: | 43 private: |
| 43 // Here TicketId is uint32_t, but a factory may issue more data by reusing id. | 44 // Here TicketId is uint32_t, but a factory may issue more data by reusing id. |
| 44 using TicketId = uint32_t; | 45 using TicketId = uint32_t; |
| 45 | 46 |
| 46 class SharedMemoryReceivedData; | 47 class SharedMemoryReceivedData; |
| (...skipping 15 matching lines...) Expand all Loading... |
| 62 bool is_stopped_; | 63 bool is_stopped_; |
| 63 // Just to keep the payload alive while issued data is alive. | 64 // Just to keep the payload alive while issued data is alive. |
| 64 linked_ptr<base::SharedMemory> memory_; | 65 linked_ptr<base::SharedMemory> memory_; |
| 65 | 66 |
| 66 DISALLOW_COPY_AND_ASSIGN(SharedMemoryReceivedDataFactory); | 67 DISALLOW_COPY_AND_ASSIGN(SharedMemoryReceivedDataFactory); |
| 67 }; | 68 }; |
| 68 | 69 |
| 69 } // namespace content | 70 } // namespace content |
| 70 | 71 |
| 71 #endif // CONTENT_CHILD_SHARED_MEMORY_RECEIVED_DATA_FACTORY_H_ | 72 #endif // CONTENT_CHILD_SHARED_MEMORY_RECEIVED_DATA_FACTORY_H_ |
| OLD | NEW |