| 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 #ifndef CHROME_BROWSER_EXTENSIONS_API_SOCKET_UDP_SOCKET_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_SOCKET_UDP_SOCKET_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_API_SOCKET_UDP_SOCKET_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_API_SOCKET_UDP_SOCKET_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "chrome/browser/extensions/api/socket/socket.h" | 10 #include "chrome/browser/extensions/api/socket/socket.h" |
| 11 #include "net/udp/udp_socket.h" | 11 #include "net/udp/udp_socket.h" |
| 12 | 12 |
| 13 namespace extensions { | 13 namespace extensions { |
| 14 | 14 |
| 15 class ApiResourceEventNotifier; | 15 class ApiResourceEventNotifier; |
| 16 | 16 |
| 17 class UDPSocket : public Socket { | 17 class UDPSocket : public Socket { |
| 18 public: | 18 public: |
| 19 explicit UDPSocket(ApiResourceEventNotifier* event_notifier); | 19 UDPSocket(const std::string& owner_extension_id, |
| 20 ApiResourceEventNotifier* event_notifier); |
| 20 virtual ~UDPSocket(); | 21 virtual ~UDPSocket(); |
| 21 | 22 |
| 22 virtual void Connect(const std::string& address, | 23 virtual void Connect(const std::string& address, |
| 23 int port, | 24 int port, |
| 24 const CompletionCallback& callback) OVERRIDE; | 25 const CompletionCallback& callback) OVERRIDE; |
| 25 virtual void Disconnect() OVERRIDE; | 26 virtual void Disconnect() OVERRIDE; |
| 26 virtual int Bind(const std::string& address, int port) OVERRIDE; | 27 virtual int Bind(const std::string& address, int port) OVERRIDE; |
| 27 virtual void Read(int count, | 28 virtual void Read(int count, |
| 28 const ReadCompletionCallback& callback) OVERRIDE; | 29 const ReadCompletionCallback& callback) OVERRIDE; |
| 29 virtual void RecvFrom(int count, | 30 virtual void RecvFrom(int count, |
| (...skipping 28 matching lines...) Expand all Loading... |
| 58 ReadCompletionCallback read_callback_; | 59 ReadCompletionCallback read_callback_; |
| 59 | 60 |
| 60 RecvFromCompletionCallback recv_from_callback_; | 61 RecvFromCompletionCallback recv_from_callback_; |
| 61 | 62 |
| 62 CompletionCallback send_to_callback_; | 63 CompletionCallback send_to_callback_; |
| 63 }; | 64 }; |
| 64 | 65 |
| 65 } // namespace extensions | 66 } // namespace extensions |
| 66 | 67 |
| 67 #endif // CHROME_BROWSER_EXTENSIONS_API_SOCKET_UDP_SOCKET_H_ | 68 #endif // CHROME_BROWSER_EXTENSIONS_API_SOCKET_UDP_SOCKET_H_ |
| OLD | NEW |