Merge fx-team to m-c. a=merge
authorRyan VanderMeulen <ryanvm@gmail.com>
Fri, 08 Aug 2014 21:44:21 -0400
changeset 220287 83f519eb1a3a0d6a7a2c2adce631c086d8112836
parent 220276 5a7ddc177051e7cce5a9e096bd5e100a9aeb1823 (current diff)
parent 220286 c871b95042c67b9f82d176563686b93e6141ace3 (diff)
child 220288 d5a045167411bc39e023bc404963473811dced4a
child 220291 26966c20ff419c8aad09643e94da4c8b35146208
child 220299 89ab761e581653d3760ffd4e614f0ef89863f2fc
child 220356 c13576bead5d94208be7d728d64b5c4e0aa4e76b
push id3979
push userraliiev@mozilla.com
push dateMon, 13 Oct 2014 16:35:44 +0000
treeherdermozilla-beta@30f2cc610691 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmerge
milestone34.0a1
first release with
nightly linux32
83f519eb1a3a / 34.0a1 / 20140809030202 / files
nightly linux64
83f519eb1a3a / 34.0a1 / 20140809030202 / files
nightly mac
83f519eb1a3a / 34.0a1 / 20140809030202 / files
nightly win32
83f519eb1a3a / 34.0a1 / 20140809030202 / files
nightly win64
83f519eb1a3a / 34.0a1 / 20140809030202 / files
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
releases
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Merge fx-team to m-c. a=merge
--- a/browser/components/loop/ui/index.html
+++ b/browser/components/loop/ui/index.html
@@ -10,16 +10,24 @@
     <link rel="stylesheet" type="text/css" href="../content/shared/css/conversation.css">
     <link rel="stylesheet" type="text/css" href="../content/shared/css/panel.css">
     <link rel="stylesheet" type="text/css" href="ui-showcase.css">
  </head>
   <body>
     <div id="main"></div>
     <script src="fake-mozLoop.js"></script>
     <script src="fake-l10n.js"></script>
+    <script>
+      window.OTProperties = {
+        cdnURL: '../content/shared/libs/'
+      };
+      window.OTProperties.assetURL = window.OTProperties.cdnURL + 'sdk-content/';
+      window.OTProperties.configURL = window.OTProperties.assetURL + 'js/dynamic_config.min.js';
+      window.OTProperties.cssURL = window.OTProperties.assetURL + 'css/ot.css';
+    </script>
     <script src="../content/shared/libs/sdk.js"></script>
     <script src="../content/shared/libs/react-0.11.1.js"></script>
     <script src="../content/shared/libs/jquery-2.1.0.js"></script>
     <script src="../content/shared/libs/lodash-2.4.1.js"></script>
     <script src="../content/shared/libs/backbone-1.1.2.js"></script>
     <script src="../content/shared/js/feedbackApiClient.js"></script>
     <script src="../content/shared/js/utils.js"></script>
     <script src="../content/shared/js/models.js"></script>
--- a/browser/themes/linux/jar.mn
+++ b/browser/themes/linux/jar.mn
@@ -18,17 +18,17 @@ browser.jar:
 #ifdef MOZ_SERVICES_SYNC
   skin/classic/browser/aboutSyncTabs.css
 #endif
   skin/classic/browser/aboutTabCrashed.css
   skin/classic/browser/actionicon-tab.png
 * skin/classic/browser/browser.css
 * skin/classic/browser/browser-lightweightTheme.css
   skin/classic/browser/click-to-play-warning-stripes.png
-  skin/classic/browser/content-contextmenu.svg
+* skin/classic/browser/content-contextmenu.svg
 * skin/classic/browser/engineManager.css
   skin/classic/browser/fullscreen-darknoise.png
   skin/classic/browser/Geolocation-16.png
   skin/classic/browser/Geolocation-64.png
   skin/classic/browser/identity.png
   skin/classic/browser/identity-icons-generic.png
   skin/classic/browser/identity-icons-https.png
   skin/classic/browser/identity-icons-https-ev.png
--- a/browser/themes/osx/jar.mn
+++ b/browser/themes/osx/jar.mn
@@ -18,17 +18,17 @@ browser.jar:
   skin/classic/browser/aboutSyncTabs.css
 #endif
   skin/classic/browser/aboutTabCrashed.css
   skin/classic/browser/actionicon-tab.png
   skin/classic/browser/actionicon-tab@2x.png
 * skin/classic/browser/browser.css                          (browser.css)
 * skin/classic/browser/browser-lightweightTheme.css
   skin/classic/browser/click-to-play-warning-stripes.png
-  skin/classic/browser/content-contextmenu.svg
+* skin/classic/browser/content-contextmenu.svg
 * skin/classic/browser/engineManager.css                    (engineManager.css)
   skin/classic/browser/fullscreen-darknoise.png
   skin/classic/browser/Geolocation-16.png
   skin/classic/browser/Geolocation-16@2x.png
   skin/classic/browser/Geolocation-64.png
   skin/classic/browser/Geolocation-64@2x.png
   skin/classic/browser/identity.png
   skin/classic/browser/identity@2x.png
--- a/browser/themes/windows/jar.mn
+++ b/browser/themes/windows/jar.mn
@@ -20,17 +20,17 @@ browser.jar:
 #ifdef MOZ_SERVICES_SYNC
         skin/classic/browser/aboutSyncTabs.css
 #endif
         skin/classic/browser/aboutTabCrashed.css
         skin/classic/browser/actionicon-tab.png
 *       skin/classic/browser/browser.css
 *       skin/classic/browser/browser-lightweightTheme.css
         skin/classic/browser/click-to-play-warning-stripes.png
-        skin/classic/browser/content-contextmenu.svg
+*       skin/classic/browser/content-contextmenu.svg
 *       skin/classic/browser/engineManager.css
         skin/classic/browser/fullscreen-darknoise.png
         skin/classic/browser/Geolocation-16.png
         skin/classic/browser/Geolocation-64.png
         skin/classic/browser/Info.png
         skin/classic/browser/identity.png
         skin/classic/browser/identity-icons-generic.png
         skin/classic/browser/identity-icons-https.png
@@ -439,17 +439,17 @@ browser.jar:
         skin/classic/aero/browser/aboutSyncTabs.css
 #endif
         skin/classic/aero/browser/aboutTabCrashed.css
         skin/classic/aero/browser/aboutWelcomeBack.css               (../shared/aboutWelcomeBack.css)
         skin/classic/aero/browser/actionicon-tab.png
 *       skin/classic/aero/browser/browser.css                        (browser-aero.css)
 *       skin/classic/aero/browser/browser-lightweightTheme.css
         skin/classic/aero/browser/click-to-play-warning-stripes.png
-        skin/classic/aero/browser/content-contextmenu.svg
+*       skin/classic/aero/browser/content-contextmenu.svg
 *       skin/classic/aero/browser/engineManager.css
         skin/classic/aero/browser/fullscreen-darknoise.png
         skin/classic/aero/browser/Geolocation-16.png
         skin/classic/aero/browser/Geolocation-64.png
         skin/classic/aero/browser/Info.png                           (Info-aero.png)
         skin/classic/aero/browser/identity.png                       (identity-aero.png)
         skin/classic/aero/browser/identity-icons-generic.png
         skin/classic/aero/browser/identity-icons-https.png
--- a/mobile/android/base/moz.build
+++ b/mobile/android/base/moz.build
@@ -696,8 +696,16 @@ if CONFIG['MOZ_CRASHREPORTER']:
     crashreporter.res = SRCDIR + '/crashreporter/res'
     crashreporter.included_projects += ['../' + resources.name]
 
     main.included_projects += ['../' + crashreporter.name]
 
 if CONFIG['MOZ_ANDROID_MLS_STUMBLER']:
     main.included_projects += ['../FennecStumbler']
     main.referenced_projects += ['../FennecStumbler']
+
+if CONFIG['MOZ_ANDROID_SEARCH_ACTIVITY']:
+    searchactivity = add_android_eclipse_library_project('FennecResourcesSearch')
+    searchactivity.package_name = 'org.mozilla.fennec.resources.search'
+    searchactivity.res = SRCDIR + '/../search/res'
+    searchactivity.included_projects += ['../' + resources.name]
+
+    main.included_projects += ['../' + searchactivity.name]
--- a/mobile/android/base/sqlite/MatrixBlobCursor.java
+++ b/mobile/android/base/sqlite/MatrixBlobCursor.java
@@ -12,46 +12,46 @@
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
 
 package org.mozilla.gecko.sqlite;
 
+import java.nio.ByteBuffer;
+import java.util.ArrayList;
+
 import org.mozilla.gecko.AppConstants;
 import org.mozilla.gecko.mozglue.generatorannotations.WrapElementForJNI;
 
 import android.database.AbstractCursor;
 import android.database.CursorIndexOutOfBoundsException;
 import android.util.Log;
 
-import java.nio.ByteBuffer;
-import java.util.ArrayList;
-
-/*
- * Android's AbstractCursor throws on getBlob()
- * and MatrixCursor forgot to override it. This was fixed
- * at some point but old devices are still SOL.
- * Oh, and everything in MatrixCursor is private instead of
- * protected, so we need to entirely duplicate it here,
- * instad of just being able to add the missing method.
- */
 /**
  * A mutable cursor implementation backed by an array of {@code Object}s. Use
  * {@link #newRow()} to add rows. Automatically expands internal capacity
  * as needed.
+ *
+ * This class provides one missing feature from Android's MatrixCursor:
+ * the implementation of getBlob that was inadvertently omitted from API 9 (and
+ * perhaps later; it's present in 14).
+ *
+ * MatrixCursor is all private, so we entirely duplicate it here.
  */
 public class MatrixBlobCursor extends AbstractCursor {
+    private static final String LOGTAG = "GeckoMatrixCursor";
 
     private final String[] columnNames;
-    private Object[] data;
+    private final int columnCount;
+
     private int rowCount;
-    private final int columnCount;
-    private static final String LOGTAG = "MatrixBlobCursor";
+
+    /* inner-access */ Object[] data;
 
     /**
      * Constructs a new cursor with the given initial capacity.
      *
      * @param columnNames names of the columns, the ordering of which
      *  determines column ordering elsewhere in this cursor
      * @param initialCapacity in rows
      */
@@ -138,27 +138,28 @@ public class MatrixBlobCursor extends Ab
      *
      * @throws IllegalArgumentException if {@code columnValues.size() !=
      *  columnNames.length}
      * @param columnValues in the same order as the the column names specified
      *  at cursor construction time
      */
     @WrapElementForJNI
     public void addRow(Iterable<?> columnValues) {
-        int start = rowCount * columnCount;
-        int end = start + columnCount;
-        ensureCapacity(end);
+        final int start = rowCount * columnCount;
 
         if (columnValues instanceof ArrayList<?>) {
             addRow((ArrayList<?>) columnValues, start);
             return;
         }
 
+        final int end = start + columnCount;
         int current = start;
-        Object[] localData = data;
+
+        ensureCapacity(end);
+        final Object[] localData = data;
         for (Object columnValue : columnValues) {
             if (current == end) {
                 // TODO: null out row?
                 throw new IllegalArgumentException(
                         "columnValues.size() > columnNames.length");
             }
             localData[current++] = columnValue;
         }
@@ -171,75 +172,85 @@ public class MatrixBlobCursor extends Ab
 
         // Increase row count here in case we encounter an exception.
         rowCount++;
     }
 
     /** Optimization for {@link ArrayList}. */
     @WrapElementForJNI
     private void addRow(ArrayList<?> columnValues, int start) {
-        int size = columnValues.size();
+        final int size = columnValues.size();
         if (size != columnCount) {
             throw new IllegalArgumentException("columnNames.length = "
                     + columnCount + ", columnValues.size() = " + size);
         }
 
-        rowCount++;
-        Object[] localData = data;
+        final int end = start + columnCount;
+        ensureCapacity(end);
+
+        // Take a reference just in case someone calls ensureCapacity
+        // and `data` gets replaced by a new array!
+        final Object[] localData = data;
         for (int i = 0; i < size; i++) {
             localData[start + i] = columnValues.get(i);
         }
+
+        rowCount++;
     }
 
-    /** Ensures that this cursor has enough capacity. */
-    private void ensureCapacity(int size) {
-        if (size > data.length) {
-            Object[] oldData = this.data;
-            int newSize = data.length * 2;
-            if (newSize < size) {
-                newSize = size;
-            }
-            this.data = new Object[newSize];
-            System.arraycopy(oldData, 0, this.data, 0, oldData.length);
+    /**
+     * Ensures that this cursor has enough capacity. If it needs to allocate
+     * a new array, the existing capacity will be at least doubled.
+     */
+    private void ensureCapacity(final int size) {
+        if (size <= data.length) {
+            return;
         }
+
+        final Object[] oldData = this.data;
+        this.data = new Object[Math.max(size, data.length * 2)];
+        System.arraycopy(oldData, 0, this.data, 0, oldData.length);
     }
 
     /**
      * Builds a row, starting from the left-most column and adding one column
      * value at a time. Follows the same ordering as the column names specified
      * at cursor construction time.
+     *
+     * Not thread-safe.
      */
     public class RowBuilder {
-
         private int index;
         private final int endIndex;
 
         RowBuilder(int index, int endIndex) {
             this.index = index;
             this.endIndex = endIndex;
         }
 
         /**
          * Sets the next column value in this row.
          *
          * @throws CursorIndexOutOfBoundsException if you try to add too many
          *  values
          * @return this builder to support chaining
          */
-        public RowBuilder add(Object columnValue) {
+        public RowBuilder add(final Object columnValue) {
             if (index == endIndex) {
-                throw new CursorIndexOutOfBoundsException(
-                        "No more columns left.");
+                throw new CursorIndexOutOfBoundsException("No more columns left.");
             }
 
             data[index++] = columnValue;
             return this;
         }
     }
 
+    /**
+     * Not thread safe.
+     */
     public void set(int column, Object value) {
         if (column < 0 || column >= columnCount) {
             throw new CursorIndexOutOfBoundsException("Requested column: "
                     + column + ", # of columns: " +  columnCount);
         }
         if (mPos < 0) {
             throw new CursorIndexOutOfBoundsException("Before first row.");
         }
@@ -264,17 +275,17 @@ public class MatrixBlobCursor extends Ab
     public String getString(int column) {
         Object value = get(column);
         if (value == null) return null;
         return value.toString();
     }
 
     @Override
     public short getShort(int column) {
-        Object value = get(column);
+        final Object value = get(column);
         if (value == null) return 0;
         if (value instanceof Number) return ((Number) value).shortValue();
         return Short.parseShort(value.toString());
     }
 
     @Override
     public int getInt(int column) {
         Object value = get(column);
@@ -309,33 +320,34 @@ public class MatrixBlobCursor extends Ab
 
     @Override
     public byte[] getBlob(int column) {
         Object value = get(column);
         if (value == null) return null;
         if (value instanceof byte[]) {
             return (byte[]) value;
         }
+
         if (value instanceof ByteBuffer) {
-            ByteBuffer data = (ByteBuffer)value;
-            byte[] byteArray = new byte[data.remaining()];
-            data.get(byteArray);
+            final ByteBuffer bytes = (ByteBuffer) value;
+            byte[] byteArray = new byte[bytes.remaining()];
+            bytes.get(byteArray);
             return byteArray;
         }
         throw new UnsupportedOperationException("BLOB Object not of known type");
     }
 
     @Override
     public boolean isNull(int column) {
         return get(column) == null;
     }
 
     @Override
     protected void finalize() {
         if (AppConstants.DEBUG_BUILD) {
             if (!isClosed()) {
-                Log.e(LOGTAG, "Cursor finalized without being closed");
+                Log.e(LOGTAG, "Cursor finalized without being closed", new RuntimeException("stack"));
             }
         }
 
         super.finalize();
     }
 }
--- a/mobile/android/components/HelperAppDialog.js
+++ b/mobile/android/components/HelperAppDialog.js
@@ -67,16 +67,20 @@ HelperAppLauncherDialog.prototype = {
     }
 
     if (url.schemeIs("file")) {
       // If it's in our app directory or profile directory, we never ever
       // want to do anything with it, including saving to disk or passing the
       // file to another application.
       let file = url.QueryInterface(Ci.nsIFileURL).file;
 
+      // Normalize the nsILocalFile in-place. This will ensure that paths
+      // can be correctly compared via `contains`, below.
+      file.normalize();
+
       // TODO: pref blacklist?
 
       let appRoot = FileUtils.getFile("XREExeF", []);
       if (appRoot.contains(file, true)) {
         return false;
       }
 
       let profileRoot = FileUtils.getFile("ProfD", []);