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

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

Issue 6085013: Start reordering the methods in headers in net/. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 11 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 (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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_handshake_handler.h" 5 #include "net/websockets/websocket_handshake_handler.h"
6 6
7 #include "base/md5.h" 7 #include "base/md5.h"
8 #include "base/string_piece.h" 8 #include "base/string_piece.h"
9 #include "base/string_util.h" 9 #include "base/string_util.h"
10 #include "googleurl/src/gurl.h" 10 #include "googleurl/src/gurl.h"
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after
277 277
278 size_t WebSocketHandshakeRequestHandler::raw_length() const { 278 size_t WebSocketHandshakeRequestHandler::raw_length() const {
279 DCHECK_GT(raw_length_, 0); 279 DCHECK_GT(raw_length_, 0);
280 return raw_length_; 280 return raw_length_;
281 } 281 }
282 282
283 WebSocketHandshakeResponseHandler::WebSocketHandshakeResponseHandler() 283 WebSocketHandshakeResponseHandler::WebSocketHandshakeResponseHandler()
284 : original_header_length_(0) { 284 : original_header_length_(0) {
285 } 285 }
286 286
287 WebSocketHandshakeResponseHandler::~WebSocketHandshakeResponseHandler() {}
288
287 size_t WebSocketHandshakeResponseHandler::ParseRawResponse( 289 size_t WebSocketHandshakeResponseHandler::ParseRawResponse(
288 const char* data, int length) { 290 const char* data, int length) {
289 DCHECK_GT(length, 0); 291 DCHECK_GT(length, 0);
290 if (HasResponse()) { 292 if (HasResponse()) {
291 DCHECK(status_line_.size() > 0); 293 DCHECK(status_line_.size() > 0);
292 DCHECK(headers_.size() > 0); 294 DCHECK(headers_.size() > 0);
293 DCHECK_EQ(kResponseKeySize, key_.size()); 295 DCHECK_EQ(kResponseKeySize, key_.size());
294 return 0; 296 return 0;
295 } 297 }
296 298
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
422 std::string WebSocketHandshakeResponseHandler::GetResponse() { 424 std::string WebSocketHandshakeResponseHandler::GetResponse() {
423 DCHECK(HasResponse()); 425 DCHECK(HasResponse());
424 DCHECK(status_line_.size() > 0); 426 DCHECK(status_line_.size() > 0);
425 // headers_ might be empty for wrong response from server. 427 // headers_ might be empty for wrong response from server.
426 DCHECK_EQ(kResponseKeySize, key_.size()); 428 DCHECK_EQ(kResponseKeySize, key_.size());
427 429
428 return status_line_ + headers_ + header_separator_ + key_; 430 return status_line_ + headers_ + header_separator_ + key_;
429 } 431 }
430 432
431 } // namespace net 433 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698