OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 MOJO_SHELL_EXTERNAL_APPLICATION_LISTENER_POSIX_H_ | 5 #ifndef MOJO_SHELL_EXTERNAL_APPLICATION_LISTENER_POSIX_H_ |
6 #define MOJO_SHELL_EXTERNAL_APPLICATION_LISTENER_POSIX_H_ | 6 #define MOJO_SHELL_EXTERNAL_APPLICATION_LISTENER_POSIX_H_ |
7 | 7 |
8 #include "mojo/shell/external_application_listener.h" | 8 #include "mojo/shell/external_application_listener.h" |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 // MUST be called on io_runner. | 83 // MUST be called on io_runner. |
84 // Creates listener_ and tells it to StartListening() on a socket it creates | 84 // Creates listener_ and tells it to StartListening() on a socket it creates |
85 // at listen_socket_path. | 85 // at listen_socket_path. |
86 void StartListening(const base::FilePath& listen_socket_path); | 86 void StartListening(const base::FilePath& listen_socket_path); |
87 | 87 |
88 // MUST be called on io_runner. | 88 // MUST be called on io_runner. |
89 // Destroys listener_ and signals event when done. | 89 // Destroys listener_ and signals event when done. |
90 void StopListening(base::WaitableEvent* event); | 90 void StopListening(base::WaitableEvent* event); |
91 | 91 |
92 // Implementation of IncomingConnectionListener::Delegate | 92 // Implementation of IncomingConnectionListener::Delegate |
93 virtual void OnListening(int rv) MOJO_OVERRIDE; | 93 virtual void OnListening(int rv) override; |
94 virtual void OnConnection(net::SocketDescriptor incoming) MOJO_OVERRIDE; | 94 virtual void OnConnection(net::SocketDescriptor incoming) override; |
95 | 95 |
96 // If listener_ fails to start listening, this method is run on shell_runner_ | 96 // If listener_ fails to start listening, this method is run on shell_runner_ |
97 // to report the error. | 97 // to report the error. |
98 void RunErrorCallbackIfListeningFailed(int rv); | 98 void RunErrorCallbackIfListeningFailed(int rv); |
99 | 99 |
100 // When a connection succeeds, it is passed to this method running | 100 // When a connection succeeds, it is passed to this method running |
101 // on shell_runner_, where it is "promoted" to a Mojo MessagePipe and | 101 // on shell_runner_, where it is "promoted" to a Mojo MessagePipe and |
102 // bound to a RegistrarImpl. | 102 // bound to a RegistrarImpl. |
103 void CreatePipeAndBindToRegistrarImpl(net::SocketDescriptor incoming_socket); | 103 void CreatePipeAndBindToRegistrarImpl(net::SocketDescriptor incoming_socket); |
104 | 104 |
(...skipping 16 matching lines...) Expand all Loading... |
121 base::ThreadChecker register_thread_checker_; | 121 base::ThreadChecker register_thread_checker_; |
122 | 122 |
123 // Used on shell_runner_. | 123 // Used on shell_runner_. |
124 base::WeakPtrFactory<ExternalApplicationListenerPosix> weak_ptr_factory_; | 124 base::WeakPtrFactory<ExternalApplicationListenerPosix> weak_ptr_factory_; |
125 }; | 125 }; |
126 | 126 |
127 } // namespace shell | 127 } // namespace shell |
128 } // namespace mojo | 128 } // namespace mojo |
129 | 129 |
130 #endif // MOJO_SHELL_EXTERNAL_APPLICATION_LISTENER_POSIX_H_ | 130 #endif // MOJO_SHELL_EXTERNAL_APPLICATION_LISTENER_POSIX_H_ |
OLD | NEW |