OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "chrome/browser/chromeos/web_socket_proxy.h" | 5 #include "chrome/browser/chromeos/web_socket_proxy.h" |
6 | 6 |
7 #include <stdio.h> | 7 #include <stdio.h> |
8 #include <stdlib.h> | 8 #include <stdlib.h> |
9 #include <string.h> | 9 #include <string.h> |
10 | 10 |
(...skipping 1234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1245 return STATUS_ABORT; | 1245 return STATUS_ABORT; |
1246 if (resource_end != buf + strlen(kGetPrefix)) { | 1246 if (resource_end != buf + strlen(kGetPrefix)) { |
1247 char* piece = reinterpret_cast<char*>(buf) + strlen(kGetPrefix) + 1; | 1247 char* piece = reinterpret_cast<char*>(buf) + strlen(kGetPrefix) + 1; |
1248 url_parse::Component query( | 1248 url_parse::Component query( |
1249 0, resource_end - reinterpret_cast<uint8*>(piece)); | 1249 0, resource_end - reinterpret_cast<uint8*>(piece)); |
1250 for (url_parse::Component key, value; | 1250 for (url_parse::Component key, value; |
1251 url_parse::ExtractQueryKeyValue(piece, &query, &key, &value);) { | 1251 url_parse::ExtractQueryKeyValue(piece, &query, &key, &value);) { |
1252 if (key.len > 0) { | 1252 if (key.len > 0) { |
1253 requested_parameters_[std::string(piece + key.begin, key.len)] = | 1253 requested_parameters_[std::string(piece + key.begin, key.len)] = |
1254 net::UnescapeURLComponent(std::string(piece + value.begin, | 1254 net::UnescapeURLComponent(std::string(piece + value.begin, |
1255 value.len), UnescapeRule::URL_SPECIAL_CHARS); | 1255 value.len), net::UnescapeRule::URL_SPECIAL_CHARS); |
1256 } | 1256 } |
1257 } | 1257 } |
1258 } | 1258 } |
1259 for (uint8* pos = get_request_end;;) { | 1259 for (uint8* pos = get_request_end;;) { |
1260 pos += strlen(kCRLF); | 1260 pos += strlen(kCRLF); |
1261 if (term_pos - pos < static_cast<ptrdiff_t>(strlen(kCRLF))) | 1261 if (term_pos - pos < static_cast<ptrdiff_t>(strlen(kCRLF))) |
1262 return STATUS_ABORT; | 1262 return STATUS_ABORT; |
1263 if (term_pos - pos == static_cast<ptrdiff_t>(strlen(kCRLF))) | 1263 if (term_pos - pos == static_cast<ptrdiff_t>(strlen(kCRLF))) |
1264 break; | 1264 break; |
1265 uint8* npos = std::search(pos, term_pos, kKeyValueDelimiter, | 1265 uint8* npos = std::search(pos, term_pos, kKeyValueDelimiter, |
(...skipping 663 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1929 | 1929 |
1930 void WebSocketProxy::Shutdown() { | 1930 void WebSocketProxy::Shutdown() { |
1931 static_cast<Serv*>(impl_)->Shutdown(); | 1931 static_cast<Serv*>(impl_)->Shutdown(); |
1932 } | 1932 } |
1933 | 1933 |
1934 void WebSocketProxy::OnNetworkChange() { | 1934 void WebSocketProxy::OnNetworkChange() { |
1935 static_cast<Serv*>(impl_)->OnNetworkChange(); | 1935 static_cast<Serv*>(impl_)->OnNetworkChange(); |
1936 } | 1936 } |
1937 | 1937 |
1938 } // namespace chromeos | 1938 } // namespace chromeos |
OLD | NEW |