| 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 13 matching lines...) Expand all Loading... |
| 24 | 24 |
| 25 namespace content { | 25 namespace content { |
| 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, int length); |
| 35 int length, | |
| 36 int encoded_data_length); | |
| 37 | 35 |
| 38 // Stops this factory. After calling this function, releasing issued data | 36 // Stops this factory. After calling this function, releasing issued data |
| 39 // won't send ack signal to the browser process. | 37 // won't send ack signal to the browser process. |
| 40 void Stop(); | 38 void Stop(); |
| 41 | 39 |
| 42 private: | 40 private: |
| 43 // Here TicketId is uint32_t, but a factory may issue more data by reusing id. | 41 // Here TicketId is uint32_t, but a factory may issue more data by reusing id. |
| 44 using TicketId = uint32_t; | 42 using TicketId = uint32_t; |
| 45 | 43 |
| 46 class SharedMemoryReceivedData; | 44 class SharedMemoryReceivedData; |
| (...skipping 15 matching lines...) Expand all Loading... |
| 62 bool is_stopped_; | 60 bool is_stopped_; |
| 63 // Just to keep the payload alive while issued data is alive. | 61 // Just to keep the payload alive while issued data is alive. |
| 64 linked_ptr<base::SharedMemory> memory_; | 62 linked_ptr<base::SharedMemory> memory_; |
| 65 | 63 |
| 66 DISALLOW_COPY_AND_ASSIGN(SharedMemoryReceivedDataFactory); | 64 DISALLOW_COPY_AND_ASSIGN(SharedMemoryReceivedDataFactory); |
| 67 }; | 65 }; |
| 68 | 66 |
| 69 } // namespace content | 67 } // namespace content |
| 70 | 68 |
| 71 #endif // CONTENT_CHILD_SHARED_MEMORY_RECEIVED_DATA_FACTORY_H_ | 69 #endif // CONTENT_CHILD_SHARED_MEMORY_RECEIVED_DATA_FACTORY_H_ |
| OLD | NEW |