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

Unified Diff: net/data/websocket/websocket_shared_worker.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/split_packet_check.html ('k') | net/websockets/websocket_channel.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/data/websocket/websocket_shared_worker.html
diff --git a/net/data/websocket/websocket_shared_worker.html b/net/data/websocket/websocket_shared_worker.html
index 7acb4ab37415f6398e7e552d96623fb78952f87a..2156465f813f1e21f153e1e9282b74646d41832d 100644
--- a/net/data/websocket/websocket_shared_worker.html
+++ b/net/data/websocket/websocket_shared_worker.html
@@ -7,14 +7,8 @@ function log(message)
document.getElementById("result").innerHTML += message + "<br>";
}
var worker = new SharedWorker("websocket_worker_simple.js");
-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 url = "ws://" + host + ":" + port + "/echo-with-no-extension";
+var protocol = location.protocol.replace('http', 'ws');
+var url = protocol + '//' + location.host + '/echo-with-no-extension';
worker.port.onmessage = function (evt) {
log(evt.data);
if (evt.data == "DONE") {
@@ -28,4 +22,3 @@ worker.port.postMessage(url);
</script>
</body>
</html>
-
« no previous file with comments | « net/data/websocket/split_packet_check.html ('k') | net/websockets/websocket_channel.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698