Bug 1209916 - _hidden shouldn't be stored in both the cache and the metadata, r=adw.
authorFlorian Quèze <florian@queze.net>
Thu, 01 Oct 2015 15:04:53 +0200
changeset 265693 954f58e617043569a4a761df981386ff10989b95
parent 265692 7ac681cd9e4fadb5b6574d12d1a4126d24a67ef5
child 265694 81ed15cfdbfa2ab524bb05a7c356bc181f72758c
push id66003
push usercbook@mozilla.com
push dateFri, 02 Oct 2015 11:37:40 +0000
treeherdermozilla-inbound@3fd732d24f46 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersadw
bugs1209916
milestone44.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 1209916 - _hidden shouldn't be stored in both the cache and the metadata, r=adw.
toolkit/components/search/nsSearchService.js
toolkit/components/search/tests/xpcshell/data/search.json
--- a/toolkit/components/search/nsSearchService.js
+++ b/toolkit/components/search/nsSearchService.js
@@ -1394,18 +1394,16 @@ Engine.prototype = {
     return this.__file;
   },
   set _file(aValue) {
     this.__file = aValue;
   },
   // Set to true if the engine has a preferred icon (an icon that should not be
   // overridden by a non-preferred icon).
   _hasPreferredIcon: null,
-  // Whether the engine is hidden from the user.
-  _hidden: null,
   // The engine's name.
   _name: null,
   // The name of the charset used to submit the search terms.
   _queryCharset: null,
   // The engine's raw SearchForm value (URL string pointing to a search form).
   __searchForm: null,
   get _searchForm() {
     return this.__searchForm;
@@ -2169,17 +2167,16 @@ Engine.prototype = {
   _initWithJSON: function SRCH_ENG__initWithJSON(aJson) {
     this.__id = aJson._id;
     this._name = aJson._name;
     this._description = aJson.description;
     if (aJson._hasPreferredIcon == undefined)
       this._hasPreferredIcon = true;
     else
       this._hasPreferredIcon = false;
-    this._hidden = aJson._hidden;
     this._queryCharset = aJson.queryCharset || DEFAULT_QUERY_CHARSET;
     this.__searchForm = aJson.__searchForm;
     this.__installLocation = aJson._installLocation || SEARCH_APP_DIR;
     this._updateInterval = aJson._updateInterval || null;
     this._updateURL = aJson._updateURL || null;
     this._iconUpdateURL = aJson._iconUpdateURL || null;
     if (aJson._readOnly == undefined)
       this._readOnly = true;
@@ -2203,17 +2200,16 @@ Engine.prototype = {
   /**
    * Creates a JavaScript object that represents this engine.
    * @returns An object suitable for serialization as JSON.
    **/
   toJSON: function SRCH_ENG_toJSON() {
     var json = {
       _id: this._id,
       _name: this._name,
-      _hidden: this.hidden,
       description: this.description,
       __searchForm: this.__searchForm,
       _iconURL: this._iconURL,
       _iconMapObj: this._iconMapObj,
       _urls: this._urls
     };
 
     if (this._file instanceof Ci.nsILocalFile)
@@ -2396,24 +2392,21 @@ Engine.prototype = {
     return this._identifier = leaf.substring(0, ext);
   },
 
   get description() {
     return this._description;
   },
 
   get hidden() {
-    if (this._hidden === null)
-      this._hidden = engineMetadataService.getAttr(this, "hidden") || false;
-    return this._hidden;
+    return engineMetadataService.getAttr(this, "hidden") || false;
   },
   set hidden(val) {
     var value = !!val;
-    if (value != this._hidden) {
-      this._hidden = value;
+    if (value != this.hidden) {
       engineMetadataService.setAttr(this, "hidden", value);
       notifyAction(this, SEARCH_ENGINE_CHANGED);
     }
   },
 
   get iconURI() {
     if (this._iconURI)
       return this._iconURI;
--- a/toolkit/components/search/tests/xpcshell/data/search.json
+++ b/toolkit/components/search/tests/xpcshell/data/search.json
@@ -4,17 +4,16 @@
   "locale": "en-US",
   "directories": {
     "[profile]/searchplugins": {
       "lastModifiedTime": 1333761316000,
       "engines": [
         {
           "_id": "[app]/test-search-engine.xml",
           "_name": "Test search engine",
-          "_hidden": false,
           "description": "A test search engine (based on Google search)",
           "extensionID": "test-addon-id@mozilla.org",
           "__searchForm": "http://www.google.com/",
           "_iconURL": "data:image/png;base64,AAABAAEAEBAAAAEAGABoAwAAFgAAACgAAAAQAAAAIAAAAAEAGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADs9Pt8xetPtu9FsfFNtu%2BTzvb2%2B%2Fne4dFJeBw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2FP5GRuABAPkAA%2FwBAfkDAPAAAesAAN%2F%2F%2B%2Fz%2F%2F%2F64g1C5VwDMYwK8Yg7y5tz8%2Fv%2FV1PYKDOcAAP0DAf4AAf0AAfYEAOwAAuAAAAD%2F%2FPvi28ymXyChTATRrIb8%2F%2F3v8fk6P8MAAdUCAvoAAP0CAP0AAfYAAO4AAACAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAQAA",
           "_urls": [
             {
               "template": "http://suggestqueries.google.com/complete/search?output=firefox&client=firefox&hl={moz:locale}&q={searchTerms}",
               "rels": [