Bug 576179 - Remove return {} hack used for sync messages [r=vingtetun]
authorMark Finkle <mfinkle@mozilla.com>
Thu, 01 Jul 2010 14:11:02 -0400
changeset 66345 5157401d74e966e0bc2aeb8647121851d22a4f48
parent 66344 ed9e9c678b0fd98027c13e4b4193338f97552d8a
child 66348 a45f4801e170075474ca07e703ddeb7fa35c253f
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersvingtetun
bugs576179
Bug 576179 - Remove return {} hack used for sync messages [r=vingtetun]
mobile/chrome/content/BrowserView.js
mobile/chrome/content/bindings/browser.xml
mobile/chrome/content/browser-ui.js
--- a/mobile/chrome/content/BrowserView.js
+++ b/mobile/chrome/content/BrowserView.js
@@ -476,18 +476,16 @@ BrowserView.prototype = {
         break;
       case "Browser:PageScroll":
         this.updatePageScroll(aMessage);
         break;
       case "Browser:MozScrolledAreaChanged":
         this.updateScrolledArea(aMessage);
         break;
     }
-    
-    return {};
   },
 
   updateDirtyTiles: function updateDirtyTiles(aMessage) {
     let browser = aMessage.target;
     if (browser != this._browser)
       return;
     
     let rects = aMessage.json.rects;
--- a/mobile/chrome/content/bindings/browser.xml
+++ b/mobile/chrome/content/bindings/browser.xml
@@ -113,35 +113,33 @@
             case "DOMTitleChanged":
               this._contentTitle = aMessage.json.title;
               break;
 
             case "DOMLinkAdded":
               let link = aMessage.json;
               // ignore results from subdocuments
               if (link.windowId != this.contentWindowId)
-                return {};
+                return;
 
               let linkType = this._getLinkType(link);
               switch(linkType) {
                 case "icon":
                   let iconURI = gIOService.newURI(link.href, link.charset, null);
                   if (!iconURI.schemeIs("javascript") && !gFaviconService.isFailedFavicon(iconURI)) {
                     gFaviconService.setAndLoadFaviconForPage(this.currentURI, iconURI, true);
                     this.mIconURL = iconURI.spec;
                   }
                   break;
                 case "search":
                   this._searchEngines.push({ title: link.title, href: link.href });
                   break;
               }
               break;
          }
-
-         return {};
         ]]></body>
       </method>
 
       <method name="_getLinkType">
         <parameter name="aLink" />
         <body><![CDATA[
           let type = "";
           if (/\bicon\b/i(aLink.rel)) {
@@ -269,18 +267,16 @@
                   state: json.state
                 }
 
                 this._notify(Components.interfaces.nsIWebProgress.NOTIFY_SECURITY,
                              "onSecurityChange",
                              args);
                 break;
             }
-
-            return {};
           },
 
           _notify: function(aFlags, aName, aArguments) {
             this._listeners.forEach(function(item) {
               if (item.flags & aFlags) {
                 item.listener[aName].apply(item.listener, aArguments);
               }
             });
@@ -587,18 +583,16 @@
                   state: json.state
                 }
 
                 this._notify(Components.interfaces.nsIWebProgress.NOTIFY_SECURITY,
                              "onSecurityChange",
                              args);
                 break;
             }
-
-            return {};
           },
 
           _notify: function(aFlags, aName, aArguments) {
             this._listeners.forEach(function(item) {
               if (item.flags & aFlags)
                 item.listener[aName].apply(item.listener, aArguments);
             });
           }
--- a/mobile/chrome/content/browser-ui.js
+++ b/mobile/chrome/content/browser-ui.js
@@ -114,18 +114,16 @@ var BrowserUI = {
     // tab is brought to the front.
 
     for (let i = 0; i < Browser.tabs.length; i++) {
       if (Browser._tabs[i].browser == aBrowser) {
         Browser.selectedTab = Browser.tabs[i];
         break;
       }
     }
-
-    return { };
   },
 
   _titleChanged : function(aBrowser) {
     var browser = Browser.selectedBrowser;
     if (browser && aBrowser != browser)
       return;
 
     var url = this.getDisplayURI(browser);
@@ -145,18 +143,16 @@ var BrowserUI = {
      // Find the relevant tab, and close it.
      let browsers = Browser.browsers;
      for (let i = 0; i < browsers.length; i++) {
       if (browsers[i] == aBrowser) {
         Browser.closeTab(Browser.getTabAtIndex(i));
         return { preventDefault: true };
       }
     }
-
-    return { };
   },
 
   _updateButtons : function(aBrowser) {
     let back = document.getElementById("cmd_back");
     let forward = document.getElementById("cmd_forward");
 
     back.setAttribute("disabled", !aBrowser.canGoBack);
     forward.setAttribute("disabled", !aBrowser.canGoForward);
@@ -818,18 +814,16 @@ var BrowserUI = {
           rects.push(new Rect(rect.left, rect.top, rect.width, rect.height));
         }
         TapHighlightHelper.show(rects);
         break;
 
       case "Browser:OpenURI":
         Browser.addTab(json.uri, false, Browser.selectedTab);
     }
-
-    return {};
   },
 
   supportsCommand : function(cmd) {
     var isSupported = false;
     switch (cmd) {
       case "cmd_back":
       case "cmd_forward":
       case "cmd_reload":