1 # Necko Lingo<!-- omit from toc -->
2 Words We Keep Throwing Around Like Internet Confetti!
5 - [Background Thread](#background-thread)
8 - [Child Process](#child-process)
9 - [Content Process](#content-process)
13 - [Eventsource](#eventsource)
14 - [Electrolysis](#electrolysis)
17 - [Fetch API](#fetch-api)
21 - [Happy eyeballs](#happy-eyeballs)
24 - [LoadInfo](#loadinfo)
25 - [Listener](#listener)
27 - [MainThread](#mainthread)
28 - [Mochitest](#mochitest)
30 - [neqo v/s Necko](#neqo-vs-necko)
35 - [Parent Process](#parent-process)
36 - [Principal](#principal)
39 - [OnStartRequest/OnDataAvailable/OnStopRequest/](#onstartrequestondataavailableonstoprequest)
45 - [Socket Process](#socket-process)
46 - [Socket Thread](#socket-thread)
47 - [SOCKS Proxy](#socks-proxy)
53 - [WebSocket](#websocket)
54 - [WebTransport](#webtransport)
56 - [Xpcshell-tests](#xpcshell-tests)
63 Any thread that is not main thread.\
64 Or this thread created [here](https://searchfox.org/mozilla-central/rev/23e7e940337d0e0b29aabe0080e4992d3860c940/ipc/glue/BackgroundImpl.cpp#880) for PBackground for IPC\
65 Usually threads either have a dedicated name but background threads might also refer to the background thread pool: [NS_DispatchBackgroundTask](https://searchfox.org/mozilla-central/rev/23e7e940337d0e0b29aabe0080e4992d3860c940/xpcom/threads/nsThreadUtils.cpp#516).
68 See [nsIChannel.idl](https://searchfox.org/mozilla-central/rev/bc6a50e6f08db0bb371ef7197c472555499e82c0/netwerk/base/nsIChannel.idl).
69 It usually means nsHttpChannel.
72 Usually a firefox forked process - not the main process.\
73 See [GeckoProcessTypes.h](https://searchfox.org/mozilla-central/source/__GENERATED__/xpcom/build/GeckoProcessTypes.h) for all process types in gecko.
76 Usually a firefox forked process running untrusted web content.
79 [DNS](https://developer.mozilla.org/en-US/docs/Glossary/DNS) over HTTPS.\
80 Refer [RFC 8484 - DNS Queries over HTTPS (DoH)](https://datatracker.ietf.org/doc/html/rfc8484).\
81 Resolves DNS names by using a HTTPS server.\
82 Refer [this link](https://firefox-source-docs.mozilla.org/networking/dns/dns-over-https-trr.html) for more details.
85 Web API for [server-sent-events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events). \
86 Refer [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/API/EventSource) for more details. \
87 Necko is responsible for maintaining part of this code along with DOM.
92 Also known as E10S (E + 10 chars + S).\
93 The process to make web content run in its own process.\
94 Extended by the ‘Fission’ project, which introduced isolation for sites (really [eTLD+1’s](https://developer.mozilla.org/en-US/docs/Glossary/eTLD)).\
95 Refer wiki [page](https://wiki.mozilla.org/Electrolysis) for more details.
98 [Fetch](https://fetch.spec.whatwg.org/) standard [aims](https://fetch.spec.whatwg.org/#goals) specifies standard for fetching resources across web. \
99 Fetch and [Fetch API](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API) slightly different things.
102 [Web API](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API) for fetching resources from the web.
103 The code is jointly maintained by DOM team and Necko team
106 Similar to Electrolysis, but different domains ([eTLD+1’s](https://developer.mozilla.org/en-US/docs/Glossary/eTLD)) get their own content process to avoid [Spectre attacks](https://meltdownattack.com/). \
107 Max 4 processes per [eTLD+1](https://developer.mozilla.org/en-US/docs/Glossary/eTLD). \
108 Iframes get isolated from the parent. \
109 Also referred to as origin isolation.
112 HTTP version: 0.9 / 1.0 / 1.1 / 2 / 3.
115 RFC 6555/8305 – connecting via IPv4 and IPv6 simultaneously. \
116 We implement this in a [different](https://searchfox.org/mozilla-central/rev/23e7e940337d0e0b29aabe0080e4992d3860c940/netwerk/protocol/http/DnsAndConnectSocket.cpp#202-206) way.
119 HTTP [Strict Transport Security](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Strict-Transport-Security). \
120 HSTS preload - a list of websites that will be upgraded to HTTPS without first needing a response.
124 Object containing information about about the load (who triggered the load, in which context, etc).
125 Refer [nsILoadContext](https://searchfox.org/mozilla-central/source/netwerk/base/nsILoadContextInfo.idl) for more details.
129 In async programming, we usually trigger an action, and set a listener to receive the result. \
130 In necko it’s most usually referring to the listener of a channel, which is an object implementing [nsIStreamListener](https://searchfox.org/mozilla-central/rev/bc6a50e6f08db0bb371ef7197c472555499e82c0/netwerk/base/nsIStreamListener.idl) and/or [nsIRequestObserver](https://searchfox.org/mozilla-central/rev/bc6a50e6f08db0bb371ef7197c472555499e82c0/netwerk/base/nsIRequestObserver.idl#14).
134 Every process has a MainThread, which is also the master event loop for the process. \
135 Many things are scoped to run on MainThread (DispatchToMainThread, etc).\
136 For content processes, MainThread is where normal JS content runs ([Worker](https://developer.mozilla.org/en-US/docs/Web/API/Worker) JavaScript runs on DOM Worker threads).
140 Browser tests, run with full UI. \
141 Refer [this](https://firefox-source-docs.mozilla.org/testing/mochitest-plain/index.html) for more details.
144 _neqo_ is the name of the Mozilla [QUIC](https://github.com/mozilla/neqo) stack.
145 Sometimes pronounced “knee-ko” or “neck-ou”, “knee-q-oo”.
147 _Necko_ is the project name of the Mozilla networking stack.
151 An acronym for the Network Security Services.
152 Refer [this](https://firefox-source-docs.mozilla.org/security/nss/index.html) for more details.
156 An acronym for [Netscape Portable Runtime](https://firefox-source-docs.mozilla.org/nspr/index.html)
160 Terminology used for referring the classes implementing the Observer design pattern. \
161 Refer the following interfaces for more details:
162 - [nsIObserver](https://searchfox.org/mozilla-central/source/xpcom/ds/nsIObserver.idl)
163 - [nsIObserverService](https://searchfox.org/mozilla-central/source/xpcom/ds/nsIObserverService.idl)
166 The PSM acronym may also be described as "Platform Security Module". \
167 Glue code between Gecko and NSS. \
168 Refer [this](https://wiki.mozilla.org/PSM:Topics) for more details.
172 The process that runs the main structure of the browser, including the UI.
173 It spawns the other processes needed for the browser. \
174 Generally it is unrestricted, while most other processes have some level of sandboxing of permissions applied. \
175 Before e10s, all code ran in the Parent Process.
178 Abstraction encapsulating security details of a web page.
179 Refer the following links for more details:
180 - [sec-necko-components](https://firefox-source-docs.mozilla.org/networking/sec-necko-components.html)
181 - [nsIPrincipal](https://searchfox.org/mozilla-central/source/caps/nsIPrincipal.idl)
184 Abbreviation for Off Main Thread. OMT refers to processing data in non-main thread.
185 There has been efforts in the past to move the processing of data to non-main thread to free up main thread resources.
188 ## OnStartRequest/OnDataAvailable/OnStopRequest/
189 - OnStartRequest is listener notification sent when the necko has parsed the status and the header.
190 - OnDataAvailable is a listener notification sent when necko has received the the data/body.
191 - OnStopRequest is a listener notification sent when necko has received the complete response.
192 - Refer to the following interface documentation for more details:
193 - [nsIRequestObserver](https://searchfox.org/mozilla-central/source/netwerk/base/nsIRequestObserver.idl)
194 - [nsIStreamListener.idl](https://searchfox.org/mozilla-central/source/netwerk/base/nsIStreamListener.idl)
197 An IETF transport protocol [RFC9000](https://datatracker.ietf.org/doc/html/rfc9000) primarily designed to carry HTTP/3, but now also used as a general-purpose Internet transport protocol for other workloads.
198 Implemented in RUST and maintained by [neqo](https://github.com/mozilla/neqo).
201 Race cache with network. Feature that will send a request to network and cache at the same time and take the first to resolve.
204 WIP project to move the actions of the socket thread into its own process for the purposes of isolation for security and stability (during crashes).
207 From the main process, a thread that handles opening and reading from the sockets for network communication. \
208 We also use socket thread in content process for PHttpBackgroundChannel.ipdl
211 Necko supports SOCKS proxy. \
212 Refer [RFC 1928](https://datatracker.ietf.org/doc/html/rfc1928) for more details.
215 Transport Layer Security. It’s implementation is maintained by NSS team.
218 Team process of bug intake, analysis and categorization.
221 Trusted recursive resolver.This is the name of our DoH implementation, as well as the name of the program that ensures DoH providers included in Firefox have agreed not to spy on users. \
222 Refer the following for more details:
223 - [Trusted_Recursive_Resolver](https://wiki.mozilla.org/Trusted_Recursive_Resolver)
224 - [DOH-resolver-policy](https://wiki.mozilla.org/Security/DOH-resolver-policy)
227 Server/client connections over TCP to pass data. A replacement for long-poll HTTP connection. \
228 Refer [RFC 6455](https://datatracker.ietf.org/doc/html/rfc6455) and [whatwg spec](https://websockets.spec.whatwg.org/).
232 A mechanism similar to WebSockets to transfer data between server and client, but built for HTTP/3; can also run over HTTP/2 (being implemented in gecko). \
234 - [MDN Documentation on WebTransport](https://developer.mozilla.org/en-US/docs/Web/API/WebTransport)
235 - [WebTransport RFC Draft](https://datatracker.ietf.org/doc/html/draft-ietf-webtrans-http3/)
238 Unit tests for testing our XPCOM code from JS context.
239 Runs without a UI in a simpler setup (typically single-process). \
240 Refer [firefox-source-docs](https://firefox-source-docs.mozilla.org/testing/xpcshell/index.html) for detailed explanation.
243 [XMLHttpRequest](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest). One way to perform AJAX, essentially a way to dynamically make network requests for use in the callers webpage, similar to Fetch.