Bug 920586 - Allows chrome usages of TCPSocket r=bent
authorAlexandre Poirot <poirot.alex@gmail.com>
Wed, 25 Sep 2013 08:58:00 +0100
changeset 165770 7dbd88b7f43b538633fae758242c4ffff7c8ef91
parent 165769 11762cace08139e8f6d9f3225532bd372c1948b9
child 165771 695c35eb1b8bbf00f6c0dd3d037c624c9bb69377
push id3066
push userakeybl@mozilla.com
push dateMon, 09 Dec 2013 19:58:46 +0000
treeherdermozilla-beta@a31a0dce83aa [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbent
bugs920586
milestone27.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 920586 - Allows chrome usages of TCPSocket r=bent
dom/network/src/TCPSocket.js
--- a/dom/network/src/TCPSocket.js
+++ b/dom/network/src/TCPSocket.js
@@ -474,19 +474,16 @@ TCPSocket.prototype = {
         // Clean up our socket
         this.close();
       }
     }
   },
 
   // nsIDOMTCPSocket
   open: function ts_open(host, port, options) {
-    if (!this.initWindowless())
-      return null;
-
     this._inChild = Cc["@mozilla.org/xre/app-info;1"].getService(Ci.nsIXULRuntime)
                        .processType != Ci.nsIXULRuntime.PROCESS_TYPE_DEFAULT;
     LOG("content process: " + (this._inChild ? "true" : "false"));
 
     // in the testing case, init won't be called and
     // hasPrivileges will be null. We want to proceed to test.
     if (this._hasPrivileges !== true && this._hasPrivileges !== null) {
       throw new Error("TCPSocket does not have permission in this context.\n");
@@ -561,19 +558,16 @@ TCPSocket.prototype = {
     if (this._multiplexStream.count == 0) {
       this._activateTLS();
     } else {
       this._waitingForStartTLS = true;
     }
   },
 
   listen: function ts_listen(localPort, options, backlog) {
-    if (!this.initWindowless())
-      return null;
-
     // in the testing case, init won't be called and
     // hasPrivileges will be null. We want to proceed to test.
     if (this._hasPrivileges !== true && this._hasPrivileges !== null) {
       throw new Error("TCPSocket does not have permission in this context.\n");
     }
 
     let that = new TCPServerSocket(this.useWin || this);