From b2d8a02b7bc16d0c58285ed36519542e25c84476 Mon Sep 17 00:00:00 2001 From: Tim Taubert Date: Tue, 19 Aug 2014 14:50:06 +0200 Subject: [PATCH] Backed out changeset 836c52cc3c05 (bug 1040931) --- .../base/public/nsIBrowserSearchService.idl | 8 ++----- toolkit/components/search/nsSearchService.js | 22 +++---------------- .../search/tests/xpcshell/data/search.json | 1 - .../search/tests/xpcshell/test_json_cache.js | 1 - 4 files changed, 5 insertions(+), 27 deletions(-) diff --git a/netwerk/base/public/nsIBrowserSearchService.idl b/netwerk/base/public/nsIBrowserSearchService.idl index 8edcf3cfb37e..a6ffb187fa1b 100644 --- a/netwerk/base/public/nsIBrowserSearchService.idl +++ b/netwerk/base/public/nsIBrowserSearchService.idl @@ -239,7 +239,7 @@ interface nsIBrowserSearchInitObserver : nsISupports void onInitComplete(in nsresult aStatus); }; -[scriptable, uuid(4a4ce87d-7cb9-4975-a267-345f6a49bb8f)] +[scriptable, uuid(939d74a4-5b01-463c-80c7-4301f0c0f9ef)] interface nsIBrowserSearchService : nsISupports { /** @@ -327,17 +327,13 @@ interface nsIBrowserSearchService : nsISupports * @param url * The URL to which search queries should be sent. * Must not be null. - * - * @param extensionID - * Optional: The correct extensionID if called by an add-on. */ void addEngineWithDetails(in AString name, in AString iconURL, in AString alias, in AString description, in AString method, - in AString url, - in AString extensionID); + in AString url); /** * Un-hides all engines installed in the directory corresponding to diff --git a/toolkit/components/search/nsSearchService.js b/toolkit/components/search/nsSearchService.js index e04fdbbbb9fd..e3eb8494efd5 100644 --- a/toolkit/components/search/nsSearchService.js +++ b/toolkit/components/search/nsSearchService.js @@ -1127,8 +1127,6 @@ Engine.prototype = { _iconUpdateURL: null, /* Deferred serialization task. */ _lazySerializeTask: null, - /* The extension ID if added by an extension. */ - _extensionID: null, /** * Retrieves the data from the engine's file. If the engine's dataType is @@ -1675,7 +1673,7 @@ Engine.prototype = { */ _initFromMetadata: function SRCH_ENG_initMetaData(aName, aIconURL, aAlias, aDescription, aMethod, - aTemplate, aExtensionID) { + aTemplate) { ENSURE_WARN(!this._readOnly, "Can't call _initFromMetaData on a readonly engine!", Cr.NS_ERROR_FAILURE); @@ -1686,7 +1684,6 @@ Engine.prototype = { this.alias = aAlias; this._description = aDescription; this._setIcon(aIconURL, true); - this._extensionID = aExtensionID; this._serializeToFile(); }, @@ -1864,9 +1861,6 @@ Engine.prototype = { case "IconUpdateUrl": this._iconUpdateURL = child.textContent; break; - case "ExtensionID": - this._extensionID = child.textContent; - breakk; } } if (!this.name || (this._urls.length == 0)) @@ -2211,9 +2205,6 @@ Engine.prototype = { this._readOnly = false; this._iconURI = makeURI(aJson._iconURL); this._iconMapObj = aJson._iconMapObj; - if (aJson.extensionID) { - this._extensionID = aJson.extensionID; - } for (let i = 0; i < aJson._urls.length; ++i) { let url = aJson._urls[i]; let engineURL = new EngineURL(url.type || URLTYPE_SEARCH_HTML, @@ -2265,9 +2256,6 @@ Engine.prototype = { json._dataType = this._dataType; if (!this._readOnly || !aFilter) json._readOnly = this._readOnly; - if (this._extensionID) { - json.extensionID = this._extensionID; - } return json; }, @@ -2313,10 +2301,6 @@ Engine.prototype = { appendTextNode(MOZSEARCH_NS_10, "IconUpdateUrl", this._iconUpdateURL); appendTextNode(MOZSEARCH_NS_10, "SearchForm", this._searchForm); - if (this._extensionID) { - appendTextNode(MOZSEARCH_NS_10, "ExtensionID", this._extensionID); - } - for (var i = 0; i < this._urls.length; ++i) this._urls[i]._serializeToElement(doc, docElem); docElem.appendChild(doc.createTextNode("\n")); @@ -3969,7 +3953,7 @@ SearchService.prototype = { addEngineWithDetails: function SRCH_SVC_addEWD(aName, aIconURL, aAlias, aDescription, aMethod, - aTemplate, aExtensionID) { + aTemplate) { this._ensureInitialized(); if (!aName) FAIL("Invalid name passed to addEngineWithDetails!"); @@ -3982,7 +3966,7 @@ SearchService.prototype = { var engine = new Engine(getSanitizedFile(aName), SEARCH_DATA_XML, false); engine._initFromMetadata(aName, aIconURL, aAlias, aDescription, - aMethod, aTemplate, aExtensionID); + aMethod, aTemplate); this._addEngineToStore(engine); }, diff --git a/toolkit/components/search/tests/xpcshell/data/search.json b/toolkit/components/search/tests/xpcshell/data/search.json index 9d702bdd93ff..19f125356a1c 100644 --- a/toolkit/components/search/tests/xpcshell/data/search.json +++ b/toolkit/components/search/tests/xpcshell/data/search.json @@ -11,7 +11,6 @@ "_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%2Fne4dFJeBw0egA%2FfAJAfAA8ewBBegAAAAD%2B%2FPtft98Mp%2BwWsfAVsvEbs%2FQeqvF8xO7%2F%2F%2F63yqkxdgM7gwE%2FggM%2BfQA%2BegBDeQDe7PIbotgQufcMufEPtfIPsvAbs%2FQvq%2Bfz%2Bf%2F%2B%2B%2FZKhR05hgBBhQI8hgBAgAI9ewD0%2B%2Fg3pswAtO8Cxf4Kw%2FsJvvYAqupKsNv%2B%2Fv7%2F%2FP5VkSU0iQA7jQA9hgBDgQU%2BfQH%2F%2Ff%2FQ6fM4sM4KsN8AteMCruIqqdbZ7PH8%2Fv%2Fg6Nc%2Fhg05kAA8jAM9iQI%2BhQA%2BgQDQu6b97uv%2F%2F%2F7V8Pqw3eiWz97q8%2Ff%2F%2F%2F%2F7%2FPptpkkqjQE4kwA7kAA5iwI8iAA8hQCOSSKdXjiyflbAkG7u2s%2F%2B%2F%2F39%2F%2F7r8utrqEYtjQE8lgA7kwA7kwA9jwA9igA9hACiWSekVRyeSgiYSBHx6N%2F%2B%2Fv7k7OFRmiYtlAA5lwI7lwI4lAA7kgI9jwE9iwI4iQCoVhWcTxCmb0K%2BooT8%2Fv%2F7%2F%2F%2FJ2r8fdwI1mwA3mQA3mgA8lAE8lAE4jwA9iwE%2BhwGfXifWvqz%2B%2Ff%2F58u%2Fev6Dt4tr%2B%2F%2F2ZuIUsggA7mgM6mAM3lgA5lgA6kQE%2FkwBChwHt4dv%2F%2F%2F728ei1bCi7VAC5XQ7kz7n%2F%2F%2F6bsZkgcB03lQA9lgM7kwA2iQktZToPK4r9%2F%2F%2F9%2F%2F%2FSqYK5UwDKZAS9WALIkFn%2B%2F%2F3%2F%2BP8oKccGGcIRJrERILYFEMwAAuEAAdX%2F%2Ff7%2F%2FP%2B%2BfDvGXQLIZgLEWgLOjlf7%2F%2F%2F%2F%2F%2F9QU90EAPQAAf8DAP0AAfMAAOUDAtr%2F%2F%2F%2F7%2B%2Fu2bCTIYwDPZgDBWQDSr4P%2F%2Fv%2F%2F%2FP5GRuABAPkAA%2FwBAfkDAPAAAesAAN%2F%2F%2B%2Fz%2F%2F%2F64g1C5VwDMYwK8Yg7y5tz8%2Fv%2FV1PYKDOcAAP0DAf4AAf0AAfYEAOwAAuAAAAD%2F%2FPvi28ymXyChTATRrIb8%2F%2F3v8fk6P8MAAdUCAvoAAP0CAP0AAfYAAO4AAACAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAQAA", "_urls": [ diff --git a/toolkit/components/search/tests/xpcshell/test_json_cache.js b/toolkit/components/search/tests/xpcshell/test_json_cache.js index 379cc88df1b2..ea3457ae5642 100644 --- a/toolkit/components/search/tests/xpcshell/test_json_cache.js +++ b/toolkit/components/search/tests/xpcshell/test_json_cache.js @@ -183,7 +183,6 @@ let EXPECTED_ENGINE = { searchForm: "http://www.google.com/", type: Ci.nsISearchEngine.TYPE_MOZSEARCH, wrappedJSObject: { - _extensionID: "test-addon-id@mozilla.org", "_iconURL": "data:image/png;base64,AAABAAEAEBAAAAEAGABoAwAAFgAAACgAAAAQAAAAIAAAAAEAGAAAAAAAAAAAAAAAAAAAAAAAAAAAA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