[email protected] | df338b7d | 2012-09-05 19:58:36 | [diff] [blame] | 1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #ifndef REMOTING_HOST_WORKER_PROCESS_IPC_DELEGATE_H_ |
| 6 | #define REMOTING_HOST_WORKER_PROCESS_IPC_DELEGATE_H_ |
| 7 | |
avi | c5960f3 | 2015-12-22 22:49:48 | [diff] [blame] | 8 | #include <stdint.h> |
| 9 | |
[email protected] | df338b7d | 2012-09-05 19:58:36 | [diff] [blame] | 10 | #include "base/compiler_specific.h" |
| 11 | |
| 12 | namespace IPC { |
| 13 | class Message; |
| 14 | } // namespace IPC |
| 15 | |
| 16 | namespace remoting { |
| 17 | |
| 18 | // An interface representing the object receiving IPC messages from a worker |
| 19 | // process. |
| 20 | class WorkerProcessIpcDelegate { |
| 21 | public: |
| 22 | virtual ~WorkerProcessIpcDelegate() {} |
| 23 | |
| 24 | // Notifies that a client has been connected to the channel. |
avi | c5960f3 | 2015-12-22 22:49:48 | [diff] [blame] | 25 | virtual void OnChannelConnected(int32_t peer_pid) = 0; |
[email protected] | df338b7d | 2012-09-05 19:58:36 | [diff] [blame] | 26 | |
| 27 | // Processes messages sent by the client. |
| 28 | virtual bool OnMessageReceived(const IPC::Message& message) = 0; |
[email protected] | 9733976 | 2012-10-10 19:00:06 | [diff] [blame] | 29 | |
| 30 | // Notifies that a permanent error was encountered. |
[email protected] | a4b3995 | 2013-06-21 03:57:08 | [diff] [blame] | 31 | virtual void OnPermanentError(int exit_code) = 0; |
zijiehe | dda3acb | 2017-06-29 23:19:16 | [diff] [blame] | 32 | |
| 33 | // Notifies that the worker process stops for any reason. |
| 34 | virtual void OnWorkerProcessStopped() = 0; |
[email protected] | df338b7d | 2012-09-05 19:58:36 | [diff] [blame] | 35 | }; |
| 36 | |
| 37 | } // namespace remoting |
| 38 | |
| 39 | #endif // REMOTING_HOST_WORKER_PROCESS_IPC_DELEGATE_H_ |