diff options
author | sergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-15 22:16:02 +0000 |
---|---|---|
committer | sergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-15 22:16:02 +0000 |
commit | 6d3ad505c8e8173e98045d845a910f77fab9ffcf (patch) | |
tree | e996bba53b108dabdcb9b0af89eab2e4664a0bf5 /ppapi | |
parent | b0f146ff51b2b37a2e3549c875fb42365ded7a21 (diff) | |
download | chromium_src-6d3ad505c8e8173e98045d845a910f77fab9ffcf.zip chromium_src-6d3ad505c8e8173e98045d845a910f77fab9ffcf.tar.gz chromium_src-6d3ad505c8e8173e98045d845a910f77fab9ffcf.tar.bz2 |
Relay server support for P2P Transport API.
BUG=41776
TEST=None
Review URL: http://codereview.chromium.org/7791008
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@101396 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi')
-rw-r--r-- | ppapi/c/dev/ppb_transport_dev.h | 29 | ||||
-rw-r--r-- | ppapi/tests/test_transport.cc | 8 |
2 files changed, 28 insertions, 9 deletions
diff --git a/ppapi/c/dev/ppb_transport_dev.h b/ppapi/c/dev/ppb_transport_dev.h index f34b3bf..159b784 100644 --- a/ppapi/c/dev/ppb_transport_dev.h +++ b/ppapi/c/dev/ppb_transport_dev.h @@ -25,31 +25,46 @@ typedef enum { // STUN server address and port, e.g "stun.example.com:19302". PP_TRANSPORTPROPERTY_STUN_SERVER = 0, - // Relay server name, e.g. "relay.example.com". + // Relay server address and port, e.g. "relay.example.com:12344". PP_TRANSPORTPROPERTY_RELAY_SERVER = 1, - // Single string that specifies token for use with relay server. - PP_TRANSPORTPROPERTY_RELAY_TOKEN = 2, + // Username for the relay server. + PP_TRANSPORTPROPERTY_RELAY_USERNAME = 2, + + // Password for the relay server. + PP_TRANSPORTPROPERTY_RELAY_PASSWORD = 3, + + // Type of Relay server. Must be one of the PP_TransportRelayMode + // values. By default is set to PP_TRANSPORTRELAYMODE_TURN. + PP_TRANSPORTPROPERTY_RELAY_MODE = 4, // TCP receive window in bytes. Takes effect only for PseudoTCP // connections. - PP_TRANSPORTPROPERTY_TCP_RECEIVE_WINDOW = 3, + PP_TRANSPORTPROPERTY_TCP_RECEIVE_WINDOW = 5, // TCP send window in bytes. Takes effect only for PseudoTCP // connections. - PP_TRANSPORTPROPERTY_TCP_SEND_WINDOW = 4, + PP_TRANSPORTPROPERTY_TCP_SEND_WINDOW = 6, // Boolean value that disables Neagle's algorithm when set to // true. When Neagle's algorithm is disabled, all outgoing packets // are sent as soon as possible. When set to false (by default) data // may be buffered until there is a sufficient amount to send. - PP_TRANSPORTPROPERTY_TCP_NO_DELAY = 5, + PP_TRANSPORTPROPERTY_TCP_NO_DELAY = 7, // Delay for ACK packets in milliseconds. By default set to 100ms. - PP_TRANSPORTPROPERTY_TCP_ACK_DELAY = 6 + PP_TRANSPORTPROPERTY_TCP_ACK_DELAY = 8 } PP_TransportProperty; PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_TransportProperty, 4); +typedef enum { + // RFC5766 compliant relay server. + PP_TRANSPORTRELAYMODE_TURN = 0, + + // Legacy Google relay server. + PP_TRANSPORTRELAYMODE_GOOGLE = 1 +} PP_TransportRelayMode; + struct PPB_Transport_Dev { // Creates a new transport object with the specified name using the // specified protocol. diff --git a/ppapi/tests/test_transport.cc b/ppapi/tests/test_transport.cc index 6e520c5..d2d2850 100644 --- a/ppapi/tests/test_transport.cc +++ b/ppapi/tests/test_transport.cc @@ -144,6 +144,7 @@ std::string TestTransport::Connect() { ASSERT_EQ(transport1_->ReceiveRemoteAddress(address2), PP_OK); ASSERT_EQ(transport2_->ReceiveRemoteAddress(address1), PP_OK); + ASSERT_EQ(connect_cb1.WaitForResult(), PP_OK); ASSERT_EQ(connect_cb2.WaitForResult(), PP_OK); @@ -181,8 +182,11 @@ std::string TestTransport::TestSetProperty() { pp::Var("ralay.example.com:80")), PP_OK); ASSERT_EQ(transport1_->SetProperty( - PP_TRANSPORTPROPERTY_RELAY_TOKEN, - pp::Var("INVALID_TOKEN")), PP_OK); + PP_TRANSPORTPROPERTY_RELAY_USERNAME, + pp::Var("USERNAME")), PP_OK); + ASSERT_EQ(transport1_->SetProperty( + PP_TRANSPORTPROPERTY_RELAY_PASSWORD, + pp::Var("PASSWORD")), PP_OK); // Try changing TCP window size. ASSERT_EQ(transport1_->SetProperty(PP_TRANSPORTPROPERTY_TCP_RECEIVE_WINDOW, |