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

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

Issue 1172753003: Move LowerCaseEqualsASCII to base namespace (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@string_util
Patch Set: Created 5 years, 6 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 | « net/url_request/url_request_job_manager.cc ('k') | pdf/document_loader.cc » ('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_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 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 std::string* failure_message) { 135 std::string* failure_message) {
136 std::string value; 136 std::string value;
137 GetHeaderResult result = 137 GetHeaderResult result =
138 GetSingleHeaderValue(headers, websockets::kUpgrade, &value); 138 GetSingleHeaderValue(headers, websockets::kUpgrade, &value);
139 if (!ValidateHeaderHasSingleValue(result, 139 if (!ValidateHeaderHasSingleValue(result,
140 websockets::kUpgrade, 140 websockets::kUpgrade,
141 failure_message)) { 141 failure_message)) {
142 return false; 142 return false;
143 } 143 }
144 144
145 if (!LowerCaseEqualsASCII(value, websockets::kWebSocketLowercase)) { 145 if (!base::LowerCaseEqualsASCII(value, websockets::kWebSocketLowercase)) {
146 *failure_message = 146 *failure_message =
147 "'Upgrade' header value is not 'WebSocket': " + value; 147 "'Upgrade' header value is not 'WebSocket': " + value;
148 return false; 148 return false;
149 } 149 }
150 return true; 150 return true;
151 } 151 }
152 152
153 bool ValidateSecWebSocketAccept(const HttpResponseHeaders* headers, 153 bool ValidateSecWebSocketAccept(const HttpResponseHeaders* headers,
154 const std::string& expected, 154 const std::string& expected,
155 std::string* failure_message) { 155 std::string* failure_message) {
(...skipping 491 matching lines...) Expand 10 before | Expand all | Expand 10 after
647 set_failure_message("Error during WebSocket handshake: " + failure_message); 647 set_failure_message("Error during WebSocket handshake: " + failure_message);
648 return ERR_INVALID_RESPONSE; 648 return ERR_INVALID_RESPONSE;
649 } 649 }
650 650
651 void WebSocketBasicHandshakeStream::set_failure_message( 651 void WebSocketBasicHandshakeStream::set_failure_message(
652 const std::string& failure_message) { 652 const std::string& failure_message) {
653 *failure_message_ = failure_message; 653 *failure_message_ = failure_message;
654 } 654 }
655 655
656 } // namespace net 656 } // namespace net
OLDNEW
« no previous file with comments | « net/url_request/url_request_job_manager.cc ('k') | pdf/document_loader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698