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

Issue 1108002: Implement new websocket handshake based on draft-hixie-thewebsocketprotocol-76 (Closed)

Created:
10 years, 9 months ago by ukai
Modified:
6 years, 4 months ago
CC:
chromium-reviews, jam, Paweł Hajdan Jr., darin-cc_chromium.org, ben+cc_chromium.org
Visibility:
Public.

Description

Implement new websocket handshake based on draft-hixie-thewebsocketprotocol-76 BUG=none TEST=net_unittests passes Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=42736

Patch Set 1 #

Patch Set 2 : Fix off-by-one error #

Total comments: 28

Patch Set 3 : fix for tyoshino's comments #

Patch Set 4 : fix compile errors #

Patch Set 5 : Fix for tyoshino's comment #

Total comments: 6

Patch Set 6 : fix for yutak's comments #

Total comments: 3

Patch Set 7 : fix for review comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+904 lines, -216 lines) Patch
M chrome/browser/net/websocket_experiment/websocket_experiment_task.cc View 1 chunk +1 line, -0 lines 0 comments Download
M net/net.gyp View 1 2 3 4 5 6 2 chunks +3 lines, -0 lines 0 comments Download
M net/websockets/websocket.h View 3 chunks +8 lines, -0 lines 0 comments Download
M net/websockets/websocket.cc View 2 chunks +15 lines, -3 lines 0 comments Download
M net/websockets/websocket_handshake.h View 1 2 3 4 4 chunks +58 lines, -21 lines 0 comments Download
M net/websockets/websocket_handshake.cc View 1 2 3 4 5 6 7 chunks +206 lines, -112 lines 0 comments Download
A net/websockets/websocket_handshake_draft75.h View 1 2 1 chunk +63 lines, -0 lines 0 comments Download
A net/websockets/websocket_handshake_draft75.cc View 1 1 chunk +156 lines, -0 lines 0 comments Download
A net/websockets/websocket_handshake_draft75_unittest.cc View 1 chunk +217 lines, -0 lines 0 comments Download
M net/websockets/websocket_handshake_unittest.cc View 1 2 3 4 5 6 5 chunks +173 lines, -80 lines 0 comments Download
M net/websockets/websocket_unittest.cc View 4 chunks +4 lines, -0 lines 0 comments Download

Messages

Total messages: 10 (0 generated)
ukai
This implementation will be used for live experiment and/or unit tests before submitting to webkit.
10 years, 9 months ago (2010-03-18 09:49:35 UTC) #1
tyoshino (SeeGerritForStatus)
http://codereview.chromium.org/1108002/diff/3001/4006 File net/websockets/websocket_handshake.h (right): http://codereview.chromium.org/1108002/diff/3001/4006#newcode86 net/websockets/websocket_handshake.h:86: void GetExpectedResponse(uint8 *expected) const; stick * to left. http://codereview.chromium.org/1108002/diff/3001/4006#newcode105 ...
10 years, 9 months ago (2010-03-25 04:51:04 UTC) #2
tyoshino (SeeGerritForStatus)
http://codereview.chromium.org/1108002/diff/3001/4005 File net/websockets/websocket_handshake.cc (right): http://codereview.chromium.org/1108002/diff/3001/4005#newcode216 net/websockets/websocket_handshake.cc:216: uint32 result = min + static_cast<int>(number % range); don't ...
10 years, 9 months ago (2010-03-25 07:02:20 UTC) #3
tyoshino (SeeGerritForStatus)
http://codereview.chromium.org/1108002/diff/3001/4010 File net/websockets/websocket_handshake_unittest.cc (right): http://codereview.chromium.org/1108002/diff/3001/4010#newcode44 net/websockets/websocket_handshake_unittest.cc:44: break; > expected_lines[expected_lines.size() - 1] is also ""? Sorry, ...
10 years, 9 months ago (2010-03-25 07:19:28 UTC) #4
ukai
http://codereview.chromium.org/1108002/diff/3001/4005 File net/websockets/websocket_handshake.cc (right): http://codereview.chromium.org/1108002/diff/3001/4005#newcode216 net/websockets/websocket_handshake.cc:216: uint32 result = min + static_cast<int>(number % range); On ...
10 years, 9 months ago (2010-03-25 07:22:12 UTC) #5
tyoshino (SeeGerritForStatus)
10 years, 9 months ago (2010-03-25 07:35:24 UTC) #6
Yuta Kitamura
LGTM if the following issues are addressed. http://codereview.chromium.org/1108002/diff/15001/16005 File net/websockets/websocket_handshake.cc (right): http://codereview.chromium.org/1108002/diff/15001/16005#newcode71 net/websockets/websocket_handshake.cc:71: random_shuffle(fields.begin(), fields.end()); ...
10 years, 9 months ago (2010-03-25 08:21:37 UTC) #7
ukai
http://codereview.chromium.org/1108002/diff/15001/16005 File net/websockets/websocket_handshake.cc (right): http://codereview.chromium.org/1108002/diff/15001/16005#newcode71 net/websockets/websocket_handshake.cc:71: random_shuffle(fields.begin(), fields.end()); On 2010/03/25 08:21:37, Yuta Kitamura wrote: > ...
10 years, 9 months ago (2010-03-25 10:33:35 UTC) #8
Yuta Kitamura
LGTM http://codereview.chromium.org/1108002/diff/23001/9006 File net/websockets/websocket_handshake.cc (left): http://codereview.chromium.org/1108002/diff/23001/9006#oldcode163 net/websockets/websocket_handshake.cc:163: // Returns false otherwise. It's nice to keep ...
10 years, 9 months ago (2010-03-26 02:28:09 UTC) #9
tyoshino (SeeGerritForStatus)
10 years, 9 months ago (2010-03-26 02:53:59 UTC) #10
LGTM

http://codereview.chromium.org/1108002/diff/3001/4005
File net/websockets/websocket_handshake.cc (right):

http://codereview.chromium.org/1108002/diff/3001/4005#newcode216
net/websockets/websocket_handshake.cc:216: uint32 result = min +
static_cast<int>(number % range);
On 2010/03/25 07:22:25, ukai wrote:
> On 2010/03/25 07:02:20, tyoshino wrote:
> > don't we need to make this uniform?
> 
> unsigned?

I meant that the distribution of the result of modulo operation will be biased.
But OK. RandUint64 is using rand(3). Please add some note to revisit here for
checking if there's any security concern on this process.

http://codereview.chromium.org/1108002/diff/23001/9006#newcode279
net/websockets/websocket_handshake.cc:279: for (uint32 i = 0; i < space; i++) {
Good. But why 11 digits?

Powered by Google App Engine
This is Rietveld 408576698