summaryrefslogtreecommitdiffstats
path: root/toolkit/components/search/docs/SearchServiceHighlevelOverview.rst
diff options
context:
space:
mode:
Diffstat (limited to 'toolkit/components/search/docs/SearchServiceHighlevelOverview.rst')
-rw-r--r--toolkit/components/search/docs/SearchServiceHighlevelOverview.rst37
1 files changed, 15 insertions, 22 deletions
diff --git a/toolkit/components/search/docs/SearchServiceHighlevelOverview.rst b/toolkit/components/search/docs/SearchServiceHighlevelOverview.rst
index 1701f3a52b..36b76a9a6f 100644
--- a/toolkit/components/search/docs/SearchServiceHighlevelOverview.rst
+++ b/toolkit/components/search/docs/SearchServiceHighlevelOverview.rst
@@ -19,8 +19,8 @@ overview of the main components the ``SearchService`` interacts with most often.
Diagram
=======
-.. figure:: assets/search-service-diagram.png
- :scale: 85%
+.. figure:: assets/search-service-diagram-2.png
+ :scale: 30%
:align: center
Description of the Diagram
@@ -30,39 +30,33 @@ described by number 1 below.
1. When the user opens the Firefox Browser, the code starts to build the browser
UI components. During this startup phase, we have various systems making
- calls to the ``SearchService``. E.g. `browser.js <https://searchfox.org/mozilla-central/rev/cb6f8d7b1f1782b9d4b2ee7312de1dcc284aaf06/browser/base/content/browser.js#3797>`_
+ calls to the ``SearchService``. E.g. `browser.js <https://searchfox.org/mozilla-central/rev/47db1be98f8069b387ce07dcbea22d09f1854515/browser/base/content/browser.js#3325>`_
calls ``Services.search.getDefault`` to fetch the default Search Engine.
-2. The ``SearchService`` needs information from ``System Add-ons``,
+2. The ``SearchService`` needs information from ``Extension System``,
``SearchSettings``, and ``Remote Settings`` to build the correct engines in
the right order and to return the list of engines to its callers.
a) First, the ``SearchService`` makes a request for the search configuration.
- ``SearchService`` calls `SearchEngineSelector.fetchEngineConfiguration <https://searchfox.org/mozilla-central/rev/cb6f8d7b1f1782b9d4b2ee7312de1dcc284aaf06/toolkit/components/search/SearchService.sys.mjs#2247>`_
- which makes a call to `Remote Settings <https://searchfox.org/mozilla-central/rev/cb6f8d7b1f1782b9d4b2ee7312de1dcc284aaf06/toolkit/components/search/SearchEngineSelector.sys.mjs#129>`_
+ ``SearchService`` calls `SearchEngineSelector.fetchEngineConfiguration <https://searchfox.org/mozilla-central/rev/47db1be98f8069b387ce07dcbea22d09f1854515/toolkit/components/search/SearchService.sys.mjs#2602>`_
+ which makes a call to `Remote Settings <https://searchfox.org/mozilla-central/rev/47db1be98f8069b387ce07dcbea22d09f1854515/toolkit/components/search/SearchEngineSelector.sys.mjs#119>`_
for the search configuration. Remote Settings does not fetch the search
configuration from the remote database on startup. Instead Remote Settings
- tries to load the :searchfox:`search configuration dump file <services/settings/dumps/main/search-config.json>`
+ tries to load the :searchfox:`search configuration dump file <services/settings/dumps/main/search-config-v2.json>`
from its local database and if that is empty, it will load the dump file into
its local database. Only after startup will Remote Settings connect to the
remote database when necessary. By connecting after startup, it avoids
a potential network request that could delay startup.
- b) Second, the ``SearchService`` `fetches a JSON file <https://searchfox.org/mozilla-central/rev/cb6f8d7b1f1782b9d4b2ee7312de1dcc284aaf06/toolkit/components/search/SearchService.sys.mjs#1296-1297>`_
+ b) Second, the ``SearchService`` `fetches a JSON file <https://searchfox.org/mozilla-central/rev/47db1be98f8069b387ce07dcbea22d09f1854515/toolkit/components/search/SearchService.sys.mjs#1368>`_
from the `SearchSettings <https://searchfox.org/mozilla-central/source/toolkit/components/search/SearchSettings.sys.mjs>`_.
This JSON file contains Search Engine metadata that is saved on the user's
computer. It's information that helps the ``SearchService`` remember the
user's custom settings for the Search Engines.
- c) Third, the `System Add-ons <https://searchfox.org/mozilla-central/rev/cb6f8d7b1f1782b9d4b2ee7312de1dcc284aaf06/browser/components/extensions/parent/ext-chrome-settings-overrides.js#536>`_
+ c) Third, the `Extension System <https://searchfox.org/mozilla-central/rev/cb6f8d7b1f1782b9d4b2ee7312de1dcc284aaf06/browser/components/extensions/parent/ext-chrome-settings-overrides.js#536>`_
passes the extension data to the ``SearchService``. At this point, the
- ``SearchService`` only installs user installed search extensions. For the
- Application Provided engines we create those when ``SearchService`` calls `_makeEngineFromConfig <https://searchfox.org/mozilla-central/rev/3002762e41363de8ee9ca80196d55e79651bcb6b/toolkit/components/search/SearchService.sys.mjs#3421-3440>`_.
- Then ``_makeEngineFromConfig`` will create a new ``AddonSearchEngine``.
- When the `AddonSearchEngine.init <https://searchfox.org/mozilla-central/rev/3002762e41363de8ee9ca80196d55e79651bcb6b/toolkit/components/search/AddonSearchEngine.sys.mjs#83-87,89>`_
- method is called, it combines both the extension and search configuration
- data to create the correct engine for the user based on locale, region and
- other information.
+ ``SearchService`` only installs user installed search extensions.
After steps 2a, 2b, and 2c the ``SearchService`` has finished gathering
search engine data from ``System Add-ons``, ``SearchSettings``, and
@@ -70,7 +64,7 @@ described by number 1 below.
types of Search Engines.
3. The ``SearchService`` creates new instances of :searchfox:`SearchEngines <toolkit/components/search/SearchEngine.sys.mjs>`
- by making an `Add-on, Open Search, or Enterprise Policy Search Engine <https://firefox-source-docs.mozilla.org/toolkit/search/SearchEngines.html>`_.
+ by making an `App-Provided, Add-on, Open Search, or Enterprise Policy Search Engine <https://firefox-source-docs.mozilla.org/toolkit/search/SearchEngines.html>`_.
4. The ``SearchService`` returns the engines to the caller that requested it.
E.g. the ``SearchService`` passes the default Search Engine back to
@@ -78,8 +72,7 @@ described by number 1 below.
Updates
=======
-This page is up to date as of March 10, 2023. If the diagram or description
-becomes out of date, please find access to the
-``Search Service Diagram`` through the ``Firefox Search > Search Service
-Documentation`` folder in the shared drive or through this link `here <https://drive.google.com/file/d/1vKRRK87kIGt6xamHJuclkC04EKrS69Qw/view?usp=sharing>`_.
-Contributions are welcomed to keep this page up to date.
+This page is up to date as of April 18, 2024. If the diagram or description
+becomes out of date, please find access to the ``Search Service Diagram`` in
+``Firefox Search > Search Service Documentation`` folder in the Firefox Search
+shared drive. Contributions are welcomed to keep this page up to date.