Security/Safe Browsing: Difference between revisions

→‎Code walkthrough: add more code pointers around the multi-list matches
(→‎Code walkthrough: link to the TP page for the details on that classification)
(→‎Code walkthrough: add more code pointers around the multi-list matches)
Line 74: Line 74:
[https://dxr.mozilla.org/mozilla-central/rev/f8086bd3c84fc1a42c3625cf3cc2253f0a5e8cfd/netwerk/base/nsChannelClassifier.cpp#354 nsChannelClassifier]. There is also a [[Security/Tracking_protection#Code_walkthrough|local-only classification]] that is requested by [[Security/Tracking protection|tracking protection]].
[https://dxr.mozilla.org/mozilla-central/rev/f8086bd3c84fc1a42c3625cf3cc2253f0a5e8cfd/netwerk/base/nsChannelClassifier.cpp#354 nsChannelClassifier]. There is also a [[Security/Tracking_protection#Code_walkthrough|local-only classification]] that is requested by [[Security/Tracking protection|tracking protection]].


The classifier determines the type of URL that is is and resolves conflicts (i.e. a match on more than one list) based on:
While we collect information about each of the list matches in [https://searchfox.org/mozilla-central/rev/da499aac682d0bbda5829327b60a865cbc491611/toolkit/components/url-classifier/nsUrlClassifierDBService.cpp#1454-1484 <tt>nsUrlClassifierClassifyCallback::HandleResult()</tt>], which is called for each matched list from
[https://searchfox.org/mozilla-central/rev/da499aac682d0bbda5829327b60a865cbc491611/toolkit/components/url-classifier/nsUrlClassifierDBService.cpp#1296-1326 <tt>nsUrlClassifierLookupCallback::HandleResults()</tt>], we pick only the highest priority list match and call <tt>OnClassifyComplete()</tt> in
[https://searchfox.org/mozilla-central/rev/da499aac682d0bbda5829327b60a865cbc491611/toolkit/components/url-classifier/nsUrlClassifierDBService.cpp#1433-1442 <tt>nsUrlClassifierClassifyCallback::HandleEvent()</tt>] according to:


* [https://searchfox.org/mozilla-central/rev/da499aac682d0bbda5829327b60a865cbc491611/toolkit/components/url-classifier/nsUrlClassifierDBService.cpp#1383-1389 priority of providers]
* [https://searchfox.org/mozilla-central/rev/da499aac682d0bbda5829327b60a865cbc491611/toolkit/components/url-classifier/nsUrlClassifierDBService.cpp#1383-1389 priority of providers]
* [https://searchfox.org/mozilla-central/rev/da499aac682d0bbda5829327b60a865cbc491611/toolkit/components/url-classifier/nsUrlClassifierDBService.cpp#66-93 priority of warning types]
* [https://searchfox.org/mozilla-central/rev/da499aac682d0bbda5829327b60a865cbc491611/toolkit/components/url-classifier/nsUrlClassifierDBService.cpp#66-93 priority of warning types]


then [https://searchfox.org/mozilla-central/rev/8affe6e83188787eb61fe0528eeb6eef6081ba06/toolkit/components/url-classifier/nsUrlClassifierDBService.cpp#1449 returns information about the list match]. That causes the channel to be [hhttps://searchfox.org/mozilla-central/rev/8affe6e83188787eb61fe0528eeb6eef6081ba06/netwerk/base/nsChannelClassifier.cpp#1174 cancelled with that error code].
Then we [https://searchfox.org/mozilla-central/rev/8affe6e83188787eb61fe0528eeb6eef6081ba06/toolkit/components/url-classifier/nsUrlClassifierDBService.cpp#1449 return information about the list match]. That causes the channel to be [hhttps://searchfox.org/mozilla-central/rev/8affe6e83188787eb61fe0528eeb6eef6081ba06/netwerk/base/nsChannelClassifier.cpp#1174 cancelled with that error code].


When the [https://dxr.mozilla.org/mozilla-central/rev/f8086bd3c84fc1a42c3625cf3cc2253f0a5e8cfd/docshell/base/nsDocShell.cpp#7613 classification state of the page  changes], the appropriate UI [https://dxr.mozilla.org/mozilla-central/rev/f8086bd3c84fc1a42c3625cf3cc2253f0a5e8cfd/docshell/base/nsDocShell.cpp#4854  is shown].
When the [https://dxr.mozilla.org/mozilla-central/rev/f8086bd3c84fc1a42c3625cf3cc2253f0a5e8cfd/docshell/base/nsDocShell.cpp#7613 classification state of the page  changes], the appropriate UI [https://dxr.mozilla.org/mozilla-central/rev/f8086bd3c84fc1a42c3625cf3cc2253f0a5e8cfd/docshell/base/nsDocShell.cpp#4854  is shown].
Confirmed users
908

edits