Bug 1164159 - Stop using a wrappedJSObject hack to access nsIBrowserSearchService.getDefaultEngineInfo. r=markh, a=sledru
authorFlorian Quèze <florian@queze.net>
Wed, 10 Jun 2015 11:18:08 +0200
changeset 275188 7fdd6ef122314c4998f1783919b81d1427e01b5f
parent 275187 6c7c1fd1f20291fcac5c7f1773fc0a5f215b1903
child 275189 1401e3301b8dc5d1bf1ba72d5bd6dfc7fd38edfd
push id863
push userraliiev@mozilla.com
push dateMon, 03 Aug 2015 13:22:43 +0000
treeherdermozilla-release@f6321b14228d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmarkh, sledru
bugs1164159
milestone40.0a2
Bug 1164159 - Stop using a wrappedJSObject hack to access nsIBrowserSearchService.getDefaultEngineInfo. r=markh, a=sledru
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
@@ -872,17 +872,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");