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/extensions/api/web_socket_proxy_private/web_socket_prox
y_private_api.h" | 5 #include "chrome/browser/extensions/api/web_socket_proxy_private/web_socket_prox
y_private_api.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/stl_util.h" | 8 #include "base/stl_util.h" |
9 #include "base/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
10 #include "base/values.h" | 10 #include "base/values.h" |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 return; | 88 return; |
89 } | 89 } |
90 } | 90 } |
91 NOTREACHED(); | 91 NOTREACHED(); |
92 OnHostResolution(net::ERR_UNEXPECTED); | 92 OnHostResolution(net::ERR_UNEXPECTED); |
93 #endif | 93 #endif |
94 } | 94 } |
95 | 95 |
96 bool WebSocketProxyPrivate::RunImpl() { | 96 bool WebSocketProxyPrivate::RunImpl() { |
97 AddRef(); | 97 AddRef(); |
98 SetResult(Value::CreateStringValue("")); | 98 SetResult(Value::CreateStringValue(std::string())); |
99 | 99 |
100 #if defined(OS_CHROMEOS) | 100 #if defined(OS_CHROMEOS) |
101 bool delay_response = false; | 101 bool delay_response = false; |
102 | 102 |
103 EXTENSION_FUNCTION_VALIDATE(args_->GetString(0, &hostname_)); | 103 EXTENSION_FUNCTION_VALIDATE(args_->GetString(0, &hostname_)); |
104 EXTENSION_FUNCTION_VALIDATE(args_->GetInteger(1, &port_)); | 104 EXTENSION_FUNCTION_VALIDATE(args_->GetInteger(1, &port_)); |
105 | 105 |
106 listening_port_ = chromeos::WebSocketProxyController::GetPort(); | 106 listening_port_ = chromeos::WebSocketProxyController::GetPort(); |
107 if (listening_port_ < 1) { | 107 if (listening_port_ < 1) { |
108 delay_response = true; | 108 delay_response = true; |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 #if defined(OS_CHROMEOS) | 199 #if defined(OS_CHROMEOS) |
200 std::string passport = chrome::InternalAuthGeneration::GeneratePassport( | 200 std::string passport = chrome::InternalAuthGeneration::GeneratePassport( |
201 "web_socket_proxy", map_) + std::string(":"); | 201 "web_socket_proxy", map_) + std::string(":"); |
202 if (ContainsKey(map_, "addr")) | 202 if (ContainsKey(map_, "addr")) |
203 passport += map_["addr"]; | 203 passport += map_["addr"]; |
204 SetResult(Value::CreateStringValue(passport)); | 204 SetResult(Value::CreateStringValue(passport)); |
205 #endif | 205 #endif |
206 } | 206 } |
207 | 207 |
208 } // namespace extensions | 208 } // namespace extensions |
OLD | NEW |