| 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/extensions/extension_web_socket_proxy_private_api.h" | 5 #include "chrome/browser/extensions/extension_web_socket_proxy_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/string_number_conversions.h" | 9 #include "base/string_number_conversions.h" |
| 10 #include "base/values.h" | 10 #include "base/values.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 #if defined(OS_CHROMEOS) | 25 #if defined(OS_CHROMEOS) |
| 26 #include "chrome/browser/chromeos/web_socket_proxy_controller.h" | 26 #include "chrome/browser/chromeos/web_socket_proxy_controller.h" |
| 27 #endif | 27 #endif |
| 28 | 28 |
| 29 namespace { | 29 namespace { |
| 30 const char kPermissionDeniedError[] = | 30 const char kPermissionDeniedError[] = |
| 31 "Extension does not have permission to use this method."; | 31 "Extension does not have permission to use this method."; |
| 32 } | 32 } |
| 33 | 33 |
| 34 WebSocketProxyPrivate::WebSocketProxyPrivate() | 34 WebSocketProxyPrivate::WebSocketProxyPrivate() |
| 35 : listening_port_(-1), do_tls_(false), is_finalized_(false){ | 35 : port_(-1), |
| 36 listening_port_(-1), |
| 37 do_tls_(false), |
| 38 is_finalized_(false) { |
| 36 } | 39 } |
| 37 | 40 |
| 38 WebSocketProxyPrivate::~WebSocketProxyPrivate() { | 41 WebSocketProxyPrivate::~WebSocketProxyPrivate() { |
| 39 } | 42 } |
| 40 | 43 |
| 41 void WebSocketProxyPrivate::Finalize() { | 44 void WebSocketProxyPrivate::Finalize() { |
| 42 CustomFinalize(); | 45 CustomFinalize(); |
| 43 | 46 |
| 44 if (is_finalized_) | 47 if (is_finalized_) |
| 45 return; | 48 return; |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 void WebSocketProxyPrivateGetPassportForTCPFunction::CustomFinalize() { | 209 void WebSocketProxyPrivateGetPassportForTCPFunction::CustomFinalize() { |
| 207 #if defined(OS_CHROMEOS) | 210 #if defined(OS_CHROMEOS) |
| 208 std::string passport = | 211 std::string passport = |
| 209 browser::InternalAuthGeneration::GeneratePassport( | 212 browser::InternalAuthGeneration::GeneratePassport( |
| 210 "web_socket_proxy", map_) + std::string(":"); | 213 "web_socket_proxy", map_) + std::string(":"); |
| 211 if (ContainsKey(map_, "addr")) | 214 if (ContainsKey(map_, "addr")) |
| 212 passport += map_["addr"]; | 215 passport += map_["addr"]; |
| 213 result_.reset(Value::CreateStringValue(passport)); | 216 result_.reset(Value::CreateStringValue(passport)); |
| 214 #endif | 217 #endif |
| 215 } | 218 } |
| OLD | NEW |