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

Unified Diff: net/data/websocket/split_packet_check.html

Issue 390773002: [WebSocket] Send a close frame when the renderer process is gone. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
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
« no previous file with comments | « net/data/websocket/counted_connection.html ('k') | net/data/websocket/websocket_shared_worker.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/data/websocket/split_packet_check.html
diff --git a/net/data/websocket/split_packet_check.html b/net/data/websocket/split_packet_check.html
index a7f4c365f56d6f0026bbcd3d1966943715e282f6..6b7e980a788a7533942a8ee991b2b06bcadc657d 100644
--- a/net/data/websocket/split_packet_check.html
+++ b/net/data/websocket/split_packet_check.html
@@ -3,16 +3,8 @@
<head>
<title>test ws split packet</title>
<script type="text/javascript">
-
-var href = window.location.href;
-var hostBegin = href.indexOf('/') + 2;
-var hostEnd = href.lastIndexOf(':');
-var host = href.slice(hostBegin, hostEnd);
-var portBegin = hostEnd + 1;
-var portEnd = href.lastIndexOf('/');
-var port = href.slice(portBegin, portEnd);
-var scheme = href.indexOf('https') >= 0 ? 'wss' : 'ws';
-var url = scheme + '://' + host + ':' + port + '/close-with-split-packet';
+var protocol = location.protocol.replace('http', 'ws');
+var url = protocol + '//' + location.host + '/close-with-split-packet';
// Do connection test.
var ws = new WebSocket(url);
« no previous file with comments | « net/data/websocket/counted_connection.html ('k') | net/data/websocket/websocket_shared_worker.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698