Bug 1392263 - Make TELEMETRY_1ST_RESULT count results of all types. r=mak
authorSimon Lindholm <simon.lindholm10@gmail.com>
Thu, 14 Sep 2017 00:06:54 +0200
changeset 430317 968822d2cc5d7f5c4ca6df8f98f695a1b3729267
parent 430316 93d73e65449839f2c38c6207b26f3d9209ea9487
child 430318 2cc3aa0395485e7139c5ab1fd5b515f976f5c074
push id7761
push userjlund@mozilla.com
push dateFri, 15 Sep 2017 00:19:52 +0000
treeherdermozilla-beta@c38455951db4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmak
bugs1392263
milestone57.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 1392263 - Make TELEMETRY_1ST_RESULT count results of all types. r=mak MozReview-Commit-ID: 82jJDZZG7kb
toolkit/components/places/UnifiedComplete.js
--- a/toolkit/components/places/UnifiedComplete.js
+++ b/toolkit/components/places/UnifiedComplete.js
@@ -1725,19 +1725,16 @@ Search.prototype = {
       match.icon = `page-icon:${uri.prePath}/`;
     }
 
     this._addMatch(match);
     return true;
   },
 
   _onResultRow(row, cancel) {
-    if (this._counts[MATCHTYPE.GENERAL] == 0) {
-      TelemetryStopwatch.finish(TELEMETRY_1ST_RESULT, this);
-    }
     let queryType = row.getResultByIndex(QUERYINDEX_QUERYTYPE);
     let match;
     switch (queryType) {
       case QUERYTYPE_AUTOFILL_HOST:
         this._result.setDefaultIndex(0);
         match = this._processHostRow(row);
         break;
       case QUERYTYPE_AUTOFILL_URL:
@@ -1847,16 +1844,18 @@ Search.prototype = {
     this._result.insertMatchAt(this._getInsertIndexForMatch(match),
                                match.value,
                                match.comment,
                                match.icon,
                                match.style,
                                match.finalCompleteValue);
     this._counts[match.type]++;
 
+    if (this._result.matchCount == 1)
+      TelemetryStopwatch.finish(TELEMETRY_1ST_RESULT, this);
     if (this._result.matchCount == 6)
       TelemetryStopwatch.finish(TELEMETRY_6_FIRST_RESULTS, this);
 
     this.notifyResults(true);
   },
 
   _getInsertIndexForMatch(match) {
     let index = 0;