Re-land "Add a media constraint to enable beamforming" (patchset #4 id:60001 of https...
[chromium-blink-merge.git] / content / common / websocket.h
blobe79fc988c058a5f9648fdd9a81b4add6095280d6
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_
8 #include <string>
9 #include <utility>
10 #include <vector>
12 #include "base/strings/string_split.h"
13 #include "base/time/time.h"
14 #include "url/gurl.h"
16 namespace content {
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();
32 // The request URL
33 GURL url;
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();
48 // The request URL
49 GURL url;
50 // HTTP status code
51 int status_code;
52 // HTTP status text
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_