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

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

Issue 1664743002: [OBSOLETE][DO NOT SUBMIT][DO NOT COMMIT]] Browser-side implementation of WebSocket Blob receive. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@websocket_blob_send_sender
Patch Set: Now actually works. Created 4 years, 10 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
« no previous file with comments | « content/content_tests.gypi ('k') | net/websockets/websocket_event_interface.h » ('j') | 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 <stddef.h> 7 #include <stddef.h>
8 #include <limits.h> // for INT_MAX 8 #include <limits.h> // for INT_MAX
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 1111 matching lines...) Expand 10 before | Expand all | Expand 10 after
1122 1122
1123 *code = kWebSocketErrorProtocolError; 1123 *code = kWebSocketErrorProtocolError;
1124 *reason = "Invalid UTF-8 in Close frame"; 1124 *reason = "Invalid UTF-8 in Close frame";
1125 *message = "Received a broken close frame containing invalid UTF-8."; 1125 *message = "Received a broken close frame containing invalid UTF-8.";
1126 return false; 1126 return false;
1127 } 1127 }
1128 1128
1129 ChannelState WebSocketChannel::DoDropChannel(bool was_clean, 1129 ChannelState WebSocketChannel::DoDropChannel(bool was_clean,
1130 uint16_t code, 1130 uint16_t code,
1131 const std::string& reason) { 1131 const std::string& reason) {
1132 close_timer_.Stop();
1132 if (CHANNEL_DELETED == 1133 if (CHANNEL_DELETED ==
1133 notification_sender_->SendImmediately(event_interface_.get())) 1134 notification_sender_->SendImmediately(event_interface_.get()))
1134 return CHANNEL_DELETED; 1135 return CHANNEL_DELETED;
1135 ChannelState result = 1136 ChannelState result =
1136 event_interface_->OnDropChannel(was_clean, code, reason); 1137 event_interface_->OnDropChannel(was_clean, code, reason);
1137 DCHECK_EQ(CHANNEL_DELETED, result);
1138 return result; 1138 return result;
1139 } 1139 }
1140 1140
1141 void WebSocketChannel::CloseTimeout() { 1141 void WebSocketChannel::CloseTimeout() {
1142 stream_->Close(); 1142 stream_->Close();
1143 SetState(CLOSED); 1143 SetState(CLOSED);
1144 DoDropChannel(false, kWebSocketErrorAbnormalClosure, ""); 1144 DoDropChannel(false, kWebSocketErrorAbnormalClosure, "");
1145 // |this| has been deleted. 1145 // |this| has been deleted.
1146 } 1146 }
1147 1147
1148 } // namespace net 1148 } // namespace net
OLDNEW
« no previous file with comments | « content/content_tests.gypi ('k') | net/websockets/websocket_event_interface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698