Backed out changeset 7232652c0304 (bug 1369604)
authorSebastian Hengst <archaeopteryx@coole-files.de>
Sat, 29 Jul 2017 18:35:25 +0200
changeset 420537 995115af8e68b88ee391cc8c366bf6e58bfdc54b
parent 420536 f9d7a7441707424fa04e652f1c9bde00ba7dc8de
child 420538 ec0c38721aff0949da7d20fcb9d97fda66aefc00
push id7566
push usermtabara@mozilla.com
push dateWed, 02 Aug 2017 08:25:16 +0000
treeherdermozilla-beta@86913f512c3c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1369604
milestone56.0a1
backs out7232652c03042c62967082e9e34b95e3f7263ba2
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
Backed out changeset 7232652c0304 (bug 1369604)
mobile/android/base/java/org/mozilla/gecko/activitystream/homepanel/HighlightsLoader.java
--- a/mobile/android/base/java/org/mozilla/gecko/activitystream/homepanel/HighlightsLoader.java
+++ b/mobile/android/base/java/org/mozilla/gecko/activitystream/homepanel/HighlightsLoader.java
@@ -4,25 +4,23 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 package org.mozilla.gecko.activitystream.homepanel;
 
 import android.content.Context;
 import android.database.ContentObserver;
 import android.database.Cursor;
 import android.os.SystemClock;
-import android.support.annotation.WorkerThread;
 import android.support.v4.content.AsyncTaskLoader;
 
 import org.mozilla.gecko.Telemetry;
 import org.mozilla.gecko.activitystream.ranking.HighlightsRanking;
 import org.mozilla.gecko.db.BrowserContract;
 import org.mozilla.gecko.db.BrowserDB;
 import org.mozilla.gecko.activitystream.homepanel.model.Highlight;
-import org.mozilla.gecko.util.ThreadUtils;
 
 import java.util.Collections;
 import java.util.List;
 
 /**
  * Loader implementation for loading a list of ranked highlights from the database.
  */
 /* package-private */ class HighlightsLoader extends AsyncTaskLoader<List<Highlight>> {
@@ -59,38 +57,25 @@ import java.util.List;
             return Collections.emptyList();
         }
 
         try {
             // From now on get notified about content updates and reload data - until loader is reset.
             enableContentUpdates();
 
             final List<Highlight> highlights = HighlightsRanking.rank(candidatesCursor, highlightsLimit);
-            forceLoadHighlightMetadata(highlights); // force load now that we have a short list of the data.
 
             addToPerformanceHistogram(startTime);
 
             return highlights;
         } finally {
             candidatesCursor.close();
         }
     }
 
-    /**
-     * Optimization: we force the lazily-loaded metadata to load while we're running on this background thread
-     * rather than letting it block the UI thread when this data is being used in the UI.
-     */
-    @WorkerThread
-    private static void forceLoadHighlightMetadata(final List<Highlight> highlights) {
-        ThreadUtils.assertNotOnUiThread();
-        for (final Highlight highlight : highlights) {
-            highlight.getMetadataSlow();
-        }
-    }
-
     private void addToPerformanceHistogram(long startTime) {
         final long took = SystemClock.uptimeMillis() - startTime;
 
         Telemetry.addToHistogram(TELEMETRY_HISTOGRAM_ACTIVITY_STREAM_HIGHLIGHTS, (int) Math.min(took, Integer.MAX_VALUE));
     }
 
     @Override
     protected void onReset() {