OLD | NEW |
---|---|
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 BLIMP_NET_THREAD_PIPE_MANAGER_H_ | 5 #ifndef BLIMP_NET_THREAD_PIPE_MANAGER_H_ |
6 #define BLIMP_NET_THREAD_PIPE_MANAGER_H_ | 6 #define BLIMP_NET_THREAD_PIPE_MANAGER_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 21 matching lines...) Expand all Loading... | |
32 // Caller is responsible for ensuring that |connection_handler| outlives | 32 // Caller is responsible for ensuring that |connection_handler| outlives |
33 // |this|. | 33 // |this|. |
34 explicit ThreadPipeManager( | 34 explicit ThreadPipeManager( |
35 const scoped_refptr<base::SequencedTaskRunner>& io_task_runner, | 35 const scoped_refptr<base::SequencedTaskRunner>& io_task_runner, |
36 const scoped_refptr<base::SequencedTaskRunner>& ui_task_runner, | 36 const scoped_refptr<base::SequencedTaskRunner>& ui_task_runner, |
37 BrowserConnectionHandler* connection_handler); | 37 BrowserConnectionHandler* connection_handler); |
38 | 38 |
39 ~ThreadPipeManager(); | 39 ~ThreadPipeManager(); |
40 | 40 |
41 // Registers a message processor |incoming_processor| which will receive all | 41 // Registers a message processor |incoming_processor| which will receive all |
42 // messages of the |type| specified. Returns a BlimpMessageProcessor object | 42 // messages of the |feature_case| specified. Returns a BlimpMessageProcessor |
43 // object | |
43 // for sending messages of type |type|. | 44 // for sending messages of type |type|. |
Kevin M
2016/05/20 18:28:16
"type"... update comment
shaktisahu
2016/05/20 22:29:42
Done.
| |
44 std::unique_ptr<BlimpMessageProcessor> RegisterFeature( | 45 std::unique_ptr<BlimpMessageProcessor> RegisterFeature( |
45 BlimpMessage::Type type, | 46 BlimpMessage::FeatureCase feature_case, |
46 BlimpMessageProcessor* incoming_processor); | 47 BlimpMessageProcessor* incoming_processor); |
47 | 48 |
48 private: | 49 private: |
49 scoped_refptr<base::SequencedTaskRunner> io_task_runner_; | 50 scoped_refptr<base::SequencedTaskRunner> io_task_runner_; |
50 scoped_refptr<base::SequencedTaskRunner> ui_task_runner_; | 51 scoped_refptr<base::SequencedTaskRunner> ui_task_runner_; |
51 | 52 |
52 // Container for BlimpMessageThreadPipes that are destroyed on IO thread. | 53 // Container for BlimpMessageThreadPipes that are destroyed on IO thread. |
53 std::unique_ptr<IoThreadPipeManager> io_pipe_manager_; | 54 std::unique_ptr<IoThreadPipeManager> io_pipe_manager_; |
54 | 55 |
55 // Pipes for routing messages from the IO to the UI thread. | 56 // Pipes for routing messages from the IO to the UI thread. |
56 // Incoming messages are only routed to the UI thread since all features run | 57 // Incoming messages are only routed to the UI thread since all features run |
57 // there. | 58 // there. |
58 std::vector<std::unique_ptr<BlimpMessageThreadPipe>> incoming_pipes_; | 59 std::vector<std::unique_ptr<BlimpMessageThreadPipe>> incoming_pipes_; |
59 | 60 |
60 DISALLOW_COPY_AND_ASSIGN(ThreadPipeManager); | 61 DISALLOW_COPY_AND_ASSIGN(ThreadPipeManager); |
61 }; | 62 }; |
62 | 63 |
63 } // namespace blimp | 64 } // namespace blimp |
64 | 65 |
65 #endif // BLIMP_NET_THREAD_PIPE_MANAGER_H_ | 66 #endif // BLIMP_NET_THREAD_PIPE_MANAGER_H_ |
OLD | NEW |