| 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 explicit UDPSocket(ApiResourceEventNotifier* event_notifier); |
| 20 virtual ~UDPSocket(); | 20 virtual ~UDPSocket(); |
| 21 | 21 |
| 22 virtual void Connect(const std::string& address, | 22 virtual void Connect(const std::string& address, |
| 23 int port, | 23 int port, |
| 24 const CompletionCallback& callback) OVERRIDE; | 24 const CompletionCallback& callback) OVERRIDE; |
| 25 virtual void Disconnect() OVERRIDE; | 25 virtual void Disconnect() OVERRIDE; |
| 26 virtual int Bind(const std::string& address, int port) OVERRIDE; | 26 virtual int Bind(const std::string& address, int port) OVERRIDE; |
| 27 virtual void Read(int count, | 27 virtual void Read(int count, |
| 28 const ReadCompletionCallback& callback) OVERRIDE; | 28 const ReadCompletionCallback& callback) OVERRIDE; |
| 29 virtual void RecvFrom(int count, | 29 virtual void RecvFrom(int count, |
| (...skipping 25 matching lines...) Expand all Loading... |
| 55 ReadCompletionCallback read_callback_; | 55 ReadCompletionCallback read_callback_; |
| 56 | 56 |
| 57 RecvFromCompletionCallback recv_from_callback_; | 57 RecvFromCompletionCallback recv_from_callback_; |
| 58 | 58 |
| 59 CompletionCallback send_to_callback_; | 59 CompletionCallback send_to_callback_; |
| 60 }; | 60 }; |
| 61 | 61 |
| 62 } // namespace extensions | 62 } // namespace extensions |
| 63 | 63 |
| 64 #endif // CHROME_BROWSER_EXTENSIONS_API_SOCKET_UDP_SOCKET_H_ | 64 #endif // CHROME_BROWSER_EXTENSIONS_API_SOCKET_UDP_SOCKET_H_ |
| OLD | NEW |