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

Unified Diff: chrome/browser/extensions/api/cast_channel/cast_channel_api.cc

Issue 393023003: Added connection timeout functionality to CastSocket. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 5 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
Index: chrome/browser/extensions/api/cast_channel/cast_channel_api.cc
diff --git a/chrome/browser/extensions/api/cast_channel/cast_channel_api.cc b/chrome/browser/extensions/api/cast_channel/cast_channel_api.cc
index d1a84e4a31261a8f61178ce6c93e854619311df5..ef1da54fdac864d323626d78e0297522ad48ca4c 100644
--- a/chrome/browser/extensions/api/cast_channel/cast_channel_api.cc
+++ b/chrome/browser/extensions/api/cast_channel/cast_channel_api.cc
@@ -20,6 +20,10 @@
#include "net/base/net_util.h"
#include "url/gurl.h"
+// Default timeout interval for connection setup.
+// TODO(kmarshall): add Javascript plumbing so clients can set the timeout.
mark a. foltz 2014/07/15 22:18:15 Can this be done as part of this change? It shoul
Kevin M 2014/07/16 22:59:41 Done.
+const int64 kDefaultConnectTimeoutMillis = 10000; // 10 seconds.
haibinlu 2014/07/15 22:10:45 5 seconds? we have been using this value.
Kevin M 2014/07/16 22:59:41 Done.
+
namespace extensions {
namespace Close = cast_channel::Close;
@@ -89,7 +93,8 @@ scoped_ptr<CastSocket> CastChannelAPI::CreateCastSocket(
} else {
return scoped_ptr<CastSocket>(
new CastSocket(extension_id, ip_endpoint, channel_auth, this,
- g_browser_process->net_log()));
+ g_browser_process->net_log(),
+ kDefaultConnectTimeoutMillis));
}
}
@@ -244,7 +249,7 @@ bool CastChannelOpenFunction::ParseChannelUrl(const GURL& url,
cast_channel::CHANNEL_AUTH_TYPE_SSL_VERIFIED :
cast_channel::CHANNEL_AUTH_TYPE_SSL;
return true;
-};
+}
net::IPEndPoint* CastChannelOpenFunction::ParseConnectInfo(
const ConnectInfo& connect_info) {

Powered by Google App Engine
This is Rietveld 408576698