Backout 66c886b7d927 (bug 827715),2c7287304555 (bug 829679) for bustage
authorMarco Bonardo <mbonardo@mozilla.com>
Mon, 14 Jan 2013 22:53:34 +0100
changeset 118804 d94202f46627f3e7e2a165db9d5b685d30eae4f0
parent 118803 5d66840110285e2794e83f4f7c7a303ab8d193b2
child 118805 43ae0a302e8c1701c95dc305cd49885f96ea67b0
push id24180
push useremorley@mozilla.com
push dateTue, 15 Jan 2013 22:58:27 +0000
treeherdermozilla-central@72e34ce7fd92 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs827715, 829679
milestone21.0a1
backs out66c886b7d9275f20876bae7eff0edc786c853c8e
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
Backout 66c886b7d927 (bug 827715),2c7287304555 (bug 829679) for bustage
dom/apps/src/Webapps.js
gfx/layers/ipc/Axis.cpp
--- a/dom/apps/src/Webapps.js
+++ b/dom/apps/src/Webapps.js
@@ -67,33 +67,24 @@ WebappsRegistry.prototype = {
     this.removeRequest(msg.requestID);
   },
 
   _getOrigin: function(aURL) {
     let uri = Services.io.newURI(aURL, null, null);
     return uri.prePath;
   },
 
-  _validateURL: function(aURL) {
-    let uri;
-    try {
-      uri = Services.io.newURI(aURL, null, null);
-      let scheme = uri.scheme;
-      if (!uri.schemeIs("http") && !uri.schemeIs("https")) {
-        throw new Components.Exception(
-          "INVALID_URL_SCHEME: '" + scheme + "'; must be 'http' or 'https'",
-          Cr.NS_ERROR_FAILURE
-        );
-      }
-    } catch(e) {
+  _validateScheme: function(aURL) {
+    let scheme = Services.io.newURI(aURL, null, null).scheme;
+    if (scheme != "http" && scheme != "https") {
       throw new Components.Exception(
-        "INVALID_URL: '" + aURL, Cr.NS_ERROR_FAILURE
+        "INVALID_URL_SCHEME: '" + scheme + "'; must be 'http' or 'https'",
+        Cr.NS_ERROR_FAILURE
       );
     }
-    return uri.spec;
   },
 
   // Checks that we run as a foreground page, and fire an error on the
   // DOM Request if we aren't.
   _ensureForeground: function(aRequest) {
     let docShell = this._window.QueryInterface(Ci.nsIInterfaceRequestor)
                                .getInterface(Ci.nsIWebNavigation)
                                .QueryInterface(Ci.nsIDocShell);
@@ -109,39 +100,39 @@ WebappsRegistry.prototype = {
     Services.tm.currentThread.dispatch(runnable,
                                        Ci.nsIThread.DISPATCH_NORMAL);
     return false;
   },
 
   // mozIDOMApplicationRegistry implementation
 
   install: function(aURL, aParams) {
-    let uri = this._validateURL(aURL);
-
     let request = this.createRequest();
 
     if (!this._ensureForeground(request)) {
       return request;
     }
 
+    this._validateScheme(aURL);
+
     let installURL = this._window.location.href;
     let requestID = this.getRequestId(request);
     let receipts = (aParams && aParams.receipts &&
                     Array.isArray(aParams.receipts)) ? aParams.receipts
                                                      : [];
     let categories = (aParams && aParams.categories &&
                       Array.isArray(aParams.categories)) ? aParams.categories
                                                          : [];
 
     let principal = this._window.document.nodePrincipal;
     cpmm.sendAsyncMessage("Webapps:Install",
                           { app: {
                               installOrigin: this._getOrigin(installURL),
-                              origin: this._getOrigin(uri),
-                              manifestURL: uri,
+                              origin: this._getOrigin(aURL),
+                              manifestURL: aURL,
                               receipts: receipts,
                               categories: categories
                             },
                             from: installURL,
                             oid: this._id,
                             requestID: requestID,
                             appId: principal.appId,
                             isBrowser: principal.isInBrowserElement
@@ -188,39 +179,39 @@ WebappsRegistry.prototype = {
     this._mgmt = null;
     cpmm.sendAsyncMessage("Webapps:UnregisterForMessages",
                           ["Webapps:Install:Return:OK"]);
   },
 
   // mozIDOMApplicationRegistry2 implementation
 
   installPackage: function(aURL, aParams) {
-    let uri = this._validateURL(aURL);
-
     let request = this.createRequest();
 
     if (!this._ensureForeground(request)) {
       return request;
     }
 
+    this._validateScheme(aURL);
+
     let installURL = this._window.location.href;
     let requestID = this.getRequestId(request);
     let receipts = (aParams && aParams.receipts &&
                     Array.isArray(aParams.receipts)) ? aParams.receipts
                                                      : [];
     let categories = (aParams && aParams.categories &&
                       Array.isArray(aParams.categories)) ? aParams.categories
                                                          : [];
 
     let principal = this._window.document.nodePrincipal;
     cpmm.sendAsyncMessage("Webapps:InstallPackage",
                           { app: {
                               installOrigin: this._getOrigin(installURL),
-                              origin: this._getOrigin(uri),
-                              manifestURL: uri,
+                              origin: this._getOrigin(aURL),
+                              manifestURL: aURL,
                               receipts: receipts,
                               categories: categories
                             },
                             from: installURL,
                             oid: this._id,
                             requestID: requestID,
                             isPackage: true,
                             appId: principal.appId,
--- a/gfx/layers/ipc/Axis.cpp
+++ b/gfx/layers/ipc/Axis.cpp
@@ -19,17 +19,17 @@ static const float EPSILON = 0.0001f;
  * or we get a touch point very far away from the previous position for some
  * reason.
  */
 static float gMaxEventAcceleration = 999.0f;
 
 /**
  * Amount of friction applied during flings.
  */
-static float gFlingFriction = 0.006f;
+static float gFlingFriction = 0.007f;
 
 /**
  * Threshold for velocity beneath which we turn off any acceleration we had
  * during repeated flings.
  */
 static float gVelocityThreshold = 0.14f;
 
 /**
@@ -157,17 +157,17 @@ void Axis::CancelTouch() {
 bool Axis::FlingApplyFrictionOrCancel(const TimeDuration& aDelta) {
   if (fabsf(mVelocity) <= gFlingStoppedThreshold) {
     // If the velocity is very low, just set it to 0 and stop the fling,
     // otherwise we'll just asymptotically approach 0 and the user won't
     // actually see any changes.
     mVelocity = 0.0f;
     return false;
   } else {
-    mVelocity *= pow(1.0f - gFlingFriction, aDelta.ToMilliseconds());
+    mVelocity *= NS_MAX(1.0f - gFlingFriction * aDelta.ToMilliseconds(), 0.0);
   }
   return true;
 }
 
 Axis::Overscroll Axis::GetOverscroll() {
   // If the current pan takes the window to the left of or above the current
   // page rect.
   bool minus = GetOrigin() < GetPageStart();