Commit Graph
236 Commits
Author SHA1 Message Date
Sylvestre Ledru 9887c45a7e Bug 2036402 - Apply std::move in toolkit where values can be moved instead of copied r=credential-management-reviewers,ai-platform-reviewers,dimi,chutten
Differential Revision: https://phabricator.services.mozilla.com/D298093
2026-05-05 15:20:47 +00:00
Sylvestre Ledru 3baa4071fd Bug 2023419 - Remove remaining Emacs/Vim modelines from the source tree r=emilio,necko-reviewers,geckoview-reviewers,media-playback-reviewers,webidl,webrtc-reviewers,devtools-reviewers,places-reviewers,win-reviewers,firefox-style-system-reviewers,layout-reviewers,mstriemer,dshin,nchevobbe,padenot,ohall,handyman,valentin,mjf
Follow-up to bbcc7547a3 which cleaned up browser/. This strips the
same modelines from the rest of the tree, excluding paths listed in
tools/rewriting/ThirdPartyPaths.txt.

Differential Revision: https://phabricator.services.mozilla.com/D295577
2026-04-21 21:37:56 +00:00
André Bargull fa4ed7a8a1 Bug 2023878 - Part 2: Replace MOZ_BIG_ENDIAN uses with std::endian::big. r=sergesanspaille,media-playback-reviewers,profiler-reviewers,canaltinova,padenot,necko-reviewers,dom-storage-reviewers,jesup
Replaces `MOZ_BIG_ENDIAN()` with testing for `std::endian::native == std::endian::big`. In
statement contexts `if constexpr` is used to mark the condition as a compile-time constant.

The only remaining `MOZ_BIG_ENDIAN()` uses are in "modules/fdlibm/src/math_private.h"
and will get updated in parts 4-5.

Adds explicit includes to "mozilla/EndianUtils.h" for files which previously
only transitively included it through "mozilla/HashTable.h".

Differential Revision: https://phabricator.services.mozilla.com/D288177
2026-03-26 22:55:09 +00:00
Cristian Tuns af81ce1dcb Revert "Bug 2023878 - Part 7: Mark mozilla::byteswap as constexpr. r=sergesanspaille" for causing lint failures in nsPNGEncoder.cpp
This reverts commit 5d8e0746eb.

Revert "Bug 2023878 - Part 6: Remove MOZ_LITTLE_ENDIAN and MOZ_BIG_ENDIAN. r=sergesanspaille"

This reverts commit 634b3e1287.

Revert "Bug 2023878 - Part 5: Reimport fdlibm with updated patches. r=sergesanspaille"

This reverts commit 5ed2376e75.

Revert "Bug 2023878 - Part 4: Replace MOZ_LITTLE_ENDIAN and MOZ_BIG_ENDIAN in fdlibm. r=sergesanspaille"

This reverts commit 36dad49d5b.

Revert "Bug 2023878 - Part 3: Replace MOZ_LITTLE_ENDIAN uses with std::endian::little. r=sergesanspaille,media-playback-reviewers,padenot"

This reverts commit e89c61d064.

Revert "Bug 2023878 - Part 2: Replace MOZ_BIG_ENDIAN uses with std::endian::big. r=sergesanspaille,media-playback-reviewers,profiler-reviewers,canaltinova,padenot,necko-reviewers,dom-storage-reviewers,jesup"

This reverts commit be3c506fcf.

Revert "Bug 2023878 - Part 1: Use std::endian for mozilla::detail::Endianness. r=sergesanspaille"

This reverts commit dc96d4abe8.
2026-03-26 13:51:46 +00:00
André Bargull be3c506fcf Bug 2023878 - Part 2: Replace MOZ_BIG_ENDIAN uses with std::endian::big. r=sergesanspaille,media-playback-reviewers,profiler-reviewers,canaltinova,padenot,necko-reviewers,dom-storage-reviewers,jesup
Replaces `MOZ_BIG_ENDIAN()` with testing for `std::endian::native == std::endian::big`. In
statement contexts `if constexpr` is used to mark the condition as a compile-time constant.

The only remaining `MOZ_BIG_ENDIAN()` uses are in "modules/fdlibm/src/math_private.h"
and will get updated in parts 4-5.

Adds explicit includes to "mozilla/EndianUtils.h" for files which previously
only transitively included it through "mozilla/HashTable.h".

Differential Revision: https://phabricator.services.mozilla.com/D288177
2026-03-26 13:30:13 +00:00
Nika Layzell 5f0f9dd22a Bug 2020817 - Part 4: Annotate & clean up nsACString callers of BeginReading/Data, r=xpcom-reviewers,media-playback-reviewers,webrtc-reviewers,cookie-reviewers,profiler-reviewers,win-reviewers,dom-storage-reviewers,permissions-reviewers,toolkit-telemetry-reviewers-rotation,layout-reviewers,dom-worker-reviewers,gfx-reviewers,webgpu-reviewers,necko-reviewers,dom-core,smaug,handyman,emilio,pehrsons,kershaw,timhuang,edenchuang,padenot,bradwerth
This is a large number of largely mechanical changes. When possible, the code
was called to directly call `.get()` instead, performing the assertions
manually. In many places PromiseFlatCString() calls were added to dynamically
copy the strings into null terminated buffers if the string was not null
terminated.

Differential Revision: https://phabricator.services.mozilla.com/D286158
2026-03-25 08:23:04 +00:00
Serban Stanca 524047f500 Revert "Bug 2023878 - Part 7: Mark mozilla::byteswap as constexpr. r=sergesanspaille" for causing bp-nu bustages in IndexedDatabase.cpp.
This reverts commit c57492e1b5.

This reverts commit 77b57f4535.

This reverts commit 1d3109348c.

This reverts commit 024dd209d8.

This reverts commit d8d935ef4c.

This reverts commit 9970613aaf.

This reverts commit e98217faf0.
2026-03-25 05:14:53 +00:00
André Bargull 9970613aaf Bug 2023878 - Part 2: Replace MOZ_BIG_ENDIAN uses with std::endian::big. r=sergesanspaille,media-playback-reviewers,profiler-reviewers,canaltinova,padenot
Replaces `MOZ_BIG_ENDIAN()` with testing for `std::endian::native == std::endian::big`. In
statement contexts `if constexpr` is used to mark the condition as a compile-time constant.

The only remaining `MOZ_BIG_ENDIAN()` uses are in "modules/fdlibm/src/math_private.h"
and will get updated in parts 4-5.

Adds explicit includes to "mozilla/EndianUtils.h" for files which previously
only transitively included it through "mozilla/HashTable.h".

Differential Revision: https://phabricator.services.mozilla.com/D288177
2026-03-25 03:32:58 +00:00
agoloman d3fd48a439 Revert "Bug 2023878 - Part 7: Mark mozilla::byteswap as constexpr. r=sergesanspaille" for causing build bustages @EHABIStackWalk.cpp.
This reverts commit b87ffb6683.

Revert "Bug 2023878 - Part 6: Remove MOZ_LITTLE_ENDIAN and MOZ_BIG_ENDIAN. r=sergesanspaille"

This reverts commit e262fd1d8a.

Revert "Bug 2023878 - Part 5: Reimport fdlibm with updated patches. r=sergesanspaille"

This reverts commit 8a7a4af30f.

Revert "Bug 2023878 - Part 4: Replace MOZ_LITTLE_ENDIAN and MOZ_BIG_ENDIAN in fdlibm. r=sergesanspaille"

This reverts commit fc0465acf1.

Revert "Bug 2023878 - Part 3: Replace MOZ_LITTLE_ENDIAN uses with std::endian::little. r=sergesanspaille,media-playback-reviewers,padenot"

This reverts commit 965507e925.

Revert "Bug 2023878 - Part 2: Replace MOZ_BIG_ENDIAN uses with std::endian::big. r=sergesanspaille,media-playback-reviewers,profiler-reviewers,canaltinova,padenot"

This reverts commit 43b7f808c4.

Revert "Bug 2023878 - Part 1: Use std::endian for mozilla::detail::Endianness. r=sergesanspaille"

This reverts commit 75f5c71b30.
2026-03-24 16:06:47 +00:00
André Bargull 43b7f808c4 Bug 2023878 - Part 2: Replace MOZ_BIG_ENDIAN uses with std::endian::big. r=sergesanspaille,media-playback-reviewers,profiler-reviewers,canaltinova,padenot
Replaces `MOZ_BIG_ENDIAN()` with testing for `std::endian::native == std::endian::big`. In
statement contexts `if constexpr` is used to mark the condition as a compile-time constant.

The only remaining `MOZ_BIG_ENDIAN()` uses are in "modules/fdlibm/src/math_private.h"
and will get updated in parts 4-5.

Adds explicit includes to "mozilla/EndianUtils.h" for files which previously
only transitively included it through "mozilla/HashTable.h".

Differential Revision: https://phabricator.services.mozilla.com/D288177
2026-03-24 15:22:09 +00:00
Tim Huang c61a9bda48 Bug 2017060 - Cache frequently read preferences in URL Classifier real-time lookup code. r=dimi
Replace repeated Preferences::GetBool/GetCString calls with cached values
updated via Preferences::RegisterCallbackAndCall()

The cached values are lazily initialized on first access and cleaned up via
RunOnShutdown.

Differential Revision: https://phabricator.services.mozilla.com/D284520
2026-02-24 09:19:43 +00:00
Tim Huang 2e68af85cd Bug 2010020 - Part 2: Implement the real time look up infra. r=dimi
Introduce real-time SafeBrowsing lookup infrastructure. Refactor hash completion
handling by extracting nsUrlClassifierHashCompleterBase as a common base class.
Add nsUrlClassifierRealTimeLookupHandler to manage real-time lookups,
which first checks the global cache then falls back to local list lookup with
hash completion.

Differential Revision: https://phabricator.services.mozilla.com/D279882
2026-02-18 19:21:20 +00:00
Cristina Horotan dc3868012a Revert "Bug 2010024, Bug 2010023, Bug 2010022, Bug 2010020 - Add a Nimbus feature to control SafeBrowsing V5 real-time mode. r=dimi" for causing bc failures on browser_realtime_lookup.js
This reverts commit 25f0b01591.

Revert "Bug 2010023 - Add telemetry for measuring the real-time traffic. r=dimi"

This reverts commit 3e5168aef5.

Revert "Bug 2010022 - Part 2: Add tests. r=dimi"

This reverts commit 9ab390fdd7.

Revert "Bug 2010022 - Part 1: Introduce the RealTimeRequestSimulator. r=dimi"

This reverts commit 718aba4a26.

Revert "Bug 2010020 - Part 3: Add a test. r=dimi"

This reverts commit 5f58730271.

Revert "Bug 2010020 - Part 2: Implement the real time look up infra. r=dimi"

This reverts commit a110d83e75.

Revert "Bug 2010020 - Part 1: Introduce the UrlClassifierFeatureGlobalCache. r=dimi"

This reverts commit 3ee12f3d0e.
2026-02-18 14:14:42 +00:00
Tim Huang a110d83e75 Bug 2010020 - Part 2: Implement the real time look up infra. r=dimi
Introduce real-time SafeBrowsing lookup infrastructure. Refactor hash completion
handling by extracting nsUrlClassifierHashCompleterBase as a common base class.
Add nsUrlClassifierRealTimeLookupHandler to manage real-time lookups,
which first checks the global cache then falls back to local list lookup with
hash completion.

Differential Revision: https://phabricator.services.mozilla.com/D279882
2026-02-18 11:39:28 +00:00
Cosmin Sabou a9088758ea Revert "Bug 2010020, Bug 2010022, Bug 2010023, Bug 2010024 - Add a Nimbus feature to control SafeBrowsing V5 real-time mode. r=dimi" for causing build bustages
This reverts commit e7a7788a00.

Revert "Bug 2010023 - Add telemetry for measuring the real-time traffic. r=dimi"

This reverts commit a9c96eeafe.

Revert "Bug 2010022 - Part 2: Add tests. r=dimi"

This reverts commit 849d25e194.

Revert "Bug 2010022 - Part 1: Introduce the RealTimeRequestSimulator. r=dimi"

This reverts commit ad5e64a055.

Revert "Bug 2010020 - Part 3: Add a test. r=dimi"

This reverts commit 28106bbbec.

Revert "Bug 2010020 - Part 2: Implement the real time look up infra. r=dimi"

This reverts commit d2b89d5a1b.

Revert "Bug 2010020 - Part 1: Introduce the UrlClassifierFeatureGlobalCache. r=dimi"

This reverts commit 178852ef74.
2026-02-17 17:08:00 +00:00
Tim Huang d2b89d5a1b Bug 2010020 - Part 2: Implement the real time look up infra. r=dimi
Introduce real-time SafeBrowsing lookup infrastructure. Refactor hash completion
handling by extracting nsUrlClassifierHashCompleterBase as a common base class.
Add nsUrlClassifierRealTimeLookupHandler to manage real-time lookups,
which first checks the global cache then falls back to local list lookup with
hash completion.

Differential Revision: https://phabricator.services.mozilla.com/D279882
2026-02-17 16:32:33 +00:00
Tim Huang a70f1c88ea Bug 2008508 - Part 1: Use a table to determine the table directory. r=dimi
Differential Revision: https://phabricator.services.mozilla.com/D278454
2026-01-13 14:55:31 +00:00
serge-sans-paille 9b6eb9c7f9 Bug 1996048 - Remove unused inclusion of UniquePtr.h or UniquePtrExtensions.h r=emilio,media-playback-reviewers,profiler-reviewers,win-reviewers,firefox-style-system-reviewers,firefox-svg-reviewers,layout-reviewers,gstoll,mstange,TYLin,chunmin
Differential Revision: https://phabricator.services.mozilla.com/D269782
2025-10-24 06:50:27 +00:00
serge-sans-paille 7662b3abdc Bug 1994397 - Remove obsolete Unused.h header r=emilio,tschuster,geckoview-reviewers,extension-reviewers,application-update-reviewers,media-playback-reviewers,webrtc-reviewers,cookie-reviewers,places-reviewers,profiler-reviewers,win-reviewers,dom-storage-reviewers,permissions-reviewers,profiles-reviewers,toolkit-telemetry-reviewers,firefox-style-system-reviewers,firefox-svg-reviewers,layout-reviewers,timhuang,gstoll,TravisLong,bytesized,mstange,karlt,robwu,pehrsons,m_kato,jari,jhirsch
It is replaced by a standard-conforming cast to (void) which is
understood the same by the compiler.

In some cases this could be replaced by `[[maybe_unused]]` but for
expression whose value is ignored, this requires storing to a temporary
variable first, so not going that way.

One notable change is that marking an object of type already_AddRefed as
unused used to implicitly leak memory. This is now made explicit.

Most of the heavy lifting was done through:

    $ git grep -l '\<Unused\> <<' | xargs sed -i -e 's/Unused << /(void)/g'
    $ git grep -l mozilla/Unused.h | xargs sed -i -e '/mozilla\/Unused.h/ d'

Differential Revision: https://phabricator.services.mozilla.com/D268706
2025-10-21 19:36:01 +00:00
Cristina Horotan 8a1b1970b7 Revert "Bug 1994397 - Remove obsolete Unused.h header r=emilio,tschuster,geckoview-reviewers,extension-reviewers,application-update-reviewers,media-playback-reviewers,webrtc-reviewers,cookie-reviewers,places-reviewers,profiler-reviewers,win-reviewers,dom-storage-reviewers,permissions-reviewers,profiles-reviewers,toolkit-telemetry-reviewers,firefox-style-system-reviewers,firefox-svg-reviewers,layout-reviewers,timhuang,gstoll,TravisLong,bytesized,mstange,karlt,robwu,pehrsons,m_kato,jari,jhirsch" for causing Gtest failures on AlreadyAddRefed.h
This reverts commit e98adca292.
2025-10-21 16:16:29 +00:00
serge-sans-paille e98adca292 Bug 1994397 - Remove obsolete Unused.h header r=emilio,tschuster,geckoview-reviewers,extension-reviewers,application-update-reviewers,media-playback-reviewers,webrtc-reviewers,cookie-reviewers,places-reviewers,profiler-reviewers,win-reviewers,dom-storage-reviewers,permissions-reviewers,profiles-reviewers,toolkit-telemetry-reviewers,firefox-style-system-reviewers,firefox-svg-reviewers,layout-reviewers,timhuang,gstoll,TravisLong,bytesized,mstange,karlt,robwu,pehrsons,m_kato,jari,jhirsch
It is replaced by a standard-conforming cast to (void) which is
understood the same by the compiler.

In some cases this could be replaced by `[[maybe_unused]]` but for
expression whose value is ignored, this requires storing to a temporary
variable first, so not going that way.

One notable change is that marking an object of type already_AddRefed as
unused used to implicitly leak memory. This is now made explicit.

Most of the heavy lifting was done through:

    $ git grep -l '\<Unused\> <<' | xargs sed -i -e 's/Unused << /(void)/g'
    $ git grep -l mozilla/Unused.h | xargs sed -i -e '/mozilla\/Unused.h/ d'

Differential Revision: https://phabricator.services.mozilla.com/D268706
2025-10-21 15:05:17 +00:00
Cristina Horotan aab924e90d Revert "Bug 1994397 - Remove obsolete Unused.h header r=emilio,tschuster,geckoview-reviewers,extension-reviewers,application-update-reviewers,media-playback-reviewers,webrtc-reviewers,cookie-reviewers,places-reviewers,profiler-reviewers,win-reviewers,dom-storage-reviewers,permissions-reviewers,profiles-reviewers,toolkit-telemetry-reviewers,firefox-style-system-reviewers,firefox-svg-reviewers,layout-reviewers,timhuang,gstoll,TravisLong,bytesized,mstange,karlt,robwu,pehrsons,m_kato,jari,jhirsch" for causing build bustage at nsBrowserApp.cpp
This reverts commit fd0ffa193c.
2025-10-21 10:44:13 +00:00
serge-sans-paille fd0ffa193c Bug 1994397 - Remove obsolete Unused.h header r=emilio,tschuster,geckoview-reviewers,extension-reviewers,application-update-reviewers,media-playback-reviewers,webrtc-reviewers,cookie-reviewers,places-reviewers,profiler-reviewers,win-reviewers,dom-storage-reviewers,permissions-reviewers,profiles-reviewers,toolkit-telemetry-reviewers,firefox-style-system-reviewers,firefox-svg-reviewers,layout-reviewers,timhuang,gstoll,TravisLong,bytesized,mstange,karlt,robwu,pehrsons,m_kato,jari,jhirsch
It is replaced by a standard-conforming cast to (void) which is
understood the same by the compiler.

In some cases this could be replaced by `[[maybe_unused]]` but for
expression whose value is ignored, this requires storing to a temporary
variable first, so not going that way.

One notable change is that marking an object of type already_AddRefed as
unused used to implicitly leak memory. This is now made explicit.

Most of the heavy lifting was done through:

    $ git grep -l '\<Unused\> <<' | xargs sed -i -e 's/Unused << /(void)/g'
    $ git grep -l mozilla/Unused.h | xargs sed -i -e '/mozilla\/Unused.h/ d'

Differential Revision: https://phabricator.services.mozilla.com/D268706
2025-10-21 09:44:11 +00:00
Narcis Beleuzu e1e6bbb1c9 Revert "Bug 1994397 - Remove obsolete Unused.h header r=emilio,tschuster,geckoview-reviewers,extension-reviewers,application-update-reviewers,media-playback-reviewers,webrtc-reviewers,cookie-reviewers,places-reviewers,profiler-reviewers,win-reviewers,dom-storage-reviewers,permissions-reviewers,profiles-reviewers,toolkit-telemetry-reviewers,firefox-style-system-reviewers,firefox-svg-reviewers,layout-reviewers,timhuang,gstoll,TravisLong,bytesized,mstange,karlt,robwu,pehrsons,m_kato,jari,jhirsch" for causing bustages on Document.cpp
This reverts commit b23c15e927.
2025-10-21 06:34:58 +00:00
serge-sans-paille b23c15e927 Bug 1994397 - Remove obsolete Unused.h header r=emilio,tschuster,geckoview-reviewers,extension-reviewers,application-update-reviewers,media-playback-reviewers,webrtc-reviewers,cookie-reviewers,places-reviewers,profiler-reviewers,win-reviewers,dom-storage-reviewers,permissions-reviewers,profiles-reviewers,toolkit-telemetry-reviewers,firefox-style-system-reviewers,firefox-svg-reviewers,layout-reviewers,timhuang,gstoll,TravisLong,bytesized,mstange,karlt,robwu,pehrsons,m_kato,jari,jhirsch
It is replaced by a standard-conforming cast to (void) which is
understood the same by the compiler.

In some cases this could be replaced by `[[maybe_unused]]` but for
expression whose value is ignored, this requires storing to a temporary
variable first, so not going that way.

One notable change is that marking an object of type already_AddRefed as
unused used to implicitly leak memory. This is now made explicit.

Most of the heavy lifting was done through:

    $ git grep -l '\<Unused\> <<' | xargs sed -i -e 's/Unused << /(void)/g'
    $ git grep -l mozilla/Unused.h | xargs sed -i -e '/mozilla\/Unused.h/ d'

Differential Revision: https://phabricator.services.mozilla.com/D268706
2025-10-21 06:01:36 +00:00
Tim Huang 1e7e26cb3b Bug 1975198 - Implement telemetry for UrlClassifier lookup and completion. r=dimi
Differential Revision: https://phabricator.services.mozilla.com/D264387
2025-09-17 08:07:32 +00:00
Cristina Horotan 3337414bdf Revert "Bug 1975198 - Implement telemetry for UrlClassifier lookup and completion. r=dimi" for causing mochitest failures on test_lookup_completion_telemetry.html
This reverts commit 1cc04a34f6.
2025-09-16 15:34:46 +00:00
Tim Huang 1cc04a34f6 Bug 1975198 - Implement telemetry for UrlClassifier lookup and completion. r=dimi
Differential Revision: https://phabricator.services.mozilla.com/D264387
2025-09-16 13:47:54 +00:00
Cristina Horotan 3c4a5b0b73 Revert "Bug 1975198 - Implement telemetry for UrlClassifier lookup and completion. r=dimi" for causing mochitest failures on test_lookup_completion_telemetry.html
This reverts commit 7ca3f95c1f.
2025-09-16 09:58:02 +00:00
Tim Huang 7ca3f95c1f Bug 1975198 - Implement telemetry for UrlClassifier lookup and completion. r=dimi
Differential Revision: https://phabricator.services.mozilla.com/D264387
2025-09-16 08:49:30 +00:00
Tim Huang 220a1a7667 Bug 1986851 - Use Google4 folder for Google5 provider. r=dimi
Differential Revision: https://phabricator.services.mozilla.com/D263706
2025-09-08 08:16:50 +00:00
Tim Huang ad5902a6cf Bug 1956920 - Delay the CRC32 verification on .vlp files to the list update. r=dimi
To improve the startup performance, we delay the CRC32 verfication to
the time before we send the list update to the SafeBrowsing server.

Differential Revision: https://phabricator.services.mozilla.com/D249039
2025-05-15 10:03:54 +00:00
iulian moraru a3a8f191fd Revert "Bug 1956920 - Delay the CRC32 verification on .vlp files to the list update. r=dimi" for causing multiple failures.
This reverts commit 2ab9b96ca9.
2025-05-15 00:36:24 +00:00
Tim Huang 2ab9b96ca9 Bug 1956920 - Delay the CRC32 verification on .vlp files to the list update. r=dimi
To improve the startup performance, we delay the CRC32 verfication to
the time before we send the list update to the SafeBrowsing server.

Differential Revision: https://phabricator.services.mozilla.com/D249039
2025-05-14 21:16:32 +00:00
Florian Quèze 05a898a532 Bug 1935420 - Migrate histograms to use Glean APIs for URLCLASSIFIER_*, r=chutten.
Differential Revision: https://phabricator.services.mozilla.com/D235343
2025-01-27 13:47:12 +00:00
serge-sans-paille 6bddb5135b Bug 1924513 - Remove code guarded by MOZ_SAFEBROWSING_DUMP_FAILED_UPDATES r=dimi
Differential Revision: https://phabricator.services.mozilla.com/D225508
2024-10-15 08:37:06 +00:00
Tim Huang 9542ba389c Bug 1894380 - Queue the AsyncApplyUpdate request if there is one executing. r=dimi
Differential Revision: https://phabricator.services.mozilla.com/D220249
2024-09-12 16:21:19 +00:00
Tim Huang d2aa85b46c Bug 1911932 - Move the ApplyUpdate() in Classifier::UpdateTableV4() to verify the issue. r=dimi
Differential Revision: https://phabricator.services.mozilla.com/D220255
2024-08-27 18:45:11 +00:00
Nika Layzell 1582a62a38 Bug 1542802 - Part 1: Replace LazyIdleThread with a thin wrapper around nsThreadPool, r=jesup,gstoll
This does not reduce the number of threads we end up using in these
cases, but simplifies the complex implementation substantially by
relying on the idle thread lifetime management logic from nsThreadPool.

The nsISerialEventTarget implementation is maintained by wrapping the
nsThreadPool with a TaskQueue.

As a result of using these more reliable backing implementations, the
type is now also safe to use from any thread, rather than requiring
dispatches to all occur from the creator thread.

Unfortunately, this required some changes to the
UntrustedModulesProcessor, which was relying on the ability to fetch the
PRThread* (and from that the HANDLE) from the lazy thread in order to
perform priority changes on it. This was fixed by using a
nsIThreadPoolListener to watch the thread being created and destroyed,
and manually record a HANDLE to the thread which can be used for these
priority changes.

Differential Revision: https://phabricator.services.mozilla.com/D168017
2023-03-02 15:52:32 +00:00
Csoregi Natalia d542110f53 Backed out changeset eafcabbf729b (bug 1542802) for causing Gtest crashes. CLOSED TREE 2023-02-03 00:03:53 +02:00
Nika Layzell b735298e12 Bug 1542802 - Replace LazyIdleThread with a thin wrapper around nsThreadPool, r=jesup,gstoll
This does not reduce the number of threads we end up using in these
cases, but simplifies the complex implementation substantially by
relying on the idle thread lifetime management logic from nsThreadPool.

The nsISerialEventTarget implementation is maintained by wrapping the
nsThreadPool with a TaskQueue.

As a result of using these more reliable backing implementations, the
type is now also safe to use from any thread, rather than requiring
dispatches to all occur from the creator thread.

Unfortunately, this required some changes to the
UntrustedModulesProcessor, which was relying on the ability to fetch the
PRThread* (and from that the HANDLE) from the lazy thread in order to
perform priority changes on it. This was fixed by using a
nsIThreadPoolListener to watch the thread being created and destroyed,
and manually record a HANDLE to the thread which can be used for these
priority changes.

Differential Revision: https://phabricator.services.mozilla.com/D168017
2023-02-02 19:43:31 +00:00
Alex Franchuk d76a98ef04 Bug 1342901 - Replace SplitTables by nsTSubstring::Split. r=dimi
This replaces two instances where string splitting was done inline with calls to
nsTSubstring::Split.

Differential Revision: https://phabricator.services.mozilla.com/D166206
2023-01-09 15:50:22 +00:00
Tim Huang 1e5e040a2c Bug 1777600 - Part 3: Get noise prefixes by index instead of the entire prefix set. r=dimi
In Classifier::ReadNoiseEntries(), we used to get the entire prefix set
in order to get noise prefixes. This patch improves it by getting noise
prefixes by index. So, we don't need the entire prefix set.

The patch introduces new functions in LookupCacheV2, V4 and
VariableLengthPrefixSet to allow getting target prefix by index. Also,
we need to inroduces new functions to get the length of the prefix set
to run the noise pick up algorithm.

Differential Revision: https://phabricator.services.mozilla.com/D161771
2022-11-15 14:37:00 +00:00
Stanca Serban 14c35efcc6 Backed out 3 changesets (bug 1777600) for causing safebrowsing crashes. a=backout
Backed out changeset be9e99eac13c (bug 1777600)
Backed out changeset ccaf8757d382 (bug 1777600)
Backed out changeset c0624a8aa7c2 (bug 1777600)
2022-11-15 11:53:28 +02:00
Tim Huang e9cb2660cc Bug 1777600 - Part 3: Get noise prefixes by index instead of the entire prefix set. r=dimi
In Classifier::ReadNoiseEntries(), we used to get the entire prefix set
in order to get noise prefixes. This patch improves it by getting noise
prefixes by index. So, we don't need the entire prefix set.

The patch introduces new functions in LookupCacheV2, V4 and
VariableLengthPrefixSet to allow getting target prefix by index. Also,
we need to inroduces new functions to get the length of the prefix set
to run the noise pick up algorithm.

Differential Revision: https://phabricator.services.mozilla.com/D161771
2022-11-14 17:40:43 +00:00
Simon Giesecke ab6f0a7137 Bug 1650145 - Replace all value uses of Empty[C]String by 0-length _ns literals. r=froydnj,geckoview-reviewers,agi
Differential Revision: https://phabricator.services.mozilla.com/D82325
2020-09-23 15:17:15 +00:00
Andrea Marchesini 50a6d0f5ed Bug 1650950 - Rename blacklist, whitelist, and skiplist in the anti-tracking and url-classifier code, r=dimi
Differential Revision: https://phabricator.services.mozilla.com/D82497
2020-07-07 16:17:11 +00:00
Simon Giesecke a69d79b6db Bug 1648010 - Replace uses of NS_LITERAL_STRING/NS_LITERAL_CSTRING macros by _ns literals. r=geckoview-reviewers,jgilbert,agi,hsivonen,froydnj
Differential Revision: https://phabricator.services.mozilla.com/D80860
2020-07-01 08:29:29 +00:00
Simon Giesecke c75f3b56b2 Bug 1626570 - Improve handling of copying arrays in toolkit/components/url-classifier/. r=gcp
Differential Revision: https://phabricator.services.mozilla.com/D72328
2020-04-30 09:40:24 +00:00
Dimi Lee a0881e4b7c Bug 1524873 - Enable SafeBrowsing in Safe Mode. r=gcp
This patch enables SafeBrowsing in Safe Mode because features based
on SafeBrowsing are essential for Firefox(For example, Enhanced Tracking Protection).

Since Safe Browsing update is nondeterministic, we disable periodical
SafeBrowsing update to make troubleshooting easier. Manually trigger an
update via about:classifier is still enabled.

Last, SafeBrowsing tables provided by Google will be ignored in Safe
Mode to ensure the SafeBrowsing warnings are update-to-date.

Differential Revision: https://phabricator.services.mozilla.com/D62708
2020-02-18 10:48:47 +00:00