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

Side by Side Diff: trunk/src/net/websockets/websocket_basic_handshake_stream.cc

Issue 189793002: Revert 255397 "Fill out the rest of the StringPiece functions fo..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 years, 9 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
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_basic_handshake_stream.h" 5 #include "net/websockets/websocket_basic_handshake_stream.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <iterator> 8 #include <iterator>
9 #include <set> 9 #include <set>
10 #include <string> 10 #include <string>
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
218 "Sent non-empty 'Sec-WebSocket-Protocol' header " 218 "Sent non-empty 'Sec-WebSocket-Protocol' header "
219 "but no response was received"; 219 "but no response was received";
220 return false; 220 return false;
221 } 221 }
222 *sub_protocol = value; 222 *sub_protocol = value;
223 return true; 223 return true;
224 } 224 }
225 225
226 bool DeflateError(std::string* message, const base::StringPiece& piece) { 226 bool DeflateError(std::string* message, const base::StringPiece& piece) {
227 *message = "Error in permessage-deflate: "; 227 *message = "Error in permessage-deflate: ";
228 piece.AppendToString(message); 228 AppendToString(piece, message);
229 return false; 229 return false;
230 } 230 }
231 231
232 bool ValidatePerMessageDeflateExtension(const WebSocketExtension& extension, 232 bool ValidatePerMessageDeflateExtension(const WebSocketExtension& extension,
233 std::string* failure_message, 233 std::string* failure_message,
234 WebSocketExtensionParams* params) { 234 WebSocketExtensionParams* params) {
235 static const char kClientPrefix[] = "client_"; 235 static const char kClientPrefix[] = "client_";
236 static const char kServerPrefix[] = "server_"; 236 static const char kServerPrefix[] = "server_";
237 static const char kNoContextTakeover[] = "no_context_takeover"; 237 static const char kNoContextTakeover[] = "no_context_takeover";
238 static const char kMaxWindowBits[] = "max_window_bits"; 238 static const char kMaxWindowBits[] = "max_window_bits";
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after
610 &extensions_, 610 &extensions_,
611 &failure_message_, 611 &failure_message_,
612 extension_params_.get())) { 612 extension_params_.get())) {
613 return OK; 613 return OK;
614 } 614 }
615 failure_message_ = "Error during WebSocket handshake: " + failure_message_; 615 failure_message_ = "Error during WebSocket handshake: " + failure_message_;
616 return ERR_INVALID_RESPONSE; 616 return ERR_INVALID_RESPONSE;
617 } 617 }
618 618
619 } // namespace net 619 } // namespace net
OLDNEW
« no previous file with comments | « trunk/src/base/strings/string_piece_unittest.cc ('k') | trunk/src/ui/base/resource/data_pack.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698