Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(449)

Unified Diff: net/websockets/websocket_frame.cc

Issue 1404673003: net/websockets: Use the (U)INTx_{MIN,MAX} macros from stdint.h (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | net/websockets/websocket_frame_parser.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/websockets/websocket_frame.cc
diff --git a/net/websockets/websocket_frame.cc b/net/websockets/websocket_frame.cc
index 51313f9c0f904b7cf519dbb0b43f298e7b6cfc70..94d1389661a61f051fdf22b262b391074a1680a5 100644
--- a/net/websockets/websocket_frame.cc
+++ b/net/websockets/websocket_frame.cc
@@ -5,11 +5,8 @@
#include "net/websockets/websocket_frame.h"
#include <stddef.h>
-#include <stdint.h>
wtc 2015/10/13 23:31:35 IMPORTANT: did you intend to remove <stdint.h> her
tfarina 2015/10/13 23:35:53 Yes, it is in the header file already.
-
#include <algorithm>
-#include "base/basictypes.h"
#include "base/big_endian.h"
#include "base/logging.h"
#include "base/rand_util.h"
@@ -87,9 +84,9 @@ WebSocketFrameChunk::~WebSocketFrameChunk() {}
int GetWebSocketFrameHeaderSize(const WebSocketFrameHeader& header) {
int extended_length_size = 0;
if (header.payload_length > kMaxPayloadLengthWithoutExtendedLengthField &&
- header.payload_length <= kuint16max) {
+ header.payload_length <= UINT16_MAX) {
extended_length_size = 2;
- } else if (header.payload_length > kuint16max) {
+ } else if (header.payload_length > UINT16_MAX) {
extended_length_size = 8;
}
@@ -103,9 +100,9 @@ int WriteWebSocketFrameHeader(const WebSocketFrameHeader& header,
int buffer_size) {
DCHECK((header.opcode & kOpCodeMask) == header.opcode)
<< "header.opcode must fit to kOpCodeMask.";
- DCHECK(header.payload_length <= static_cast<uint64_t>(kint64max))
+ DCHECK(header.payload_length <= static_cast<uint64_t>(INT64_MAX))
<< "WebSocket specification doesn't allow a frame longer than "
- << "kint64max (0x7FFFFFFFFFFFFFFF) bytes.";
+ << "INT64_MAX (0x7FFFFFFFFFFFFFFF) bytes.";
DCHECK_GE(buffer_size, 0);
// WebSocket frame format is as follows:
@@ -137,7 +134,7 @@ int WriteWebSocketFrameHeader(const WebSocketFrameHeader& header,
second_byte |= header.masked ? kMaskBit : 0u;
if (header.payload_length <= kMaxPayloadLengthWithoutExtendedLengthField) {
second_byte |= header.payload_length;
- } else if (header.payload_length <= kuint16max) {
+ } else if (header.payload_length <= UINT16_MAX) {
second_byte |= kPayloadLengthWithTwoByteExtendedLengthField;
extended_length_size = 2;
} else {
« no previous file with comments | « no previous file | net/websockets/websocket_frame_parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698