| 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_CHROMOTING_MESSAGES_H_ | 5 #ifndef REMOTING_HOST_CHROMOTING_MESSAGES_H_ |
| 6 #define REMOTING_HOST_CHROMOTING_MESSAGES_H_ | 6 #define REMOTING_HOST_CHROMOTING_MESSAGES_H_ |
| 7 | 7 |
| 8 #include "ipc/ipc_platform_file.h" | 8 #include "ipc/ipc_platform_file.h" |
| 9 #include "media/video/capture/screen/mouse_cursor_shape.h" | 9 #include "media/video/capture/screen/mouse_cursor_shape.h" |
| 10 #include "net/base/ip_endpoint.h" | 10 #include "net/base/ip_endpoint.h" |
| 11 #include "remoting/host/chromoting_param_traits.h" |
| 11 #include "remoting/host/screen_resolution.h" | 12 #include "remoting/host/screen_resolution.h" |
| 12 #include "remoting/protocol/transport.h" | 13 #include "remoting/protocol/transport.h" |
| 13 #include "third_party/skia/include/core/SkPoint.h" | 14 #include "third_party/webrtc/modules/desktop_capture/desktop_geometry.h" |
| 14 #include "third_party/skia/include/core/SkRect.h" | |
| 15 #include "third_party/skia/include/core/SkSize.h" | |
| 16 | 15 |
| 17 #endif // REMOTING_HOST_CHROMOTING_MESSAGES_H_ | 16 #endif // REMOTING_HOST_CHROMOTING_MESSAGES_H_ |
| 18 | 17 |
| 19 // Multiply-included message file, no traditional include guard. | 18 // Multiply-included message file, no traditional include guard. |
| 20 #include "ipc/ipc_message_macros.h" | 19 #include "ipc/ipc_message_macros.h" |
| 21 | 20 |
| 22 #define IPC_MESSAGE_START ChromotingMsgStart | 21 #define IPC_MESSAGE_START ChromotingMsgStart |
| 23 | 22 |
| 24 //----------------------------------------------------------------------------- | 23 //----------------------------------------------------------------------------- |
| 25 // Chromoting messages sent from the daemon. | 24 // Chromoting messages sent from the daemon. |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 base::ProcessHandle /* desktop_process */, | 56 base::ProcessHandle /* desktop_process */, |
| 58 IPC::PlatformFileForTransit /* desktop_pipe */) | 57 IPC::PlatformFileForTransit /* desktop_pipe */) |
| 59 | 58 |
| 60 //----------------------------------------------------------------------------- | 59 //----------------------------------------------------------------------------- |
| 61 // Chromoting messages sent from the network to the daemon process. | 60 // Chromoting messages sent from the network to the daemon process. |
| 62 | 61 |
| 63 // Asks the daemon to send Secure Attention Sequence (SAS) to the current | 62 // Asks the daemon to send Secure Attention Sequence (SAS) to the current |
| 64 // console session. | 63 // console session. |
| 65 IPC_MESSAGE_CONTROL0(ChromotingNetworkDaemonMsg_SendSasToConsole) | 64 IPC_MESSAGE_CONTROL0(ChromotingNetworkDaemonMsg_SendSasToConsole) |
| 66 | 65 |
| 67 IPC_STRUCT_TRAITS_BEGIN(remoting::ScreenResolution) | |
| 68 IPC_STRUCT_TRAITS_MEMBER(dimensions_) | |
| 69 IPC_STRUCT_TRAITS_MEMBER(dpi_) | |
| 70 IPC_STRUCT_TRAITS_END() | |
| 71 | |
| 72 // Connects the terminal |terminal_id| (i.e. a remote client) to a desktop | 66 // Connects the terminal |terminal_id| (i.e. a remote client) to a desktop |
| 73 // session. | 67 // session. |
| 74 IPC_MESSAGE_CONTROL3(ChromotingNetworkHostMsg_ConnectTerminal, | 68 IPC_MESSAGE_CONTROL3(ChromotingNetworkHostMsg_ConnectTerminal, |
| 75 int /* terminal_id */, | 69 int /* terminal_id */, |
| 76 remoting::ScreenResolution /* resolution */, | 70 remoting::ScreenResolution /* resolution */, |
| 77 bool /* virtual_terminal */) | 71 bool /* virtual_terminal */) |
| 78 | 72 |
| 79 // Disconnects the terminal |terminal_id| from the desktop session it was | 73 // Disconnects the terminal |terminal_id| from the desktop session it was |
| 80 // connected to. | 74 // connected to. |
| 81 IPC_MESSAGE_CONTROL1(ChromotingNetworkHostMsg_DisconnectTerminal, | 75 IPC_MESSAGE_CONTROL1(ChromotingNetworkHostMsg_DisconnectTerminal, |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 IPC_MESSAGE_CONTROL1(ChromotingDesktopDaemonMsg_DesktopAttached, | 125 IPC_MESSAGE_CONTROL1(ChromotingDesktopDaemonMsg_DesktopAttached, |
| 132 IPC::PlatformFileForTransit /* desktop_pipe */) | 126 IPC::PlatformFileForTransit /* desktop_pipe */) |
| 133 | 127 |
| 134 // Asks the daemon to inject Secure Attention Sequence (SAS) in the session | 128 // Asks the daemon to inject Secure Attention Sequence (SAS) in the session |
| 135 // where the desktop process is running. | 129 // where the desktop process is running. |
| 136 IPC_MESSAGE_CONTROL0(ChromotingDesktopDaemonMsg_InjectSas) | 130 IPC_MESSAGE_CONTROL0(ChromotingDesktopDaemonMsg_InjectSas) |
| 137 | 131 |
| 138 //----------------------------------------------------------------------------- | 132 //----------------------------------------------------------------------------- |
| 139 // Chromoting messages sent from the desktop to the network process. | 133 // Chromoting messages sent from the desktop to the network process. |
| 140 | 134 |
| 141 // Notifies the network process that a shared buffer has been created. Receipt | 135 // Notifies the network process that a shared buffer has been created. |
| 142 // of this message must be confirmed by replying with | |
| 143 // ChromotingNetworkDesktopMsg_SharedBufferCreated message. | |
| 144 IPC_MESSAGE_CONTROL3(ChromotingDesktopNetworkMsg_CreateSharedBuffer, | 136 IPC_MESSAGE_CONTROL3(ChromotingDesktopNetworkMsg_CreateSharedBuffer, |
| 145 int /* id */, | 137 int /* id */, |
| 146 IPC::PlatformFileForTransit /* handle */, | 138 IPC::PlatformFileForTransit /* handle */, |
| 147 uint32 /* size */) | 139 uint32 /* size */) |
| 148 | 140 |
| 149 // Request the network process to stop using a shared buffer. | 141 // Request the network process to stop using a shared buffer. |
| 150 IPC_MESSAGE_CONTROL1(ChromotingDesktopNetworkMsg_ReleaseSharedBuffer, | 142 IPC_MESSAGE_CONTROL1(ChromotingDesktopNetworkMsg_ReleaseSharedBuffer, |
| 151 int /* id */) | 143 int /* id */) |
| 152 | 144 |
| 153 IPC_STRUCT_TRAITS_BEGIN(SkIPoint) | |
| 154 IPC_STRUCT_TRAITS_MEMBER(fX) | |
| 155 IPC_STRUCT_TRAITS_MEMBER(fY) | |
| 156 IPC_STRUCT_TRAITS_END() | |
| 157 | |
| 158 IPC_STRUCT_TRAITS_BEGIN(SkIRect) | |
| 159 IPC_STRUCT_TRAITS_MEMBER(fLeft) | |
| 160 IPC_STRUCT_TRAITS_MEMBER(fTop) | |
| 161 IPC_STRUCT_TRAITS_MEMBER(fRight) | |
| 162 IPC_STRUCT_TRAITS_MEMBER(fBottom) | |
| 163 IPC_STRUCT_TRAITS_END() | |
| 164 | |
| 165 IPC_STRUCT_TRAITS_BEGIN(SkISize) | |
| 166 IPC_STRUCT_TRAITS_MEMBER(fWidth) | |
| 167 IPC_STRUCT_TRAITS_MEMBER(fHeight) | |
| 168 IPC_STRUCT_TRAITS_END() | |
| 169 | |
| 170 IPC_STRUCT_TRAITS_BEGIN(media::MouseCursorShape) | 145 IPC_STRUCT_TRAITS_BEGIN(media::MouseCursorShape) |
| 171 IPC_STRUCT_TRAITS_MEMBER(size) | 146 IPC_STRUCT_TRAITS_MEMBER(size) |
| 172 IPC_STRUCT_TRAITS_MEMBER(hotspot) | 147 IPC_STRUCT_TRAITS_MEMBER(hotspot) |
| 173 IPC_STRUCT_TRAITS_MEMBER(data) | 148 IPC_STRUCT_TRAITS_MEMBER(data) |
| 174 IPC_STRUCT_TRAITS_END() | 149 IPC_STRUCT_TRAITS_END() |
| 175 | 150 |
| 176 // Serialized media::ScreenCaptureData structure. | 151 // Serialized webrtc::DesktopFrame. |
| 177 IPC_STRUCT_BEGIN(SerializedCapturedData) | 152 IPC_STRUCT_BEGIN(SerializedDesktopFrame) |
| 178 // ID of the shared memory buffer containing the pixels. | 153 // ID of the shared memory buffer containing the pixels. |
| 179 IPC_STRUCT_MEMBER(int, shared_buffer_id) | 154 IPC_STRUCT_MEMBER(int, shared_buffer_id) |
| 180 | 155 |
| 181 // Width of a single row of pixels in bytes. | 156 // Width of a single row of pixels in bytes. |
| 182 IPC_STRUCT_MEMBER(int, bytes_per_row) | 157 IPC_STRUCT_MEMBER(int, bytes_per_row) |
| 183 | 158 |
| 184 // Captured region. | 159 // Captured region. |
| 185 IPC_STRUCT_MEMBER(std::vector<SkIRect>, dirty_region) | 160 IPC_STRUCT_MEMBER(std::vector<webrtc::DesktopRect>, dirty_region) |
| 186 | 161 |
| 187 // Dimensions of the buffer in pixels. | 162 // Dimensions of the buffer in pixels. |
| 188 IPC_STRUCT_MEMBER(SkISize, dimensions) | 163 IPC_STRUCT_MEMBER(webrtc::DesktopSize, dimensions) |
| 189 | 164 |
| 190 // Time spent in capture. Unit is in milliseconds. | 165 // Time spent in capture. Unit is in milliseconds. |
| 191 IPC_STRUCT_MEMBER(int, capture_time_ms) | 166 IPC_STRUCT_MEMBER(int, capture_time_ms) |
| 192 | 167 |
| 193 // Sequence number supplied by client for performance tracking. | 168 // Sequence number supplied by client for performance tracking. |
| 194 IPC_STRUCT_MEMBER(int64, client_sequence_number) | 169 IPC_STRUCT_MEMBER(int64, client_sequence_number) |
| 195 | 170 |
| 196 // DPI for this frame. | 171 // DPI for this frame. |
| 197 IPC_STRUCT_MEMBER(SkIPoint, dpi) | 172 IPC_STRUCT_MEMBER(webrtc::DesktopVector, dpi) |
| 198 IPC_STRUCT_END() | 173 IPC_STRUCT_END() |
| 199 | 174 |
| 200 // Notifies the network process that a shared buffer has been created. | 175 // Notifies the network process that a shared buffer has been created. |
| 201 IPC_MESSAGE_CONTROL1(ChromotingDesktopNetworkMsg_CaptureCompleted, | 176 IPC_MESSAGE_CONTROL1(ChromotingDesktopNetworkMsg_CaptureCompleted, |
| 202 SerializedCapturedData /* capture_data */ ) | 177 SerializedDesktopFrame /* frame */ ) |
| 203 | 178 |
| 204 // Carries a cursor share update from the desktop session agent to the client. | 179 // Carries a cursor share update from the desktop session agent to the client. |
| 205 IPC_MESSAGE_CONTROL1(ChromotingDesktopNetworkMsg_CursorShapeChanged, | 180 IPC_MESSAGE_CONTROL1(ChromotingDesktopNetworkMsg_CursorShapeChanged, |
| 206 media::MouseCursorShape /* cursor_shape */ ) | 181 media::MouseCursorShape /* cursor_shape */ ) |
| 207 | 182 |
| 208 // Carries a clipboard event from the desktop session agent to the client. | 183 // Carries a clipboard event from the desktop session agent to the client. |
| 209 // |serialized_event| is a serialized protocol::ClipboardEvent. | 184 // |serialized_event| is a serialized protocol::ClipboardEvent. |
| 210 IPC_MESSAGE_CONTROL1(ChromotingDesktopNetworkMsg_InjectClipboardEvent, | 185 IPC_MESSAGE_CONTROL1(ChromotingDesktopNetworkMsg_InjectClipboardEvent, |
| 211 std::string /* serialized_event */ ) | 186 std::string /* serialized_event */ ) |
| 212 | 187 |
| 213 // Requests the network process to terminate the client session. | 188 // Requests the network process to terminate the client session. |
| 214 IPC_MESSAGE_CONTROL0(ChromotingDesktopNetworkMsg_DisconnectSession) | 189 IPC_MESSAGE_CONTROL0(ChromotingDesktopNetworkMsg_DisconnectSession) |
| 215 | 190 |
| 216 // Carries an audio packet from the desktop session agent to the client. | 191 // Carries an audio packet from the desktop session agent to the client. |
| 217 // |serialized_packet| is a serialized AudioPacket. | 192 // |serialized_packet| is a serialized AudioPacket. |
| 218 IPC_MESSAGE_CONTROL1(ChromotingDesktopNetworkMsg_AudioPacket, | 193 IPC_MESSAGE_CONTROL1(ChromotingDesktopNetworkMsg_AudioPacket, |
| 219 std::string /* serialized_packet */ ) | 194 std::string /* serialized_packet */ ) |
| 220 | 195 |
| 221 //----------------------------------------------------------------------------- | 196 //----------------------------------------------------------------------------- |
| 222 // Chromoting messages sent from the network to the desktop process. | 197 // Chromoting messages sent from the network to the desktop process. |
| 223 | 198 |
| 224 // Passes the client session data to the desktop session agent and starts it. | 199 // Passes the client session data to the desktop session agent and starts it. |
| 225 // This must be the first message received from the host. | 200 // This must be the first message received from the host. |
| 226 IPC_MESSAGE_CONTROL3(ChromotingNetworkDesktopMsg_StartSessionAgent, | 201 IPC_MESSAGE_CONTROL3(ChromotingNetworkDesktopMsg_StartSessionAgent, |
| 227 std::string /* authenticated_jid */, | 202 std::string /* authenticated_jid */, |
| 228 remoting::ScreenResolution /* resolution */, | 203 remoting::ScreenResolution /* resolution */, |
| 229 bool /* virtual_terminal */) | 204 bool /* virtual_terminal */) |
| 230 | 205 |
| 231 // Notifies the desktop process that the shared memory buffer has been mapped to | |
| 232 // the memory of the network process and so it can be safely dropped by | |
| 233 // the network process at any time. | |
| 234 IPC_MESSAGE_CONTROL1(ChromotingNetworkDesktopMsg_SharedBufferCreated, | |
| 235 int /* id */) | |
| 236 | |
| 237 IPC_MESSAGE_CONTROL0(ChromotingNetworkDesktopMsg_CaptureFrame) | 206 IPC_MESSAGE_CONTROL0(ChromotingNetworkDesktopMsg_CaptureFrame) |
| 238 | 207 |
| 239 // Carries a clipboard event from the client to the desktop session agent. | 208 // Carries a clipboard event from the client to the desktop session agent. |
| 240 // |serialized_event| is a serialized protocol::ClipboardEvent. | 209 // |serialized_event| is a serialized protocol::ClipboardEvent. |
| 241 IPC_MESSAGE_CONTROL1(ChromotingNetworkDesktopMsg_InjectClipboardEvent, | 210 IPC_MESSAGE_CONTROL1(ChromotingNetworkDesktopMsg_InjectClipboardEvent, |
| 242 std::string /* serialized_event */ ) | 211 std::string /* serialized_event */ ) |
| 243 | 212 |
| 244 // Carries a keyboard event from the client to the desktop session agent. | 213 // Carries a keyboard event from the client to the desktop session agent. |
| 245 // |serialized_event| is a serialized protocol::KeyEvent. | 214 // |serialized_event| is a serialized protocol::KeyEvent. |
| 246 IPC_MESSAGE_CONTROL1(ChromotingNetworkDesktopMsg_InjectKeyEvent, | 215 IPC_MESSAGE_CONTROL1(ChromotingNetworkDesktopMsg_InjectKeyEvent, |
| 247 std::string /* serialized_event */ ) | 216 std::string /* serialized_event */ ) |
| 248 | 217 |
| 249 // Carries a mouse event from the client to the desktop session agent. | 218 // Carries a mouse event from the client to the desktop session agent. |
| 250 // |serialized_event| is a serialized protocol::MouseEvent. | 219 // |serialized_event| is a serialized protocol::MouseEvent. |
| 251 IPC_MESSAGE_CONTROL1(ChromotingNetworkDesktopMsg_InjectMouseEvent, | 220 IPC_MESSAGE_CONTROL1(ChromotingNetworkDesktopMsg_InjectMouseEvent, |
| 252 std::string /* serialized_event */ ) | 221 std::string /* serialized_event */ ) |
| 253 | 222 |
| 254 // Changes the screen resolution in the desktop session. | 223 // Changes the screen resolution in the desktop session. |
| 255 IPC_MESSAGE_CONTROL1(ChromotingNetworkDesktopMsg_SetScreenResolution, | 224 IPC_MESSAGE_CONTROL1(ChromotingNetworkDesktopMsg_SetScreenResolution, |
| 256 remoting::ScreenResolution /* resolution */) | 225 remoting::ScreenResolution /* resolution */) |
| OLD | NEW |