1 // Copyright 2013 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.
5 #ifndef CONTENT_COMMON_WEBSOCKET_H_
6 #define CONTENT_COMMON_WEBSOCKET_H_
12 #include "base/time/time.h"
17 // WebSocket data message types sent between the browser and renderer processes.
18 enum WebSocketMessageType
{
19 WEB_SOCKET_MESSAGE_TYPE_CONTINUATION
= 0x0,
20 WEB_SOCKET_MESSAGE_TYPE_TEXT
= 0x1,
21 WEB_SOCKET_MESSAGE_TYPE_BINARY
= 0x2,
22 WEB_SOCKET_MESSAGE_TYPE_LAST
= WEB_SOCKET_MESSAGE_TYPE_BINARY
25 // Opening handshake request information which will be shown in the inspector.
26 // All string data should be encoded to ASCII in the browser process.
27 struct WebSocketHandshakeRequest
{
28 WebSocketHandshakeRequest();
29 ~WebSocketHandshakeRequest();
33 // Additional HTTP request headers
34 std::vector
<std::pair
<std::string
, std::string
> > headers
;
35 // HTTP request headers raw string
36 std::string headers_text
;
37 // The time that this request is sent
38 base::Time request_time
;
41 // Opening handshake response information which will be shown in the inspector.
42 // All string data should be encoded to ASCII in the browser process.
43 struct WebSocketHandshakeResponse
{
44 WebSocketHandshakeResponse();
45 ~WebSocketHandshakeResponse();
52 std::string status_text
;
53 // Additional HTTP response headers
54 std::vector
<std::pair
<std::string
, std::string
> > headers
;
55 // HTTP response headers raw string
56 std::string headers_text
;
57 // The time that this response arrives
58 base::Time response_time
;
61 } // namespace content
63 #endif // CONTENT_COMMON_WEBSOCKET_H_