Commit Graph

368 Commits

Author SHA1 Message Date
Frederik Braun
617d3006d9 Bug 1366973: Rename security flags to not contain DATA anymore r=geckoview-reviewers,ckerschb,snorp
Differential Revision: https://phabricator.services.mozilla.com/D83490
2020-07-15 11:20:45 +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
Jean-Yves Avenard
4d64459120 Bug 1647133 - P2. Make nsIURIClassifier take a nsISerialEventTarget. r=gcp
The argument aEventTarget is actually never used by any caller; nullptr is always passed for it.

But the code is there in case it isn't null which would call into IProtocol::SetEventTargetFor

Depends on D80419

Differential Revision: https://phabricator.services.mozilla.com/D80421
2020-06-22 14:46:01 +00:00
Kristen Wright
c97a387556 Bug 1637708 - Convert urlclassifier.gethashnoise to a static pref. r=njn
Converts `urlclassifier.gethashnoise` to a static pref.

Differential Revision: https://phabricator.services.mozilla.com/D76374
2020-05-31 23:59:03 +00:00
Dimi Lee
927f29b7e5 Bug 1638089 - Don't check skip list when list type is whitelist r=baku
Differential Revision: https://phabricator.services.mozilla.com/D75391
2020-05-16 17:10:22 +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
Simon Giesecke
58d9406a2e Bug 1628715 - Part 10: Activate nodiscard attributes on AppendElement(s). r=xpcom-reviewers,nika,peterv
Differential Revision: https://phabricator.services.mozilla.com/D70834
2020-04-24 14:34:15 +00:00
Sebastian Streich
c39dac3735 Bug 1626971 - Remove nsIPrincipal-geturi in nsUrlClassifierDBService.cpp r=ckerschb
Differential Revision: https://phabricator.services.mozilla.com/D69388
2020-04-20 09:43:42 +00:00
Andreas Farre
28dfa78c70 Bug 1620594 - Part 4: Remove SetEventTargetForActor with SystemGroup target. r=nika
Depends on D67633

Differential Revision: https://phabricator.services.mozilla.com/D67634
2020-04-07 15:16:54 +00:00
Andreas Farre
c76bc4f1c8 Bug 1620594 - Part 1: Rework NS_ReleaseOnMainThreadSystemGroup. r=nika
To be able to remove SystemGroup, NS_ReleaseOnMainThreadSystemGroup
needs to have its dependency on SystemGroup removed. Since all
releases using SystemGroup would've released on the main thread anyway
we can safely replace NS_ReleaseOnMainThreadSystemGroup with
NS_ReleaseOnMainThread.

Depends on D64390

Differential Revision: https://phabricator.services.mozilla.com/D67631
2020-04-07 15:16:23 +00:00
Soumya Lahiri
cf65765aa8 Bug 1624231 - nsUrlClassifierDBService.cpp: do not use 'else' after 'return' r=sylvestre
Differential Revision: https://phabricator.services.mozilla.com/D68997
2020-04-01 21:15:04 +00:00
sonakshi
3f409eb5d3 Bug 1622619 - Replace URIParams with nsIURI in PContent.ipdl r=valentin
Differential Revision: https://phabricator.services.mozilla.com/D67729
2020-03-31 18:47:30 +00:00
Razvan Maries
548846f7f9 Backed out changeset 2515c5b5a0d2 (bug 1622619) for build bustages. CLOSED TREE 2020-03-31 17:18:38 +03:00
sonakshi
f81266b3a5 Bug 1622619 - Replace URIParams with nsIURI in PContent.ipdl r=valentin
Differential Revision: https://phabricator.services.mozilla.com/D67729
2020-03-31 13:38:55 +00:00
Simon Giesecke
99b166167f Bug 1613985 - Use default for equivalent-to-default constructors/destructors in toolkit. r=mossop
Depends on D66008

Differential Revision: https://phabricator.services.mozilla.com/D66010
2020-03-10 08:48:24 +00:00
Tim Huang
37f162c69d Bug 1616570 - Part 1: Rename CookieSettings to CookieJarSettings. r=Ehsan
Given that we are going to add ContentBlockingAllowList in
CookieSettings, so CookieSettings will be responsible for more stuff than the
cookie behavior and cookie permission. We should use a proper name to
reflect the purpose of it. The name 'CookieSettings' is misleading that
this is only for cookie related stuff. So, we decide to rename
'CookieSettins' to 'CookieJarSettings' which serves better meaning here.

Differential Revision: https://phabricator.services.mozilla.com/D63935
2020-03-04 08:59:08 +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
Emilio Cobos Álvarez
ceb8348f27 Bug 1609996 - Remove mozilla::Swap in favor of std::swap. r=froydnj
Now mfbt/Move.h is empty except for that excellent comment about move
semantics... Should we put it somewhere else and delete the header as a
follow-up? Or just delete the header and carry on?

Differential Revision: https://phabricator.services.mozilla.com/D60297
2020-01-20 16:17:06 +00:00
Dimi Lee
5d8673ac11 Bug 1600889 - gShuttingDownThread in nsUrlClassifierDBService should be Atomic r=gcp
Differential Revision: https://phabricator.services.mozilla.com/D57954
2019-12-20 12:46:45 +00:00
Gabriele Svelto
f03cdb2b2d Bug 1600545 - Remove useless inclusions of header files generated from IDL files in modules/, netwerk/, parser/, security/, startupcache/, storage/, toolkit/, tools/, uriloader/, widget/, xpcom/ and xpfe/ r=Ehsan
The inclusions were removed with the following very crude script and the
resulting breakage was fixed up by hand. The manual fixups did either
revert the changes done by the script, replace a generic header with a more
specific one or replace a header with a forward declaration.

find . -name "*.idl" | grep -v web-platform | grep -v third_party | while read path; do
    interfaces=$(grep "^\(class\|interface\).*:.*" "$path" | cut -d' ' -f2)
    if [ -n "$interfaces" ]; then
        if [[ "$interfaces" == *$'\n'* ]]; then
          regexp="\("
          for i in $interfaces; do regexp="$regexp$i\|"; done
          regexp="${regexp%%\\\|}\)"
        else
          regexp="$interfaces"
        fi
        interface=$(basename "$path")
        rg -l "#include.*${interface%%.idl}.h" . | while read path2; do
            hits=$(grep -v "#include.*${interface%%.idl}.h" "$path2" | grep -c "$regexp" )
            if [ $hits -eq 0 ]; then
                echo "Removing ${interface} from ${path2}"
                grep -v "#include.*${interface%%.idl}.h" "$path2" > "$path2".tmp
                mv -f "$path2".tmp "$path2"
            fi
        done
    fi
done

Differential Revision: https://phabricator.services.mozilla.com/D55444
2019-12-06 09:17:57 +00:00
Boris Zbarsky
2df1df0176 Bug 1517588. Use nsIPrincipal::IsSystemPrincipal instead of nsContentUtils::IsSystemPrincipal r=bzbarsky
Differential Revision: https://phabricator.services.mozilla.com/D53067
2019-12-05 04:44:32 +00:00
Dimi Lee
2f65764a31 Bug 1599379 - Create a DBService instance in GetWorker API when it doesn't exist. r=baku
There are two places using DBService during a page load at startup:
1. nsChannelClassifier::Start, used by Phishing Protection
2. AsyncChannelClassifier::CheckChannel, used by Tracking Protection

Tracking protection checks happen before establishing a network connection, so it happens
prior to phishing protection checkes. When we load a page at
startup, ::CheckChannel API is called, but DBService is not yet created.

This patch fixes this issue by creating a DBService instance when
::GetWorker API is called without a DBService instance.

Differential Revision: https://phabricator.services.mozilla.com/D55248
2019-12-02 14:37:25 +00:00
Ciure Andrei
344901b56e Backed out changeset ecc4010a247c (bug 1599379) for causing bustages CLOSED TREE 2019-12-02 13:14:41 +02:00
Dimi Lee
57708f7408 Bug 1599379 - Create a DBService instance in GetWorker API when it doesn't exist. r=baku
There are two places using DBService during a page load at startup:
1. nsChannelClassifier::Start, used by Phishing Protection
2. AsyncChannelClassifier::CheckChannel, used by Tracking Protection

Tracking protection checks happen before establishing a network connection, so it happens
prior to phishing protection checkes. When we load a page at
startup, ::CheckChannel API is called, but DBService is not yet created.

This patch fixes this issue by creating a DBService instance when
::GetWorker API is called without a DBService instance.

Differential Revision: https://phabricator.services.mozilla.com/D55248
2019-12-02 08:51:12 +00:00
DimiDL
32eca9fba9 Bug 1522054 - Assert when nsUrlClassifierDBService::Lookup is called with SystemPrinciap. r=gcp
Differential Revision: https://phabricator.services.mozilla.com/D49887
2019-11-07 08:11:33 +00:00
Brindusan Cristian
5e10916d81 Backed out changeset 1548ffd8f48c (bug 1522054) for mochitest failures at test_lookup_system_principal.html. CLOSED TREE 2019-11-06 01:11:51 +02:00
DimiDL
78c0738f7d Bug 1522054 - Assert when nsUrlClassifierDBService::Lookup is called with SystemPrinciap. r=gcp
Differential Revision: https://phabricator.services.mozilla.com/D49887
2019-10-31 12:55:58 +00:00
dlee
6aec2a81df Bug 1562822 - P2. Reset corrupted Safe Browsing database before triggering an update. r=gcp
Patch P2 & P3 refine how Safe Browsing handles Safe Browsing database
loading failure.

Safe Browsing databases are read in 3 scenarios:
1. |GetLookupCache| is called on startup. Safe Browsing reads prefix
files in this case. Metadata for updates(.sbstore, .metadata) are not
read in this scenario.

2. |TableRequest| is called before applying an update, Safe Browsing
reads update metadata to apply a partial update.

3. During an update, Safe Browsing reads both prefix files and metadata
in order to merge the update result.

For Case 1, we reset a table's database only when it returns FILE_CORRUPTED
while loading prefixes from the prefix file(.vlpset).

For Case 2, we reset a table's database when the table fails to load its
metadata file or prefix file. This is because we need to make sure both
files are complete so we can correctly perform a partial update.
Note that in this case, we don't just reset the database when "FILE_CORRUPTED"
is detected, we reset the database as long as an error occurs while loading the
database.

For Case 3, For all the tables failing to load their database during an
updating process, the databases of those tables will be reset.

Case 1 and Case 2 are done in Patch P2; Case 3 is done in Patch P3

Differential Revision: https://phabricator.services.mozilla.com/D42614
2019-08-21 12:08:03 +00:00
dlee
6efea46955 Bug 1553951 - Safe Browsing doesn't call the lookup callback when an error occurs in DoLocalLookup. r=baku
Firefox cannot open any URL when Safe Browsing database is corrupted.
This is because when Necko asks URL Classifier to classify an URL, it
first suspends the channel, and then wait for a callback to see if the
channel should be canceled or resumed.

In this bug, DoLocalLookup returns an error because Safe Browsing is not
able to read its database(database is corrupted), but we don't call the
callback to resume loading channel, so users cannot load any website.

This patch adds a scope exit handler to make sure the callback will
always be invoked.

Differential Revision: https://phabricator.services.mozilla.com/D36456
2019-07-01 13:26:44 +00:00
shindli
1ca14e50c0 Backed out changeset b308a5b128aa (bug 1553951) for causing bustages in builds/worker/workspace/build/src/toolkit/components/url-classifier/nsUrlClassifierDBService.cpp CLOSED TREE 2019-07-01 14:45:59 +03:00
dlee
98dc7e8300 Bug 1553951 - Safe Browsing doesn't call the lookup callback when an error occurs in DoLocalLookup. r=baku
Firefox cannot open any URL when Safe Browsing database is corrupted.
This is because when Necko asks URL Classifier to classify an URL, it
first suspends the channel, and then wait for a callback to see if the
channel should be canceled or resumed.

In this bug, DoLocalLookup returns an error because Safe Browsing is not
able to read its database(database is corrupted), but we don't call the
callback to resume loading channel, so users cannot load any website.

This patch adds a scope exit handler to make sure the callback will
always be invoked.

Differential Revision: https://phabricator.services.mozilla.com/D36456
2019-07-01 11:26:11 +00:00
dlee
f59bb40e5d Bug 1531354 - P5. Safe Browsing test entries are directly stored in LookupCache. r=gcp
Create test entries via update introduces performance overhead.
We can store them directly in LookupCache and do not save test entries
to disk.

Differential Revision: https://phabricator.services.mozilla.com/D34576
2019-06-29 19:05:41 +00:00
Sylvestre Ledru
b31009da86 Bug 1519636 - Reformat recent changes to the Google coding style r=Ehsan
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D22514
2019-03-13 10:19:06 +01:00
Andrea Marchesini
3ce93fb8e0 Bug 1525245 - Stabilize cookiePolicy/cookiePermission for live documents - part 12 - nsICookieSettings for the channel creation, r=ckerschb,asuth,Ehsan
Differential Revision: https://phabricator.services.mozilla.com/D21538
2019-03-08 09:04:11 +00:00
Ciure Andrei
899292bc3f Backed out 16 changesets (bug 1525245) for perma failing test_document_cookie.html CLOSED TREE
Backed out changeset 3fd27215698f (bug 1525245)
Backed out changeset d9a9e8e77873 (bug 1525245)
Backed out changeset 0e6f7be92e3f (bug 1525245)
Backed out changeset 6790802e2fa5 (bug 1525245)
Backed out changeset a5a9e01116ed (bug 1525245)
Backed out changeset 66e19a0c38dd (bug 1525245)
Backed out changeset fb90d51ba853 (bug 1525245)
Backed out changeset 4772db3625b3 (bug 1525245)
Backed out changeset 9affaf0cb998 (bug 1525245)
Backed out changeset a91b7ebe8bdd (bug 1525245)
Backed out changeset c2a13a7480e1 (bug 1525245)
Backed out changeset abe4482fa137 (bug 1525245)
Backed out changeset b3920c0bcf84 (bug 1525245)
Backed out changeset 0821b81f2724 (bug 1525245)
Backed out changeset 70bed2ad7899 (bug 1525245)
Backed out changeset 5f72ba232cc8 (bug 1525245)
2019-03-07 17:54:18 +02:00
Andrea Marchesini
83054c5a7a Bug 1525245 - Stabilize cookiePolicy/cookiePermission for live documents - part 12 - nsICookieSettings for the channel creation, r=ckerschb,asuth,Ehsan
Differential Revision: https://phabricator.services.mozilla.com/D21538
2019-03-07 10:21:15 +00:00
Dorel Luca
9a275b4283 Backed out 16 changesets (bug 1525245) for Android failures. CLOSED TREE
Backed out changeset 9f8a1b410320 (bug 1525245)
Backed out changeset 0ef284a9a1d5 (bug 1525245)
Backed out changeset 835e5f642a03 (bug 1525245)
Backed out changeset 362f5a8d033c (bug 1525245)
Backed out changeset 9da3ab33cf67 (bug 1525245)
Backed out changeset 6aacd2d6e835 (bug 1525245)
Backed out changeset 8ff9e8f45e02 (bug 1525245)
Backed out changeset 2020227181cc (bug 1525245)
Backed out changeset fc3c64c330b9 (bug 1525245)
Backed out changeset 2762bf88e050 (bug 1525245)
Backed out changeset ffc10fdc50a6 (bug 1525245)
Backed out changeset bb6ade1207d7 (bug 1525245)
Backed out changeset 1875eb5085e4 (bug 1525245)
Backed out changeset 7e4f67a6d6f1 (bug 1525245)
Backed out changeset e671fc9581eb (bug 1525245)
Backed out changeset b89f5def8d0d (bug 1525245)
2019-03-06 21:07:49 +02:00
Andrea Marchesini
88186754be Bug 1525245 - Stabilize cookiePolicy/cookiePermission for live documents - part 12 - nsICookieSettings for the channel creation, r=ckerschb,asuth,Ehsan
Differential Revision: https://phabricator.services.mozilla.com/D21538
2019-03-06 17:04:06 +00:00
Ryan Hunt
743a2a46fe Bug 1523969 part 23 - Move method definition inline comments to new line in 'toolkit/'. r=ehsan
Differential Revision: https://phabricator.services.mozilla.com/D21124
2019-02-25 16:12:51 -06:00
Jonathan Kingston
8397774fdf Bug 1525319 - Removing context from OnDataAvailable r=valentin
Differential Revision: https://phabricator.services.mozilla.com/D20881
2019-02-27 23:42:27 +00:00
Jonathan Kingston
3ef1df37e1 Bug 1525319 - Removing context from OnStopRequest r=valentin
Differential Revision: https://phabricator.services.mozilla.com/D20770
2019-02-27 23:41:31 +00:00
Jonathan Kingston
649c453cbd Bug 1525319 - Removing context from OnStartRequest r=valentin
Differential Revision: https://phabricator.services.mozilla.com/D20769
2019-02-27 23:41:04 +00:00
Dorel Luca
2dfae9a24a Backed out 4 changesets (bug 1525319) for Android failures in dom/base/test/test_progress_events_for_gzip_data.html
Backed out changeset b73f033efb41 (bug 1525319)
Backed out changeset 1d318d5c6b98 (bug 1525319)
Backed out changeset 6d73418988d4 (bug 1525319)
Backed out changeset 84ca79bd2dc3 (bug 1525319)
2019-02-25 04:06:11 +02:00
Jonathan Kingston
b6e28d0b8e Bug 1525319 - Removing context from OnDataAvailable r=valentin
Differential Revision: https://phabricator.services.mozilla.com/D20881
2019-02-24 20:27:55 +00:00
Jonathan Kingston
4334f239c3 Bug 1525319 - Removing context from OnStopRequest r=valentin
Differential Revision: https://phabricator.services.mozilla.com/D20770
2019-02-24 20:26:59 +00:00
Jonathan Kingston
d6fffaf979 Bug 1525319 - Removing context from OnStartRequest r=valentin
Differential Revision: https://phabricator.services.mozilla.com/D20769
2019-02-24 20:26:16 +00:00
Ehsan Akhgari
6bcfe664eb Bug 1527505 - Part 9: Make nsIPermissionManager accept ACString arguments for permission types instead of raw C strings; r=nika
This will mean that in places like the tight loop in GetTypeIndex()
we would no longer require calling strlen() on the input type argument
once per loop iteration.

Depends on D20236

Differential Revision: https://phabricator.services.mozilla.com/D20237
2019-02-21 22:54:28 +00:00
Christoph Kerschbaumer
1a72eb2a6b Bug 1528677: Remove nullchecks for loadinfo since we have loadinfo on all channels. r=baku 2019-02-20 13:27:25 +01:00
Andrea Marchesini
0fd63f6e02 Bug 1528596 - Devirtualize accesses to nsUrlClassifierUtils, r=dimi
Differential Revision: https://phabricator.services.mozilla.com/D20086
2019-02-19 14:35:57 +00:00