Bug 1421212 - Remove RESULTS_AS_FULL_VISIT. r=mak
authorayus <aayusht4736@gmail.com>
Fri, 15 Dec 2017 21:31:31 +0530
changeset 396827 21bc5f64c3395c40fd9d065c398b5d63a22b8f45
parent 396826 3b3bd97ecf4547e8454d06ec51d0f01966d8b68d
child 396828 92dbf32cc3526258daebc6281204224b7ca49dc4
push id33112
push userdluca@mozilla.com
push dateTue, 19 Dec 2017 10:10:10 +0000
treeherdermozilla-central@c9ce08c45635 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmak
bugs1421212
milestone59.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 1421212 - Remove RESULTS_AS_FULL_VISIT. r=mak
toolkit/components/places/nsINavHistoryService.idl
toolkit/components/places/nsNavHistory.cpp
toolkit/components/places/tests/queries/test_querySerialization.js
toolkit/components/places/tests/unit/test_history.js
--- a/toolkit/components/places/nsINavHistoryService.idl
+++ b/toolkit/components/places/nsINavHistoryService.idl
@@ -1032,27 +1032,16 @@ interface nsINavHistoryQueryOptions : ns
    * often give you multiple results for one URI). Individual result nodes will
    * have type "Visit"
    *
    * @note This result type is only supported by QUERY_TYPE_HISTORY.
    */
   const unsigned short RESULTS_AS_VISIT = 1;
 
   /**
-   * This is identical to RESULT_TYPE_VISIT except that individual result nodes
-   * will have type "FullVisit".  This is used for the attributes that are not
-   * commonly accessed to save space in the common case (the lists can be very
-   * long).
-   *
-   * @note Not yet implemented. See bug 409662.
-   * @note This result type is only supported by QUERY_TYPE_HISTORY.
-   */
-  const unsigned short RESULTS_AS_FULL_VISIT = 2;
-
-  /**
    * This returns query nodes for each predefined date range where we 
    * had visits. The node contains information how to load its content:
    * - visits for the given date range will be loaded.
    *
    * @note This result type is only supported by QUERY_TYPE_HISTORY.
    */
   const unsigned short RESULTS_AS_DATE_QUERY = 3;
 
--- a/toolkit/components/places/nsNavHistory.cpp
+++ b/toolkit/components/places/nsNavHistory.cpp
@@ -1495,17 +1495,16 @@ PlacesSQLQueryBuilder::Select()
   {
     case nsINavHistoryQueryOptions::RESULTS_AS_URI:
     case nsINavHistoryQueryOptions::RESULTS_AS_TAG_CONTENTS:
       rv = SelectAsURI();
       NS_ENSURE_SUCCESS(rv, rv);
       break;
 
     case nsINavHistoryQueryOptions::RESULTS_AS_VISIT:
-    case nsINavHistoryQueryOptions::RESULTS_AS_FULL_VISIT:
       rv = SelectAsVisit();
       NS_ENSURE_SUCCESS(rv, rv);
       break;
 
     case nsINavHistoryQueryOptions::RESULTS_AS_DATE_QUERY:
     case nsINavHistoryQueryOptions::RESULTS_AS_DATE_SITE_QUERY:
       rv = SelectAsDay();
       NS_ENSURE_SUCCESS(rv, rv);
@@ -4003,17 +4002,16 @@ nsNavHistory::VisitIdToResultNode(int64_
   nsAutoCString tagsFragment;
   GetTagsSqlFragment(GetTagsFolder(), NS_LITERAL_CSTRING("h.id"),
                      true, tagsFragment);
 
   nsCOMPtr<mozIStorageStatement> statement;
   switch (aOptions->ResultType())
   {
     case nsNavHistoryQueryOptions::RESULTS_AS_VISIT:
-    case nsNavHistoryQueryOptions::RESULTS_AS_FULL_VISIT:
       // visit query - want exact visit time
       // Should match kGetInfoIndex_* (see GetQueryResults)
       statement = mDB->GetStatement(NS_LITERAL_CSTRING(
         "SELECT h.id, h.url, h.title, h.rev_host, h.visit_count, "
                "v.visit_date, null, null, null, null, null, "
                ) + tagsFragment + NS_LITERAL_CSTRING(", h.frecency, h.hidden, h.guid, "
               "v.id, v.from_visit, v.visit_type "
         "FROM moz_places h "
--- a/toolkit/components/places/tests/queries/test_querySerialization.js
+++ b/toolkit/components/places/tests/queries/test_querySerialization.js
@@ -376,19 +376,16 @@ const queryOptionSwitches = [
     // property is used by function simplePropertyMatches.
     property: "resultType",
     desc:     "nsINavHistoryQueryOptions.resultType",
     matches:  simplePropertyMatches,
     runs:     [
       function(aQuery, aQueryOptions) {
         aQueryOptions.resultType = aQueryOptions.RESULTS_AS_URI;
       },
-      function(aQuery, aQueryOptions) {
-        aQueryOptions.resultType = aQueryOptions.RESULTS_AS_FULL_VISIT;
-      }
     ]
   },
   // excludeItems
   {
     property: "excludeItems",
     desc:     "nsINavHistoryQueryOptions.excludeItems",
     matches:  simplePropertyMatches,
     runs:     [
--- a/toolkit/components/places/tests/unit/test_history.js
+++ b/toolkit/components/places/tests/unit/test_history.js
@@ -39,31 +39,27 @@ add_task(async function test_execute() {
   var testURI = uri("http://mozilla.com");
   await PlacesTestUtils.addVisits(testURI);
 
   // now query for the visit, setting sorting and limit such that
   // we should retrieve only the visit we just added
   var options = histsvc.getNewQueryOptions();
   options.sortingMode = options.SORT_BY_DATE_DESCENDING;
   options.maxResults = 1;
-  // TODO: using full visit crashes in xpcshell test
-  // options.resultType = options.RESULTS_AS_FULL_VISIT;
   options.resultType = options.RESULTS_AS_VISIT;
   var query = histsvc.getNewQuery();
   var result = histsvc.executeQuery(query, options);
   var root = result.root;
   root.containerOpen = true;
   var cc = root.childCount;
   for (var i = 0; i < cc; ++i) {
     var node = root.getChild(i);
     // test node properties in RESULTS_AS_VISIT
     do_check_eq(node.uri, testURI.spec);
     do_check_eq(node.type, Ci.nsINavHistoryResultNode.RESULT_TYPE_URI);
-    // TODO: change query type to RESULTS_AS_FULL_VISIT and test this
-    // do_check_eq(node.transitionType, histsvc.TRANSITION_TYPED);
   }
   root.containerOpen = false;
 
   // add another visit for the same URI, and a third visit for a different URI
   var testURI2 = uri("http://google.com/");
   await PlacesTestUtils.addVisits(testURI);
   await PlacesTestUtils.addVisits(testURI2);