| 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 "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 1252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1263 return STATUS_ABORT; | 1263 return STATUS_ABORT; |
| 1264 } | 1264 } |
| 1265 destport_ = port; | 1265 destport_ = port; |
| 1266 destaddr_ = requested_parameters_["addr"]; | 1266 destaddr_ = requested_parameters_["addr"]; |
| 1267 do_tls_ = (requested_parameters_["tls"] == "true"); | 1267 do_tls_ = (requested_parameters_["tls"] == "true"); |
| 1268 | 1268 |
| 1269 requested_parameters_["extension_id"] = | 1269 requested_parameters_["extension_id"] = |
| 1270 FetchExtensionIdFromOrigin(GetOrigin()); | 1270 FetchExtensionIdFromOrigin(GetOrigin()); |
| 1271 std::string passport(requested_parameters_["passport"]); | 1271 std::string passport(requested_parameters_["passport"]); |
| 1272 requested_parameters_.erase("passport"); | 1272 requested_parameters_.erase("passport"); |
| 1273 if (!browser::InternalAuthVerification::VerifyPassport( | 1273 if (!chrome::InternalAuthVerification::VerifyPassport( |
| 1274 passport, "web_socket_proxy", requested_parameters_)) { | 1274 passport, "web_socket_proxy", requested_parameters_)) { |
| 1275 return STATUS_ABORT; | 1275 return STATUS_ABORT; |
| 1276 } | 1276 } |
| 1277 } | 1277 } |
| 1278 | 1278 |
| 1279 evbuffer_drain(evb, term_pos - buf); | 1279 evbuffer_drain(evb, term_pos - buf); |
| 1280 return STATUS_OK; | 1280 return STATUS_OK; |
| 1281 } | 1281 } |
| 1282 | 1282 |
| 1283 bool Conn::EmitHandshake(Chan* chan) { | 1283 bool Conn::EmitHandshake(Chan* chan) { |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1355 buf, buf + frame_bytes_remaining_, | 1355 buf, buf + frame_bytes_remaining_, |
| 1356 &passport, &destaddr_, &destname_, &destport_)) { | 1356 &passport, &destaddr_, &destname_, &destport_)) { |
| 1357 return STATUS_ABORT; | 1357 return STATUS_ABORT; |
| 1358 } | 1358 } |
| 1359 std::map<std::string, std::string> map; | 1359 std::map<std::string, std::string> map; |
| 1360 map["hostname"] = destname_; | 1360 map["hostname"] = destname_; |
| 1361 map["port"] = base::IntToString(destport_); | 1361 map["port"] = base::IntToString(destport_); |
| 1362 map["extension_id"] = FetchExtensionIdFromOrigin(GetOrigin()); | 1362 map["extension_id"] = FetchExtensionIdFromOrigin(GetOrigin()); |
| 1363 if (!destaddr_.empty()) | 1363 if (!destaddr_.empty()) |
| 1364 map["addr"] = destaddr_; | 1364 map["addr"] = destaddr_; |
| 1365 if (!browser::InternalAuthVerification::VerifyPassport( | 1365 if (!chrome::InternalAuthVerification::VerifyPassport( |
| 1366 passport, "web_socket_proxy", map)) { | 1366 passport, "web_socket_proxy", map)) { |
| 1367 return STATUS_ABORT; | 1367 return STATUS_ABORT; |
| 1368 } | 1368 } |
| 1369 | 1369 |
| 1370 evbuffer_drain(evb, frame_bytes_remaining_); | 1370 evbuffer_drain(evb, frame_bytes_remaining_); |
| 1371 frame_bytes_remaining_ = 0; | 1371 frame_bytes_remaining_ = 0; |
| 1372 return STATUS_OK; | 1372 return STATUS_OK; |
| 1373 } | 1373 } |
| 1374 | 1374 |
| 1375 Conn::Status Conn::ConsumeFrameHeader(struct evbuffer* evb) { | 1375 Conn::Status Conn::ConsumeFrameHeader(struct evbuffer* evb) { |
| (...skipping 525 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1901 | 1901 |
| 1902 void WebSocketProxy::Shutdown() { | 1902 void WebSocketProxy::Shutdown() { |
| 1903 static_cast<Serv*>(impl_)->Shutdown(); | 1903 static_cast<Serv*>(impl_)->Shutdown(); |
| 1904 } | 1904 } |
| 1905 | 1905 |
| 1906 void WebSocketProxy::OnNetworkChange() { | 1906 void WebSocketProxy::OnNetworkChange() { |
| 1907 static_cast<Serv*>(impl_)->OnNetworkChange(); | 1907 static_cast<Serv*>(impl_)->OnNetworkChange(); |
| 1908 } | 1908 } |
| 1909 | 1909 |
| 1910 } // namespace chromeos | 1910 } // namespace chromeos |
| OLD | NEW |