This makes it possible to use different lists for tracking protection
and for the features that rely on tracking annotations.
Differential Revision: https://phabricator.services.mozilla.com/D2484
--HG--
extra : moz-landing-system : lando
This should not change anything since we were using nsAutoPtrs properly,
but we may as well clean this up given the recent move to smart pointers
for everything.
MozReview-Commit-ID: FWS54SYNiBm
--HG--
extra : rebase_source : ade51b42049782e62f661c84b6d701f9ec33cc77
Explicitly specify the arguments to copy to avoid making a copy of
a dangling `this` pointer.
Convert nsUrlClassifierDBService::mClassifier to a RefPtr since
the update closure might need to continue to access its members
after it's been released by the main thread.
MozReview-Commit-ID: CPio3n9MmsK
--HG--
extra : rebase_source : d7a8b207336209ee37441f3429bc608140e404ae
Replace raw pointers to LookupResult with RefPtrs and eplace the
nsAutoPtr objects + raw pointers params with UniquePtrs.
Also remove unnecessarily paranoid OOM checks when creating single
LookupResult objects since those are pretty small.
MozReview-Commit-ID: G85RNnAat6H
--HG--
extra : rebase_source : a8f6a1ff1e24663d428c8d894cb624e1c67e1bd3
Some of the objects were kept in UniquePtr and nsAutoPtr but that
seemed unnecessary complexity given that we can simply use RefPtr
everywhere.
It's also possible to make all of the CacheResult arrays const
since we don't ever modify the elements once they are added.
MozReview-Commit-ID: 5OlcbkQLrGb
--HG--
extra : rebase_source : d58963443d97296236056c69881846f8e67ee3e9
This will prevent our holding on to this pointer incorrectly in the
future.
MozReview-Commit-ID: H8ueIOK1qAK
--HG--
extra : rebase_source : 937e9c702c5109b6dfc1684392a1204d8a1edc49
I tried to make TableUpdateArray point to const TableUpdate objects
everywhere but there were two problems:
- HashStore::ApplyUpdate() triggers a few Merge() calls which include
sorting the underlying TableUpdate object first.
- LookupCacheV4::ApplyUpdate() calls TableUpdateV4::NewChecksum() when the
checksum is missing and that sets mChecksum.
MozReview-Commit-ID: LIhJcoxo7e7
--HG--
extra : rebase_source : f6ca4bf42d1ddb897a974a0b19c7185b0b6b93af
Manually keeping tabs on the lifetime of these objects is a pain
and is the likely source of some of our crashes. I suspect we might
also be leaking memory.
This change creates an explicit copy of the main array into the
update thread to avoid using a non-thread-safe shared data
structure. This is a shallow copy. Only the pointers to the
TableUpdates are copied, which means one pointer per list (e.g. 5
in total for google4 in a new profile).
MozReview-Commit-ID: 221d6GkKt0M
--HG--
extra : rebase_source : e1b81f11bb9b41e465571a95845079f455b5868e
Mark that channel as anonymous in order to prevent any cookies
from being set here and potentially tie these proxied requests
to list updates which will not go through the proxy.
Also fix a return code in the case that httpChannel fails to QI.
MozReview-Commit-ID: BaRyYRlUbsB
--HG--
extra : rebase_source : 9ef4575553a7f4981c394b86e2923b5a5bf646c4
This was done automatically replacing:
s/mozilla::Move/std::move/
s/ Move(/ std::move(/
s/(Move(/(std::move(/
Removing the 'using mozilla::Move;' lines.
And then with a few manual fixups, see the bug for the split series..
MozReview-Commit-ID: Jxze3adipUh
Repurpose the previously unused Begin() function to initialize
ProtocolParser objects and also assert that we are not reusing
objects across update since that's not supported.
MozReview-Commit-ID: HIGGgOr388h
--HG--
extra : rebase_source : 53398213bf38e582248f1954bbdb46fd53348e40
This check was added in bug 1296820 to disable V4 updates prior
to their being implemented. It should have been removed once we
landed working support for V4 updates.
MozReview-Commit-ID: 828DIS72LNi
--HG--
extra : rebase_source : df3bf169fb077891d5096d7cbeb68c2bb657f834
This is a generalization of the reset code that's used in pver2
to reset all tables when a `pleasereset` command is received.
MozReview-Commit-ID: LF4RegQHqoT
--HG--
extra : rebase_source : 5c100f179a23c805fe245a361f4e89c8d5f5ce0a
Repurpose the previously unused Begin() function to initialize
ProtocolParser objects and also assert that we are not reusing
objects across update since that's not supported.
MozReview-Commit-ID: HIGGgOr388h
--HG--
extra : rebase_source : f9f83b1c7bd79faa40fc1d7cb594dcb14a66fe09
This check was added in bug 1296820 to disable V4 updates prior
to their being implemented. It should have been removed once we
landed working support for V4 updates.
MozReview-Commit-ID: 828DIS72LNi
--HG--
extra : rebase_source : df3bf169fb077891d5096d7cbeb68c2bb657f834
This is a generalization of the reset code that's used in pver2
to reset all tables when a `pleasereset` command is received.
MozReview-Commit-ID: LF4RegQHqoT
--HG--
extra : rebase_source : 5c100f179a23c805fe245a361f4e89c8d5f5ce0a
RegenActiveTables() relies on mPrimed being set correctly and so
the V4 lookup cache should behave the same way as the V2 one.
The V2 lookup cache on the other hand was unnecessarily setting
mPrimed to true twice.
MozReview-Commit-ID: LwNdI9DTqZ7
--HG--
extra : rebase_source : ff7d7a051f28867be5c35c1079407bb2bfd3a490
This also changes a few MOZ_LOG() messages to use the error name
instead of the raw numerical nsresult value.
MozReview-Commit-ID: Jcngd0S9j2z
--HG--
extra : rebase_source : f6e974569d8845211e0b25dabef2c41dda2ca1b6
Telemetry's AutoTimer Microsecond resolution was not used. I removed it with the TimerResolution enum, which allowed me to remove a couple of templates as well.
MozReview-Commit-ID: 76qHgmYEsE3
--HG--
extra : rebase_source : 1f5826f1be990d4814de15875cd0a726213712d4
The ThreatHit requests were never being sent because SetMatchedInfo() was
called on the channel _after_ calling SendThreatHitReport().
Additionally, the telemetry was sent in OnStartRequest() and so errors
returned in OnStopRequest() would not be caught.
This patch also includes some improvements to the logging of these
requests which can be toggled using:
MOZ_LOG="UrlClassifierDbService:5,nsChannelClassifier:5"
MozReview-Commit-ID: 9dtRgEPVS3g
--HG--
extra : rebase_source : 6d0e4b745e203a54489ddd479935d008ab9a82d7
Safebrowsing testcase will close and then re-open database to simulate firefox restart.
This bug happened when DB service already has a previously cached completion result and then
re-open database. In this scenario, if testcase triggers another the same completion request,
we won't cache it because we thought we have it already (See nsUrlClassifierDBServiceWorker::CacheCompletion).
This causes a testcase assertion when testcase expects the completion
result should be stored in LookupCache.
MozReview-Commit-ID: 8o57jHv92OH
--HG--
extra : rebase_source : 90861060437d6cef860b85dd669d76e74ceec660
When about:url-classifier ask cache information by using |GetCacheInfo| API, this API
will send a SYNC request to off-main thread. If NSS module is not initialized then off-main thread
will send init request to main thread, and this causes a deadlock.
This patch change |GetCacheInfo| API to asynchronous so main thread will not be
blocked.
MozReview-Commit-ID: 3y2hOjCoRUj
--HG--
extra : rebase_source : 4d1ec1b7fd960cdf90bca577879b41fbbc2a4e17
In order to optionally report the full hash back to Google, we need to keep it
around in the callback. While a prefix is not the same as a full hash (multiple
full hashes can map to the same prefix), in this case, the callback will only be
called when the full hash matches.
MozReview-Commit-ID: F4WSLZpYrXB
--HG--
extra : rebase_source : da3b16b00729d0aa6ff1765a135b751fcf44c012
As our threattype-listname conversion design, "goog-harmful-proto" is allocated
for this new threat type. This threat type is mainly for mobile.
MozReview-Commit-ID: G9GbgmHHHfp
--HG--
extra : rebase_source : 0681fcd9322b94451a86eafe57bf1ccc4b89db30
extra : intermediate-source : 28b0502d9add81beeae58a2c33f9fd5839d4d544
extra : source : 646f02f15131aa98ad37015b0a641304a3271796
We have a minimum requirement of VS 2015 for Windows builds, which supports
the z length modifier for format specifiers. So we don't need SizePrintfMacros.h
any more, and can just use %zu and friends directly everywhere.
MozReview-Commit-ID: 6s78RvPFMzv
--HG--
extra : rebase_source : 009ea39eb4dac1c927aa03e4f97d8ab673de8a0e