| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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 REMOTING_HOST_WORKER_PROCESS_IPC_DELEGATE_H_ | 5 #ifndef REMOTING_HOST_WORKER_PROCESS_IPC_DELEGATE_H_ |
| 6 #define REMOTING_HOST_WORKER_PROCESS_IPC_DELEGATE_H_ | 6 #define REMOTING_HOST_WORKER_PROCESS_IPC_DELEGATE_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 | 10 |
| 11 namespace IPC { | 11 namespace IPC { |
| 12 class Message; | 12 class Message; |
| 13 } // namespace IPC | 13 } // namespace IPC |
| 14 | 14 |
| 15 namespace remoting { | 15 namespace remoting { |
| 16 | 16 |
| 17 // An interface representing the object receiving IPC messages from a worker | 17 // An interface representing the object receiving IPC messages from a worker |
| 18 // process. | 18 // process. |
| 19 class WorkerProcessIpcDelegate { | 19 class WorkerProcessIpcDelegate { |
| 20 public: | 20 public: |
| 21 virtual ~WorkerProcessIpcDelegate() {} | 21 virtual ~WorkerProcessIpcDelegate() {} |
| 22 | 22 |
| 23 // Notifies that a client has been connected to the channel. | 23 // Notifies that a client has been connected to the channel. |
| 24 virtual void OnChannelConnected(int32 peer_pid) = 0; | 24 virtual void OnChannelConnected(int32 peer_pid) = 0; |
| 25 | 25 |
| 26 // Processes messages sent by the client. | 26 // Processes messages sent by the client. |
| 27 virtual bool OnMessageReceived(const IPC::Message& message) = 0; | 27 virtual bool OnMessageReceived(const IPC::Message& message) = 0; |
| 28 | 28 |
| 29 // Notifies that a permanent error was encountered. | 29 // Notifies that a permanent error was encountered. |
| 30 virtual void OnPermanentError() = 0; | 30 virtual void OnPermanentError(int exit_code) = 0; |
| 31 }; | 31 }; |
| 32 | 32 |
| 33 } // namespace remoting | 33 } // namespace remoting |
| 34 | 34 |
| 35 #endif // REMOTING_HOST_WORKER_PROCESS_IPC_DELEGATE_H_ | 35 #endif // REMOTING_HOST_WORKER_PROCESS_IPC_DELEGATE_H_ |
| OLD | NEW |