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

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

Issue 448143008: Move StringToUpperASCII and LowerCaseEqualsASCII to the base namespace (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 std::string* failure_message) { 127 std::string* failure_message) {
128 std::string value; 128 std::string value;
129 GetHeaderResult result = 129 GetHeaderResult result =
130 GetSingleHeaderValue(headers, websockets::kUpgrade, &value); 130 GetSingleHeaderValue(headers, websockets::kUpgrade, &value);
131 if (!ValidateHeaderHasSingleValue(result, 131 if (!ValidateHeaderHasSingleValue(result,
132 websockets::kUpgrade, 132 websockets::kUpgrade,
133 failure_message)) { 133 failure_message)) {
134 return false; 134 return false;
135 } 135 }
136 136
137 if (!LowerCaseEqualsASCII(value, websockets::kWebSocketLowercase)) { 137 if (!base::LowerCaseEqualsASCII(value, websockets::kWebSocketLowercase)) {
138 *failure_message = 138 *failure_message =
139 "'Upgrade' header value is not 'WebSocket': " + value; 139 "'Upgrade' header value is not 'WebSocket': " + value;
140 return false; 140 return false;
141 } 141 }
142 return true; 142 return true;
143 } 143 }
144 144
145 bool ValidateSecWebSocketAccept(const HttpResponseHeaders* headers, 145 bool ValidateSecWebSocketAccept(const HttpResponseHeaders* headers,
146 const std::string& expected, 146 const std::string& expected,
147 std::string* failure_message) { 147 std::string* failure_message) {
(...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after
618 set_failure_message("Error during WebSocket handshake: " + failure_message); 618 set_failure_message("Error during WebSocket handshake: " + failure_message);
619 return ERR_INVALID_RESPONSE; 619 return ERR_INVALID_RESPONSE;
620 } 620 }
621 621
622 void WebSocketBasicHandshakeStream::set_failure_message( 622 void WebSocketBasicHandshakeStream::set_failure_message(
623 const std::string& failure_message) { 623 const std::string& failure_message) {
624 *failure_message_ = failure_message; 624 *failure_message_ = failure_message;
625 } 625 }
626 626
627 } // namespace net 627 } // namespace net
OLDNEW
« no previous file with comments | « net/url_request/url_request_job_manager.cc ('k') | net/websockets/websocket_handshake_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698