| 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 NET_WEBSOCKETS_WEBSOCKET_FRAME_PARSER_H_ | 5 #ifndef NET_WEBSOCKETS_WEBSOCKET_FRAME_PARSER_H_ |
| 6 #define NET_WEBSOCKETS_WEBSOCKET_FRAME_PARSER_H_ | 6 #define NET_WEBSOCKETS_WEBSOCKET_FRAME_PARSER_H_ |
| 7 | 7 |
| 8 #include <stdint.h> |
| 8 #include <vector> | 9 #include <vector> |
| 9 | 10 |
| 10 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 11 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
| 12 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
| 13 #include "base/memory/scoped_vector.h" | 14 #include "base/memory/scoped_vector.h" |
| 14 #include "net/base/net_export.h" | 15 #include "net/base/net_export.h" |
| 15 #include "net/websockets/websocket_errors.h" | 16 #include "net/websockets/websocket_errors.h" |
| 16 #include "net/websockets/websocket_frame.h" | 17 #include "net/websockets/websocket_frame.h" |
| 17 | 18 |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 | 69 |
| 69 // Position in |buffer_| where the next round of parsing starts. | 70 // Position in |buffer_| where the next round of parsing starts. |
| 70 size_t current_read_pos_; | 71 size_t current_read_pos_; |
| 71 | 72 |
| 72 // Frame header and masking key of the current frame. | 73 // Frame header and masking key of the current frame. |
| 73 // |masking_key_| is filled with zeros if the current frame is not masked. | 74 // |masking_key_| is filled with zeros if the current frame is not masked. |
| 74 scoped_ptr<WebSocketFrameHeader> current_frame_header_; | 75 scoped_ptr<WebSocketFrameHeader> current_frame_header_; |
| 75 WebSocketMaskingKey masking_key_; | 76 WebSocketMaskingKey masking_key_; |
| 76 | 77 |
| 77 // Amount of payload data read so far for the current frame. | 78 // Amount of payload data read so far for the current frame. |
| 78 uint64 frame_offset_; | 79 uint64_t frame_offset_; |
| 79 | 80 |
| 80 WebSocketError websocket_error_; | 81 WebSocketError websocket_error_; |
| 81 | 82 |
| 82 DISALLOW_COPY_AND_ASSIGN(WebSocketFrameParser); | 83 DISALLOW_COPY_AND_ASSIGN(WebSocketFrameParser); |
| 83 }; | 84 }; |
| 84 | 85 |
| 85 } // namespace net | 86 } // namespace net |
| 86 | 87 |
| 87 #endif // NET_WEBSOCKETS_WEBSOCKET_FRAME_PARSER_H_ | 88 #endif // NET_WEBSOCKETS_WEBSOCKET_FRAME_PARSER_H_ |
| OLD | NEW |