Chromium Code Reviews| Index: chrome/browser/extensions/api/socket/socket_api_controller.cc |
| diff --git a/chrome/browser/extensions/api/socket/socket_api_controller.cc b/chrome/browser/extensions/api/socket/socket_api_controller.cc |
| index 21952973ef560f3f3809fcf7a86e1cbf79b163db..cb68c496a6fff3d3462f591d73e5d03c94a8fea9 100644 |
| --- a/chrome/browser/extensions/api/socket/socket_api_controller.cc |
| +++ b/chrome/browser/extensions/api/socket/socket_api_controller.cc |
| @@ -22,8 +22,8 @@ namespace extensions { |
| // we need to manage it in the context of an extension. |
| class Socket { |
| public: |
| - explicit Socket(const Profile* profile, const std::string& src_extension_id, |
| - const GURL& src_url); |
| + Socket(const Profile* profile, const std::string& src_extension_id, |
| + const GURL& src_url); |
| ~Socket(); |
| bool Connect(const net::IPEndPoint& ip_end_point); |
| @@ -38,7 +38,7 @@ class Socket { |
| std::string src_extension_id_; |
| GURL src_url_; |
| - net::UDPClientSocket* udp_client_socket_; |
| + scoped_ptr<net::UDPClientSocket> udp_client_socket_; |
| bool is_connected_; |
| net::OldCompletionCallbackImpl<Socket> io_callback_; |
| @@ -101,12 +101,9 @@ int Socket::Write(const std::string message) { |
| return bytes_sent; |
| } |
| -SocketController* SocketController::GetInstance() { |
| - return Singleton<SocketController>::get(); |
| +SocketController::SocketController() : next_socket_id_(1) { |
| } |
| -SocketController::SocketController() : next_socket_id_(1) {} |
| - |
| SocketController::~SocketController() { |
| STLDeleteValues(&socket_map_); |
|
Aaron Boodman
2011/12/07 23:16:22
You can use std::map<int, linked_ptr<Socket>>. The
|
| } |