worker_process_ipc_delegate.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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. #ifndef REMOTING_HOST_WORKER_PROCESS_IPC_DELEGATE_H_
  5. #define REMOTING_HOST_WORKER_PROCESS_IPC_DELEGATE_H_
  6. #include <string>
  7. #include <stdint.h>
  8. #include "base/compiler_specific.h"
  9. namespace mojo {
  10. class ScopedInterfaceEndpointHandle;
  11. } // namespace mojo
  12. namespace remoting {
  13. // An interface representing the object receiving IPC messages from a worker
  14. // process.
  15. class WorkerProcessIpcDelegate {
  16. public:
  17. virtual ~WorkerProcessIpcDelegate() {}
  18. // Notifies that a client has been connected to the channel.
  19. virtual void OnChannelConnected(int32_t peer_pid) = 0;
  20. // Notifies that a permanent error was encountered.
  21. virtual void OnPermanentError(int exit_code) = 0;
  22. // Notifies that the worker process stops for any reason.
  23. virtual void OnWorkerProcessStopped() = 0;
  24. // Handles associated interface requests sent by the client.
  25. virtual void OnAssociatedInterfaceRequest(
  26. const std::string& interface_name,
  27. mojo::ScopedInterfaceEndpointHandle handle) = 0;
  28. };
  29. } // namespace remoting
  30. #endif // REMOTING_HOST_WORKER_PROCESS_IPC_DELEGATE_H_