Backed out changeset a7621853f055 (bug 1100284) for xpcshell bustage
authorWes Kocher <wkocher@mozilla.com>
Fri, 21 Nov 2014 10:54:36 -0800
changeset 241210 6fec67fdc58b5893cfb41165e282d0bfca5b6d2b
parent 241209 7228e1d598eefbff8c5404243babb5f89609714f
child 241211 50456b05b04178ce13065f37f423649e9c408f79
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 outa7621853f0558d744cc4f5ac9be1797fd2b35292
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 changeset a7621853f055 (bug 1100284) for xpcshell bustage
browser/base/content/socialchat.xml
--- 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>