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

Side by Side Diff: net/websockets/websocket_channel.cc

Issue 416333004: Revert of [WebSocket] Send a close frame when the renderer process is gone. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « net/data/websocket/websocket_shared_worker.html ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include "net/websockets/websocket_channel.h" 5 #include "net/websockets/websocket_channel.h"
6 6
7 #include <limits.h> // for INT_MAX 7 #include <limits.h> // for INT_MAX
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <deque> 10 #include <deque>
(...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after
458 (state_ == CONNECTED || state_ == SEND_CLOSED || state_ == CLOSE_WAIT); 458 (state_ == CONNECTED || state_ == SEND_CLOSED || state_ == CLOSE_WAIT);
459 current_receive_quota_ += base::checked_cast<int>(quota); 459 current_receive_quota_ += base::checked_cast<int>(quota);
460 if (start_read) 460 if (start_read)
461 AllowUnused(ReadFrames()); 461 AllowUnused(ReadFrames());
462 // |this| may have been deleted. 462 // |this| may have been deleted.
463 } 463 }
464 464
465 void WebSocketChannel::StartClosingHandshake(uint16 code, 465 void WebSocketChannel::StartClosingHandshake(uint16 code,
466 const std::string& reason) { 466 const std::string& reason) {
467 if (InClosingState()) { 467 if (InClosingState()) {
468 // When the associated renderer process is killed while the channel is in
469 // CLOSING state we reach here.
470 DVLOG(1) << "StartClosingHandshake called in state " << state_ 468 DVLOG(1) << "StartClosingHandshake called in state " << state_
471 << ". This may be a bug, or a harmless race."; 469 << ". This may be a bug, or a harmless race.";
472 return; 470 return;
473 } 471 }
474 if (state_ == CONNECTING) { 472 if (state_ == CONNECTING) {
475 // Abort the in-progress handshake and drop the connection immediately. 473 // Abort the in-progress handshake and drop the connection immediately.
476 stream_request_.reset(); 474 stream_request_.reset();
477 SetState(CLOSED); 475 SetState(CLOSED);
478 AllowUnused(DoDropChannel(false, kWebSocketErrorAbnormalClosure, "")); 476 AllowUnused(DoDropChannel(false, kWebSocketErrorAbnormalClosure, ""));
479 return; 477 return;
(...skipping 627 matching lines...) Expand 10 before | Expand all | Expand 10 after
1107 } 1105 }
1108 1106
1109 void WebSocketChannel::CloseTimeout() { 1107 void WebSocketChannel::CloseTimeout() {
1110 stream_->Close(); 1108 stream_->Close();
1111 SetState(CLOSED); 1109 SetState(CLOSED);
1112 AllowUnused(DoDropChannel(false, kWebSocketErrorAbnormalClosure, "")); 1110 AllowUnused(DoDropChannel(false, kWebSocketErrorAbnormalClosure, ""));
1113 // |this| has been deleted. 1111 // |this| has been deleted.
1114 } 1112 }
1115 1113
1116 } // namespace net 1114 } // namespace net
OLDNEW
« no previous file with comments | « net/data/websocket/websocket_shared_worker.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698