Bug 1164159 - Stop using a wrappedJSObject hack to access nsIBrowserSearchService.getDefaultEngineInfo, r=markh.
authorFlorian Quèze <florian@queze.net>
Wed, 10 Jun 2015 11:18:08 +0200
changeset 248119 027ffd03bae2e88b17e12076c9147fdf08673b4a
parent 248118 a01b1fbc61e9a91cb1c2ce17147a88ce15d10a9c
child 248120 d378f3087fcac59519e5cc874cebb1c4851ed8b1
push id60888
push userkwierso@gmail.com
push dateThu, 11 Jun 2015 01:38:38 +0000
treeherdermozilla-inbound@39e638ed06bf [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmarkh
bugs1164159
milestone41.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 1164159 - Stop using a wrappedJSObject hack to access nsIBrowserSearchService.getDefaultEngineInfo, r=markh.
netwerk/base/nsIBrowserSearchService.idl
toolkit/components/search/nsSearchService.js
toolkit/components/telemetry/TelemetryEnvironment.jsm
--- a/netwerk/base/nsIBrowserSearchService.idl
+++ b/netwerk/base/nsIBrowserSearchService.idl
@@ -248,17 +248,17 @@ interface nsIBrowserSearchInitObserver :
   /**
    * Called once initialization of the browser search service is complete.
    *
    * @param aStatus The status of that service.
    */
   void onInitComplete(in nsresult aStatus);
 };
 
-[scriptable, uuid(75731859-c7b1-4edf-8d1c-3d4d79a55d1d)]
+[scriptable, uuid(150ef720-bbe2-4169-b9f3-ef7ec0654ced)]
 interface nsIBrowserSearchService : nsISupports
 {
   /**
    * Start asynchronous initialization.
    *
    * The callback is triggered once initialization is complete, which may be
    * immediately, if initialization has already been completed by some previous
    * call to this method. The callback is always invoked asynchronously.
@@ -446,16 +446,25 @@ interface nsIBrowserSearchService : nsIS
 
   /**
    * The currently active search engine. May be null if there are no visible
    * search engines.
    */
   attribute nsISearchEngine currentEngine;
 
   /**
+   * Gets a representation of the default engine in an anonymized JSON
+   * string suitable for recording in the Telemetry environment.
+   *
+   * @return an object containing anonymized info about the default engine:
+   *         name, loadPath, submissionURL (for default engines).
+   */
+  jsval getDefaultEngineInfo();
+
+  /**
    * Determines if the provided URL represents results from a search engine, and
    * provides details about the match.
    *
    * The lookup mechanism checks whether the domain name and path of the
    * provided HTTP or HTTPS URL matches one of the known values for the visible
    * search engines.  The match does not depend on which of the schemes is used.
    * The expected URI parameter for the search terms must exist in the query
    * string, but other parameters are ignored.
--- a/toolkit/components/search/nsSearchService.js
+++ b/toolkit/components/search/nsSearchService.js
@@ -3264,20 +3264,16 @@ function SearchService() {
     LOG = DO_LOG;
 
   this._initObservers = Promise.defer();
 }
 
 SearchService.prototype = {
   classID: Components.ID("{7319788a-fe93-4db3-9f39-818cf08f4256}"),
 
-  get wrappedJSObject() {
-    return this;
-  },
-
   // The current status of initialization. Note that it does not determine if
   // initialization is complete, only if an error has been encountered so far.
   _initRV: Cr.NS_OK,
 
   // The boolean indicates that the initialization has started or not.
   _initStarted: null,
 
   // If initialization has not been completed yet, perform synchronous
--- a/toolkit/components/telemetry/TelemetryEnvironment.jsm
+++ b/toolkit/components/telemetry/TelemetryEnvironment.jsm
@@ -876,17 +876,17 @@ EnvironmentCache.prototype = {
       return;
     }
 
     // Make sure we have a settings section.
     this._currentEnvironment.settings = this._currentEnvironment.settings || {};
     // Update the search engine entry in the current environment.
     this._currentEnvironment.settings.defaultSearchEngine = this._getDefaultSearchEngine();
     this._currentEnvironment.settings.defaultSearchEngineData =
-      Services.search.wrappedJSObject.getDefaultEngineInfo();
+      Services.search.getDefaultEngineInfo();
   },
 
   /**
    * Update the default search engine value and trigger the environment change.
    */
   _onSearchEngineChange: function () {
     this._log.trace("_onSearchEngineChange");