[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] r12558: Actually, tab switching will be faster if we check for chrom (torbutton/trunk/src/components)



Author: mikeperry
Date: 2007-11-23 06:43:52 -0500 (Fri, 23 Nov 2007)
New Revision: 12558

Modified:
   torbutton/trunk/src/components/window-mapper.js
Log:

Actually, tab switching will be faster if we check for chrome
first.



Modified: torbutton/trunk/src/components/window-mapper.js
===================================================================
--- torbutton/trunk/src/components/window-mapper.js	2007-11-23 11:25:29 UTC (rev 12557)
+++ torbutton/trunk/src/components/window-mapper.js	2007-11-23 11:43:52 UTC (rev 12558)
@@ -30,8 +30,6 @@
 
   // This JSObject is exported directly to chrome
   this.wrappedJSObject = this;
-
-  dump("Window mapper component initialized\n");
 }
 
 ContentWindowMapper.prototype =
@@ -100,6 +98,11 @@
   },
 
   getBrowserForContentWindow: function(topContentWindow) {
+      if(topContentWindow instanceof Components.interfaces.nsIDOMChromeWindow) {
+          this.logger.log(3, "Chrome browser found: "+topContentWindow.location);
+          return topContentWindow.getBrowser().selectedTab.linkedBrowser;
+      }
+
       var cached = this.checkCache(topContentWindow);
       if(cached != null) return cached;
 
@@ -118,11 +121,6 @@
           }
       }
 
-      if(topContentWindow instanceof Components.interfaces.nsIDOMChromeWindow) {
-          this.logger.log(3, "Chrome browser found: "+topContentWindow.location);
-          return topContentWindow.getBrowser().selectedTab.linkedBrowser;
-      }
-
       if(topContentWindow && topContentWindow.location)
           this.logger.log(5, "No browser found: "+topContentWindow.location);
       else