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_DATA_CONSUMER_HANDLE_H_ | 5 #ifndef CONTENT_CHILD_SHARED_MEMORY_DATA_CONSUMER_HANDLE_H_ |
6 #define CONTENT_CHILD_SHARED_MEMORY_DATA_CONSUMER_HANDLE_H_ | 6 #define CONTENT_CHILD_SHARED_MEMORY_DATA_CONSUMER_HANDLE_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 // |on_reader_detached| will be called aynchronously on the calling thread | 74 // |on_reader_detached| will be called aynchronously on the calling thread |
75 // when the reader (including the handle) is detached (i.e. both the handle | 75 // when the reader (including the handle) is detached (i.e. both the handle |
76 // and the reader are destructed). The callback will be reset in the internal | 76 // and the reader are destructed). The callback will be reset in the internal |
77 // context when the writer is detached, i.e. |Close| or |Fail| is called, | 77 // context when the writer is detached, i.e. |Close| or |Fail| is called, |
78 // and the callback will never be called. | 78 // and the callback will never be called. |
79 SharedMemoryDataConsumerHandle(BackpressureMode mode, | 79 SharedMemoryDataConsumerHandle(BackpressureMode mode, |
80 const base::Closure& on_reader_detached, | 80 const base::Closure& on_reader_detached, |
81 std::unique_ptr<Writer>* writer); | 81 std::unique_ptr<Writer>* writer); |
82 ~SharedMemoryDataConsumerHandle() override; | 82 ~SharedMemoryDataConsumerHandle() override; |
83 | 83 |
84 std::unique_ptr<Reader> ObtainReader(Client* client); | 84 std::unique_ptr<Reader> obtainReader(Client* client) override; |
85 | 85 |
86 private: | 86 private: |
87 ReaderImpl* obtainReaderInternal(Client* client) override; | |
88 const char* debugName() const override; | 87 const char* debugName() const override; |
89 | 88 |
90 scoped_refptr<Context> context_; | 89 scoped_refptr<Context> context_; |
91 | 90 |
92 DISALLOW_COPY_AND_ASSIGN(SharedMemoryDataConsumerHandle); | 91 DISALLOW_COPY_AND_ASSIGN(SharedMemoryDataConsumerHandle); |
93 }; | 92 }; |
94 | 93 |
95 } // namespace content | 94 } // namespace content |
96 | 95 |
97 #endif // CONTENT_CHILD_SHARED_MEMORY_DATA_CONSUMER_HANDLE_H_ | 96 #endif // CONTENT_CHILD_SHARED_MEMORY_DATA_CONSUMER_HANDLE_H_ |
OLD | NEW |