Backed out 2 changesets (bug 1100284) for xpcshell orange
authorWes Kocher <wkocher@mozilla.com>
Fri, 21 Nov 2014 16:54:31 -0800
changeset 241399 1a9ce687110d05e4d22ba30c5a508b501744bebb
parent 241398 96046c85765face71e42b5c85fbe7a16ddc27a2c
child 241400 9bc239136a6b52ed8b6c6c08a7c4b7110f26d47f
push id4311
push userraliiev@mozilla.com
push dateMon, 12 Jan 2015 19:37:41 +0000
treeherdermozilla-beta@150c9fed433b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1100284
milestone36.0a1
backs outc773c6be92708c523d2519ad584fc92af1e12b52
e8f45cf7b043d717f1b5669b9375b0efafa8356d
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
Backed out 2 changesets (bug 1100284) for xpcshell orange Backed out changeset c773c6be9270 (bug 1100284) Backed out changeset e8f45cf7b043 (bug 1100284)
browser/base/content/socialchat.xml
browser/components/loop/MozLoopService.jsm
--- a/browser/base/content/socialchat.xml
+++ b/browser/base/content/socialchat.xml
@@ -188,26 +188,25 @@
           let win = Chat.findChromeWindowForChats();
           let chatbar = win.document.getElementById("pinnedchats");
           let origin = this.content.getAttribute("origin");
           let cb = chatbar.openChat(origin, title, "about:blank");
           cb.promiseChatLoaded.then(
             () => {
               this.swapDocShells(cb);
 
-              chatbar.focus();
-              this.close();
-
               // chatboxForURL is a map of URL -> chatbox used to avoid opening
               // duplicate chat windows. Ensure reattached chat windows aren't
               // registered with about:blank as their URL, otherwise reattaching
               // more than one chat window isn't possible.
               chatbar.chatboxForURL.delete("about:blank");
               chatbar.chatboxForURL.set(this.src, Cu.getWeakReference(cb));
 
+              chatbar.focus();
+              this.close();
               deferred.resolve(cb);
             }
           );
         }
         return deferred.promise;
         ]]></body>
       </method>
 
@@ -523,19 +522,17 @@
         <parameter name="aTitle"/>
         <parameter name="aURL"/>
         <parameter name="aMode"/>
         <parameter name="aCallback"/>
         <body><![CDATA[
           let cb = this.chatboxForURL.get(aURL);
           if (cb) {
             cb = cb.get();
-            // A chatbox is still alive to us when it's parented and still has
-            // content.
-            if (cb.parentNode && cb.contentWindow) {
+            if (cb.parentNode) {
               this.showChat(cb, aMode);
               if (aCallback) {
                 if (cb._callbacks == null) {
                   // Chatbox has already been created, so callback now.
                   aCallback(cb);
                 } else {
                   // Chatbox is yet to have bindings created...
                   cb._callbacks.push(aCallback);
@@ -644,34 +641,31 @@
       <!-- Moves a chatbox to a new window. Returns a promise that is resolved
            once the move to the other window is complete.
       -->
       <method name="detachChatbox">
         <parameter name="aChatbox"/>
         <parameter name="aOptions"/>
         <body><![CDATA[
           let deferred = Promise.defer();
-          let chatbar = this;
           let options = "";
           for (let name in aOptions)
             options += "," + name + "=" + aOptions[name];
 
           let otherWin = window.openDialog("chrome://browser/content/chatWindow.xul",
                                            "_blank", "chrome,all,dialog=no" + options);
 
           otherWin.addEventListener("load", function _chatLoad(event) {
             if (event.target != otherWin.document)
               return;
 
             otherWin.removeEventListener("load", _chatLoad, true);
             let otherChatbox = otherWin.document.getElementById("chatter");
             aChatbox.swapDocShells(otherChatbox);
             aChatbox.close();
-            chatbar.chatboxForURL.set(aChatbox.src, Cu.getWeakReference(otherChatbox));
-
             deferred.resolve(otherChatbox);
           }, true);
           return deferred.promise;
         ]]></body>
       </method>
 
     </implementation>
 
--- a/browser/components/loop/MozLoopService.jsm
+++ b/browser/components/loop/MozLoopService.jsm
@@ -769,24 +769,17 @@ let MozLoopServiceInternal = {
    *
    * @param {Object} conversationWindowData The data to be obtained by the
    *                                        window when it opens.
    * @returns {Number} The id of the window.
    */
   openChatWindow: function(conversationWindowData) {
     // So I guess the origin is the loop server!?
     let origin = this.loopServerUri;
-    // Try getting a window ID that can (re-)identify this conversation, or resort
-    // to a globally unique one as a last resort.
-    // XXX We can clean this up once rooms and direct contact calling are the only
-    //     two modes left.
-    let windowId = ("contact" in conversationWindowData) ?
-                   conversationWindowData.contact._guid || gLastWindowId++ :
-                   conversationWindowData.roomToken || conversationWindowData.callId ||
-                   gLastWindowId++;
+    let windowId = gLastWindowId++;
     // Store the id as a string, as that's what we use elsewhere.
     windowId = windowId.toString();
 
     gConversationWindowData.set(windowId, conversationWindowData);
 
     let url = "about:loopconversation#" + windowId;
 
     let callback = chatbox => {