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