| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/base64.h" | 7 #include "base/base64.h" |
| 8 #include "base/md5.h" | 8 #include "base/md5.h" |
| 9 #include "base/sha1.h" | 9 #include "base/sha1.h" |
| 10 #include "base/string_number_conversions.h" | 10 #include "base/string_number_conversions.h" |
| 11 #include "base/string_piece.h" | |
| 12 #include "base/string_util.h" | 11 #include "base/string_util.h" |
| 13 #include "base/stringprintf.h" | 12 #include "base/stringprintf.h" |
| 13 #include "base/strings/string_piece.h" |
| 14 #include "base/strings/string_tokenizer.h" | 14 #include "base/strings/string_tokenizer.h" |
| 15 #include "googleurl/src/gurl.h" | 15 #include "googleurl/src/gurl.h" |
| 16 #include "net/http/http_response_headers.h" | 16 #include "net/http/http_response_headers.h" |
| 17 #include "net/http/http_util.h" | 17 #include "net/http/http_util.h" |
| 18 | 18 |
| 19 namespace { | 19 namespace { |
| 20 | 20 |
| 21 const size_t kRequestKey3Size = 8U; | 21 const size_t kRequestKey3Size = 8U; |
| 22 const size_t kResponseKeySize = 16U; | 22 const size_t kResponseKeySize = 16U; |
| 23 | 23 |
| (...skipping 533 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 557 return status_line_ + headers_ + header_separator_ + key_; | 557 return status_line_ + headers_ + header_separator_ + key_; |
| 558 } | 558 } |
| 559 | 559 |
| 560 size_t WebSocketHandshakeResponseHandler::GetResponseKeySize() const { | 560 size_t WebSocketHandshakeResponseHandler::GetResponseKeySize() const { |
| 561 if (protocol_version_ >= kMinVersionOfHybiNewHandshake) | 561 if (protocol_version_ >= kMinVersionOfHybiNewHandshake) |
| 562 return 0; | 562 return 0; |
| 563 return kResponseKeySize; | 563 return kResponseKeySize; |
| 564 } | 564 } |
| 565 | 565 |
| 566 } // namespace net | 566 } // namespace net |
| OLD | NEW |