Bug 840312 - Cache the result of Tab.metadata. r=kats
authorTetsuharu OHZEKI <saneyuki.s.snyk@gmail.com>
Tue, 12 Feb 2013 16:19:43 +0900
changeset 121595 674b9ae1ccd3bab49e9433c70b599506e814cc81
parent 121594 324ef02e21614cc7b39cfae97fe7945856f8ab6a
child 121596 5446bea9ddf67188a4c327ca6b799456b16ad011
push id24296
push useremorley@mozilla.com
push dateTue, 12 Feb 2013 14:43:19 +0000
treeherdermozilla-central@860d7a47b675 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskats
bugs840312
milestone21.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 840312 - Cache the result of Tab.metadata. r=kats
mobile/android/chrome/content/browser.js
--- a/mobile/android/chrome/content/browser.js
+++ b/mobile/android/chrome/content/browser.js
@@ -3870,22 +3870,23 @@ Tab.prototype = {
     let zoomScale = (screenW * oldBrowserWidth) / (aOldScreenWidth * viewportW);
     let zoom = (aInitialLoad && metadata.defaultZoom) ? metadata.defaultZoom : this.clampZoom(this._zoom * zoomScale);
     this.setResolution(zoom, false);
     this.setScrollClampingSize(zoom);
     this.sendViewportUpdate();
   },
 
   sendViewportMetadata: function sendViewportMetadata() {
+    let metadata = this.metadata;
     sendMessageToJava({
       type: "Tab:ViewportMetadata",
-      allowZoom: this.metadata.allowZoom,
-      defaultZoom: this.metadata.defaultZoom || this.metadata.scaleRatio,
-      minZoom: this.metadata.minZoom || 0,
-      maxZoom: this.metadata.maxZoom || 0,
+      allowZoom: metadata.allowZoom,
+      defaultZoom: metadata.defaultZoom || metadata.scaleRatio,
+      minZoom: metadata.minZoom || 0,
+      maxZoom: metadata.maxZoom || 0,
       tabID: this.id
     });
   },
 
   setBrowserSize: function(aWidth, aHeight) {
     this.browserWidth = aWidth;
 
     if (!this.browser.contentWindow)