Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(949)

Unified Diff: webkit/plugins/ppapi/ppb_transport_impl.cc

Issue 7762008: Implement STUN support for P2P Transport API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: - Created 9 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webkit/glue/p2p_transport.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/plugins/ppapi/ppb_transport_impl.cc
diff --git a/webkit/plugins/ppapi/ppb_transport_impl.cc b/webkit/plugins/ppapi/ppb_transport_impl.cc
index fe8a38ab714ff9d9e9749562f828f48d851157eb..f9d9cc15f31578df38432950e1b575db1082d477 100644
--- a/webkit/plugins/ppapi/ppb_transport_impl.cc
+++ b/webkit/plugins/ppapi/ppb_transport_impl.cc
@@ -8,6 +8,7 @@
#include "base/string_util.h"
#include "net/base/io_buffer.h"
#include "net/base/net_errors.h"
+#include "net/base/net_util.h"
#include "net/socket/socket.h"
#include "ppapi/c/dev/ppb_transport_dev.h"
#include "ppapi/c/pp_completion_callback.h"
@@ -115,7 +116,11 @@ int32_t PPB_Transport_Impl::SetProperty(PP_TransportProperty property,
StringVar* value_str = StringVar::FromPPVar(value);
if (!value_str)
return PP_ERROR_BADARGUMENT;
- config_.stun_server = value_str->value();
+
+ if (!net::ParseHostAndPort(value_str->value(), &config_.stun_server,
+ &config_.stun_server_port)) {
+ return PP_ERROR_BADARGUMENT;
+ }
break;
}
@@ -123,7 +128,11 @@ int32_t PPB_Transport_Impl::SetProperty(PP_TransportProperty property,
StringVar* value_str = StringVar::FromPPVar(value);
if (!value_str)
return PP_ERROR_BADARGUMENT;
- config_.relay_server = value_str->value();
+
+ if (!net::ParseHostAndPort(value_str->value(), &config_.relay_server,
+ &config_.relay_server_port)) {
+ return PP_ERROR_BADARGUMENT;
+ }
break;
}
« no previous file with comments | « webkit/glue/p2p_transport.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698