OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 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 CONTENT_COMMON_WEBSOCKET_H_ | 5 #ifndef CONTENT_COMMON_WEBSOCKET_H_ |
6 #define CONTENT_COMMON_WEBSOCKET_H_ | 6 #define CONTENT_COMMON_WEBSOCKET_H_ |
7 | 7 |
| 8 #include <stdint.h> |
8 #include <string> | 9 #include <string> |
9 #include <utility> | 10 #include <utility> |
10 #include <vector> | 11 #include <vector> |
11 | 12 |
12 #include "base/strings/string_split.h" | 13 #include "base/strings/string_split.h" |
13 #include "base/time/time.h" | 14 #include "base/time/time.h" |
14 #include "url/gurl.h" | 15 #include "url/gurl.h" |
15 | 16 |
16 namespace content { | 17 namespace content { |
17 | 18 |
18 // WebSocket data message types sent between the browser and renderer processes. | 19 // WebSocket data message types sent between the browser and renderer processes. |
19 enum WebSocketMessageType { | 20 enum WebSocketMessageType { |
20 WEB_SOCKET_MESSAGE_TYPE_CONTINUATION = 0x0, | 21 WEB_SOCKET_MESSAGE_TYPE_CONTINUATION = 0x0, |
21 WEB_SOCKET_MESSAGE_TYPE_TEXT = 0x1, | 22 WEB_SOCKET_MESSAGE_TYPE_TEXT = 0x1, |
22 WEB_SOCKET_MESSAGE_TYPE_BINARY = 0x2, | 23 WEB_SOCKET_MESSAGE_TYPE_BINARY = 0x2, |
23 WEB_SOCKET_MESSAGE_TYPE_LAST = WEB_SOCKET_MESSAGE_TYPE_BINARY | 24 WEB_SOCKET_MESSAGE_TYPE_LAST = WEB_SOCKET_MESSAGE_TYPE_BINARY |
24 }; | 25 }; |
25 | 26 |
| 27 // WebSocket binary message types. |
| 28 enum class WebSocketBinaryType : uint8_t { |
| 29 BLOB = 0x0, |
| 30 ARRAY_BUFFER = 0x1, |
| 31 LAST = ARRAY_BUFFER |
| 32 }; |
| 33 |
26 // Opening handshake request information which will be shown in the inspector. | 34 // Opening handshake request information which will be shown in the inspector. |
27 // All string data should be encoded to ASCII in the browser process. | 35 // All string data should be encoded to ASCII in the browser process. |
28 struct WebSocketHandshakeRequest { | 36 struct WebSocketHandshakeRequest { |
29 WebSocketHandshakeRequest(); | 37 WebSocketHandshakeRequest(); |
30 ~WebSocketHandshakeRequest(); | 38 ~WebSocketHandshakeRequest(); |
31 | 39 |
32 // The request URL | 40 // The request URL |
33 GURL url; | 41 GURL url; |
34 // Additional HTTP request headers | 42 // Additional HTTP request headers |
35 base::StringPairs headers; | 43 base::StringPairs headers; |
(...skipping 19 matching lines...) Expand all Loading... |
55 base::StringPairs headers; | 63 base::StringPairs headers; |
56 // HTTP response headers raw string | 64 // HTTP response headers raw string |
57 std::string headers_text; | 65 std::string headers_text; |
58 // The time that this response arrives | 66 // The time that this response arrives |
59 base::Time response_time; | 67 base::Time response_time; |
60 }; | 68 }; |
61 | 69 |
62 } // namespace content | 70 } // namespace content |
63 | 71 |
64 #endif // CONTENT_COMMON_WEBSOCKET_H_ | 72 #endif // CONTENT_COMMON_WEBSOCKET_H_ |
OLD | NEW |