| 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 #ifndef WEBKIT_GLUE_P2P_TRANSPORT_H_ | 5 #ifndef WEBKIT_GLUE_P2P_TRANSPORT_H_ |
| 6 #define WEBKIT_GLUE_P2P_TRANSPORT_H_ | 6 #define WEBKIT_GLUE_P2P_TRANSPORT_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 12 #include "webkit/glue/webkit_glue_export.h" |
| 12 | 13 |
| 13 namespace net { | 14 namespace net { |
| 14 class Socket; | 15 class Socket; |
| 15 } // namespace net | 16 } // namespace net |
| 16 | 17 |
| 17 namespace WebKit { | 18 namespace WebKit { |
| 18 class WebFrame; | 19 class WebFrame; |
| 19 } // namespace WebKit | 20 } // namespace WebKit |
| 20 | 21 |
| 21 namespace webkit_glue { | 22 namespace webkit_glue { |
| (...skipping 21 matching lines...) Expand all Loading... |
| 43 | 44 |
| 44 // Called when readable of writable state of the stream changes. | 45 // Called when readable of writable state of the stream changes. |
| 45 virtual void OnStateChange(State state) = 0; | 46 virtual void OnStateChange(State state) = 0; |
| 46 | 47 |
| 47 // Called when an error occures (e.g. TCP handshake | 48 // Called when an error occures (e.g. TCP handshake |
| 48 // failed). P2PTransport object is not usable after that and | 49 // failed). P2PTransport object is not usable after that and |
| 49 // should be destroyed. | 50 // should be destroyed. |
| 50 virtual void OnError(int error) = 0; | 51 virtual void OnError(int error) = 0; |
| 51 }; | 52 }; |
| 52 | 53 |
| 53 struct Config { | 54 struct WEBKIT_GLUE_EXPORT Config { |
| 54 Config(); | 55 Config(); |
| 55 ~Config(); | 56 ~Config(); |
| 56 | 57 |
| 57 // STUN server address and port. | 58 // STUN server address and port. |
| 58 std::string stun_server; | 59 std::string stun_server; |
| 59 int stun_server_port; | 60 int stun_server_port; |
| 60 | 61 |
| 61 // Relay server address and port. | 62 // Relay server address and port. |
| 62 std::string relay_server; | 63 std::string relay_server; |
| 63 int relay_server_port; | 64 int relay_server_port; |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 | 104 |
| 104 // Returns socket interface that can be used to send/receive | 105 // Returns socket interface that can be used to send/receive |
| 105 // data. Returned object is owned by the transport. Pending calls on | 106 // data. Returned object is owned by the transport. Pending calls on |
| 106 // the socket are canceled when the transport is destroyed. | 107 // the socket are canceled when the transport is destroyed. |
| 107 virtual net::Socket* GetChannel() = 0; | 108 virtual net::Socket* GetChannel() = 0; |
| 108 }; | 109 }; |
| 109 | 110 |
| 110 } // namespace webkit_glue | 111 } // namespace webkit_glue |
| 111 | 112 |
| 112 #endif // WEBKIT_GLUE_P2P_TRANSPORT_H_ | 113 #endif // WEBKIT_GLUE_P2P_TRANSPORT_H_ |
| OLD | NEW |