Граф коммитов

178 Коммитов

Автор SHA1 Сообщение Дата
Dimi Lee 0f6d4af47e Bug 1437626 - P5. Only call ShouldEnableClassifier for protection features. r=baku
ShouldEnableClassifier checks two things:
1. If AddOn can load the channel
2. If the classified channel is top-level.

For the first point, we added the check in Bug 1308640, and I think the
idea is only for tracking protection to not block channels when
extensions have permission on the channels' domain.
For annotation features, we should always annotate a channel regardless of whether
it is controlled by extensions (also for ETP).

And since we use first-party classification flag in channels, so we
should also annotate channel no matter it is top-level, first-party or
third-party.

So this patch removes calling ShouldEnableClassifier in annotation
features and also rename ShouldEnableClassifier to
ShouldEnableProtectionForChannel to make the idea more clear.

Differential Revision: https://phabricator.services.mozilla.com/D82504
2020-07-08 12:26:53 +00:00
Dimi Lee 34b12aaca6 Bug 1437626 - P3. Use global tracking Protection pref when a channel doesn't have a loadcontext r=baku
Channels loaded by service worker don't have loadcontext, so we don't
apply tracking protection on them.

Depends on D80183

Differential Revision: https://phabricator.services.mozilla.com/D80184
2020-07-08 12:12:09 +00:00
Dimi Lee b20ed5b08a Bug 1437626 - P2. Get top-level URI from ClientInfo when a channel is initiated by ShareWorker or ServiceWorker r=baku
When a channel is initiated from sharedworker or service worker, we use
worker's origin as the top-level uri.

Depends on D80182

Differential Revision: https://phabricator.services.mozilla.com/D80183
2020-07-08 12:12:07 +00:00
Dimi Lee 26ac53ba5e Bug 1437626 - P1. Use TYPE_DOCUMENT to determin whether a channel is a top-level load. r=baku
We use whether channel->GetTopWindowURI returns a failure to determin
if the channel is a top-level load. However, channels loaded by service
worker or appcache don't have top-level window.

This patch use TYPE_DOCUMENT to determin whether it is a top-level load.
This patch also adds UrlClassifierCommon::GetTopWindowURI to print debug message
because nsIChannel::GetTopWindowURI is not fission-compatible.

Differential Revision: https://phabricator.services.mozilla.com/D80182
2020-07-08 12:11:59 +00:00
Andrea Marchesini 07b75de903 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
Noemi Erli 6d5eb18b6a Backed out 4 changesets (bug 1437626) for causing ES lint failure CLOSED TREE
Backed out changeset c9a432ac1964 (bug 1437626)
Backed out changeset 905916b5ee1a (bug 1437626)
Backed out changeset c692ce0d363a (bug 1437626)
Backed out changeset fcd023c403bc (bug 1437626)
2020-07-02 11:05:40 +03:00
Dimi Lee 4f69aa8fa0 Bug 1437626 - P3. Use global tracking Protection pref when a channel doesn't have a loadcontext r=baku
Channels loaded by service worker don't have loadcontext, so we don't
apply tracking protection on them.

Depends on D80183

Differential Revision: https://phabricator.services.mozilla.com/D80184
2020-07-02 07:20:52 +00:00
Dimi Lee f334f91266 Bug 1437626 - P2. Get top-level URI from ClientInfo when a channel is initiated by ShareWorker or ServiceWorker r=baku
When a channel is initiated from sharedworker or service worker, we use
worker's origin as the top-level uri.

Depends on D80182

Differential Revision: https://phabricator.services.mozilla.com/D80183
2020-07-02 07:20:44 +00:00
Dimi Lee ae27794ca2 Bug 1437626 - P1. Use TYPE_DOCUMENT to determin whether a channel is a top-level load. r=baku
We use whether channel->GetTopWindowURI returns a failure to determin
if the channel is a top-level load. However, channels loaded by service
worker or appcache don't have top-level window.

This patch use TYPE_DOCUMENT to determin whether it is a top-level load.
This patch also adds UrlClassifierCommon::GetTopWindowURI to print debug message
because nsIChannel::GetTopWindowURI is not fission-compatible.

Differential Revision: https://phabricator.services.mozilla.com/D80182
2020-07-02 07:20:42 +00:00
Simon Giesecke cd8b8939b9 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 f89a18bd12 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
Kashav Madan b389ac5721 Bug 1641929 - Replace uses of StaticPrefs::fission_autostart() with FissionAutostart(), r=nika
Differential Revision: https://phabricator.services.mozilla.com/D78799
2020-06-08 23:00:21 +00:00
Narcis Beleuzu 2301168947 Backed out changeset cf9b81801abc (bug 1640117) for dt failures on browser_webconsole_trackingprotection_errors.js . CLOSED TREE 2020-06-05 17:14:38 +03:00
Taegeon Lee 6b7bd763ae Bug 1640117 Change message in console for blocking contents from content blocking to enhanced tracking protection. r=nchevobbe,dimi
Differential Revision: https://phabricator.services.mozilla.com/D78470
2020-06-05 11:15:13 +00:00
Dimi Lee acbbeb5981 Bug 1639718 - P2. Protection features call OnBeforeBlockChannel before blocking the channel. r=baku
Differential Revision: https://phabricator.services.mozilla.com/D76837
2020-05-28 09:51:23 +00:00
Dimi Lee 86d87ef93e Bug 1639718 - P1. Add ChannelClassifierService to support notifying/unblocking channel. r=baku
ChannelClassifierService notifies "urlclassifier-before-block-channel"
event when a channel is going to be blocked by protection features.

It also provides an API for receivers to "unblock" the channel.

Sample usage:
this.service = Cc["@mozilla.org/url-classifier/channel-classifier-service;1"].getService(
  Ci.nsIChannelClassifierService
);
if (this.service) {
  this.service.addListener({
    observe(aSubject, aTopic, aData) {
      switch (aTopic) {
        case "urlclassifier-before-block-channel":
          let channel = aSubject.QueryInterface(Ci.nsIUrlClassifierBlockedChannel);
          channel.unblock();
          break;
      }
    },
  })
}

Differential Revision: https://phabricator.services.mozilla.com/D76836
2020-05-28 09:51:15 +00:00
Tim Huang 1aff983d1e Bug 1637739 - Use AntiTrackingUtils::IsThirdPartyChannel() in UrlClassifierCommon::AnnotateChannel(). r=dimi
We used to use nsContentUtils::IsThirdPartyWindowOrChannel() to
determine the third-party channel when annotate the channel in
UrlClassifierCommon. Howeverm This is fission-incompatible. So, we
change it to use AntiTrackingUtils::IsThirdPartyChannel() which is
fission-compatible.

Differential Revision: https://phabricator.services.mozilla.com/D75187
2020-05-13 22:25:13 +00:00
Andrea Marchesini b4b45450ff Bug 1636371 - UrlClassifierSkipListService.jsm should call the observer even when RemoteSettings have not been received yet, r=johannh
Differential Revision: https://phabricator.services.mozilla.com/D73925
2020-05-08 06:16:49 +00:00
Simon Giesecke 8d5dd3da2e Bug 1626570 - Improve handling of copying arrays in netwerk/url-classifier/. r=dimi
Differential Revision: https://phabricator.services.mozilla.com/D72332
2020-04-30 09:41:04 +00:00
Jean-Yves Avenard 27d1134cfd Bug 1607984 - P4. Expose SetClassificationFlagsHelper. r=valentin
Differential Revision: https://phabricator.services.mozilla.com/D70001
2020-04-24 01:44:57 +00:00
Csoregi Natalia 448f2f3c76 Backed out 16 changesets (bug 1607984) for leaks on browser_ext_webRequest.js. CLOSED TREE
Backed out changeset 6c6ffa908c06 (bug 1607984)
Backed out changeset e973911e67e6 (bug 1607984)
Backed out changeset 28af6418ac16 (bug 1607984)
Backed out changeset 9a15a605f91a (bug 1607984)
Backed out changeset 52566b3564ba (bug 1607984)
Backed out changeset 142148a95181 (bug 1607984)
Backed out changeset 108e2cb6b2a9 (bug 1607984)
Backed out changeset 77fda525ee12 (bug 1607984)
Backed out changeset 980067f3ac1d (bug 1607984)
Backed out changeset 12b82a39c910 (bug 1607984)
Backed out changeset 7657023a763b (bug 1607984)
Backed out changeset 1ab8758802a6 (bug 1607984)
Backed out changeset 35f22d0817e1 (bug 1607984)
Backed out changeset b8c6277207d8 (bug 1607984)
Backed out changeset 244d3cb006be (bug 1607984)
Backed out changeset 9fc1a237829c (bug 1607984)
2020-04-23 11:49:51 +03:00
Jean-Yves Avenard 759200d53c Bug 1607984 - P4. Expose SetClassificationFlagsHelper. r=valentin
Differential Revision: https://phabricator.services.mozilla.com/D70001
2020-04-23 00:57:49 +00:00
Andreea Pavel cac786a35c Backed out 16 changesets (bug 1607984) for multiple test failures e.g test timeouts on a CLOSED TREE
Backed out changeset 4509808243f5 (bug 1607984)
Backed out changeset 0cb21bedf65f (bug 1607984)
Backed out changeset 4e5d89f68293 (bug 1607984)
Backed out changeset 0c0169ed4f04 (bug 1607984)
Backed out changeset ce527a6ffba4 (bug 1607984)
Backed out changeset 63175f596762 (bug 1607984)
Backed out changeset 107be8f3737d (bug 1607984)
Backed out changeset d7600d4d3528 (bug 1607984)
Backed out changeset e11b1b0ecfbf (bug 1607984)
Backed out changeset bed3f6bee79e (bug 1607984)
Backed out changeset abe692da4556 (bug 1607984)
Backed out changeset e02b12515d60 (bug 1607984)
Backed out changeset 7a2ef225a41e (bug 1607984)
Backed out changeset c173bde5106b (bug 1607984)
Backed out changeset dc8b37e10dc7 (bug 1607984)
Backed out changeset 09a651daf344 (bug 1607984)
2020-04-23 03:47:24 +03:00
Jean-Yves Avenard 7f64d00bf4 Bug 1607984 - P4. Expose SetClassificationFlagsHelper. r=valentin
Differential Revision: https://phabricator.services.mozilla.com/D70001
2020-04-15 15:37:25 +00:00
Stefan Hindli fb36126f61 Backed out 15 changesets (bug 1607984) for causing very frequent reftest faiures CLOSED TREE
Backed out changeset 5497c90b03de (bug 1607984)
Backed out changeset 71dffa590c10 (bug 1607984)
Backed out changeset fdacabac2c54 (bug 1607984)
Backed out changeset 5f9fe17e46b8 (bug 1607984)
Backed out changeset 8f9058eb821d (bug 1607984)
Backed out changeset 025af7792f2a (bug 1607984)
Backed out changeset c7edd070b2f3 (bug 1607984)
Backed out changeset 8e7c95d322e8 (bug 1607984)
Backed out changeset e51f6b7a745c (bug 1607984)
Backed out changeset 979d99eb12d1 (bug 1607984)
Backed out changeset f554d4ce6718 (bug 1607984)
Backed out changeset fe84e5c64b4e (bug 1607984)
Backed out changeset 05d2032060db (bug 1607984)
Backed out changeset 07ce7b11fee9 (bug 1607984)
Backed out changeset 718d89be09d2 (bug 1607984)
2020-04-15 18:33:24 +03:00
Jean-Yves Avenard 06addbed12 Bug 1607984 - P4. Expose SetClassificationFlagsHelper. r=valentin
Differential Revision: https://phabricator.services.mozilla.com/D70001

--HG--
extra : moz-landing-system : lando
2020-04-15 08:57:28 +00:00
Andreea Pavel bf1f43b298 Backed out 12 changesets (bug 1607984) for failing test_bug1339722.html on a CLOSED TREE
Backed out changeset 69c73391e8fc (bug 1607984)
Backed out changeset a3a28be516f9 (bug 1607984)
Backed out changeset 9f216e9bd32e (bug 1607984)
Backed out changeset 0b71b61415d5 (bug 1607984)
Backed out changeset 0fa85c9199a9 (bug 1607984)
Backed out changeset 4c661ed81cf2 (bug 1607984)
Backed out changeset 47beda24613f (bug 1607984)
Backed out changeset 348da0a8dd00 (bug 1607984)
Backed out changeset 3d6824e92c38 (bug 1607984)
Backed out changeset 1cfc8aad978c (bug 1607984)
Backed out changeset e11f4d334dc7 (bug 1607984)
Backed out changeset c499fa55d0f2 (bug 1607984)
2020-04-15 11:53:11 +03:00
Jean-Yves Avenard 4f0eda51f9 Bug 1607984 - P4. Expose SetClassificationFlagsHelper. r=valentin
Differential Revision: https://phabricator.services.mozilla.com/D70001

--HG--
extra : moz-landing-system : lando
2020-04-15 06:02:53 +00:00
Dimi Lee 788c34f07f Bug 1627897 - Add a SkipListService testcase to ensure features can get correct initial data. r=johannh
Differential Revision: https://phabricator.services.mozilla.com/D69955

--HG--
extra : moz-landing-system : lando
2020-04-09 21:28:43 +00:00
Andreas Farre 63e21eec70 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

--HG--
extra : moz-landing-system : lando
2020-04-07 15:16:23 +00:00
Emilio Cobos Álvarez 4b9fdf3d73 Bug 1627707 - Rename LoadInfo::LoadingPrincipal to GetLoadingPrincipal as it can return null. r=ckerschb
Mostly a matter of:

  rg -l '\->LoadingPrincipal' | xargs sed -i 's/->LoadingPrincipal/->GetLoadingPrincipal/g'

And then clang-format. But I tweaked manually nsHttpChannelAuthProvider (move
the variable where it's used, don't take a useless strong ref),
AddonContentPolicy (move the declaration of the variable to the if condition),
and BackgroundUtils (same).

Differential Revision: https://phabricator.services.mozilla.com/D69828

--HG--
extra : moz-landing-system : lando
2020-04-06 18:57:36 +00:00
Cosmin Sabou d557e2ed22 Backed out 3 changesets (bug 1627707) for build bustages @ mozilla::net::LoadInfo.
Backed out changeset 65d6a90651ce (bug 1627707)
Backed out changeset 378ec30d9979 (bug 1627707)
Backed out changeset 058a19e11b06 (bug 1627707)
2020-04-06 20:07:04 +03:00
Emilio Cobos Álvarez 97872f2fee Bug 1627707 - Rename LoadInfo::LoadingPrincipal to GetLoadingPrincipal as it can return null. r=ckerschb
Mostly a matter of:

  rg -l '\->LoadingPrincipal' | xargs sed -i 's/->LoadingPrincipal/->GetLoadingPrincipal/g'

And then clang-format. But I tweaked manually nsHttpChannelAuthProvider (move
the variable where it's used, don't take a useless strong ref),
AddonContentPolicy (move the declaration of the variable to the if condition),
and BackgroundUtils (same).

Differential Revision: https://phabricator.services.mozilla.com/D69828

--HG--
extra : moz-landing-system : lando
2020-04-06 16:00:43 +00:00
Dimi Lee 57f9b0919c Bug 1624822 - Do not request remote setting data for each URL classifier feature r=johannh
Differential Revision: https://phabricator.services.mozilla.com/D69188

--HG--
extra : moz-landing-system : lando
2020-04-05 22:29:16 +00:00
Cosmin Sabou 3e9153f506 Backed out 2 changesets (bug 1624822) for causing Bug 1627377.
Backed out changeset 0dc7fbadfe15 (bug 1624822)
Backed out changeset cffc27728f9e (bug 1624822)
2020-04-04 15:15:37 +03:00
Gijs Kruitbosch de137990dd Bug 1624822 follow-up to fix eslint issues. CLOSED TREE
Differential Revision: https://phabricator.services.mozilla.com/D69584

--HG--
extra : histedit_source : 2db2915530c1424106f4a0062fc5641095fa94d7
2020-04-03 15:26:51 +00:00
Dimi Lee df699673b7 Bug 1624822 - Do not request remote setting data for each URL classifier feature r=Gijs
Differential Revision: https://phabricator.services.mozilla.com/D69188

--HG--
extra : moz-landing-system : lando
2020-04-03 14:02:40 +00:00
Steven Englehardt 2af4d3bbd9 Bug 1616436 - Skip passive content from fingerprinting blocking, r=baku
Differential Revision: https://phabricator.services.mozilla.com/D67956

--HG--
extra : moz-landing-system : lando
2020-04-02 06:32:44 +00:00
Tim Huang 17465d5c79 Bug 1612378 - Part 6: Make UrlClassifierCommon::IsAllowListed() to use the ContentBlockingAllowListPrincipal from the WindowGlobalParent. r=dimi,baku
In this patch, we make the UrlClassifierCommon::IsAllowListed() to get
the ContentBlockingAllowListPrincipal from the WindowGlobalParent
instead of from the channel.

Differential Revision: https://phabricator.services.mozilla.com/D66213

--HG--
extra : moz-landing-system : lando
2020-03-25 13:22:04 +00:00
Sebastian Streich 13de9eb145 Bug 1621305 - Remove GetUri in nsChannelClassifier.cpp r=ckerschb
Differential Revision: https://phabricator.services.mozilla.com/D66248

--HG--
extra : moz-landing-system : lando
2020-03-12 19:47:51 +00:00
Ehsan Akhgari 5200d034f5 Bug 1620322 - Part 8: Rename AntiTrackingCommon to ContentBlocking; r=baku
Differential Revision: https://phabricator.services.mozilla.com/D65821

--HG--
rename : toolkit/components/antitracking/AntiTrackingCommon.cpp => toolkit/components/antitracking/ContentBlocking.cpp
rename : toolkit/components/antitracking/AntiTrackingCommon.h => toolkit/components/antitracking/ContentBlocking.h
extra : moz-landing-system : lando
2020-03-09 23:36:39 +00:00
Ehsan Akhgari c8b15ee520 Bug 1620322 - Part 3: Move MaybeGetDocumentURIBeingLoaded to AntiTrackingUtils; r=baku
Differential Revision: https://phabricator.services.mozilla.com/D65751

--HG--
extra : moz-landing-system : lando
2020-03-09 23:36:39 +00:00
Ehsan Akhgari 8e46ea55d2 Bug 1620322 - Part 2: Refactor the code for content blocking events and notifications out of AntiTrackingCommon.cpp; r=baku
Differential Revision: https://phabricator.services.mozilla.com/D65743

--HG--
extra : moz-landing-system : lando
2020-03-09 23:36:37 +00:00
Narcis Beleuzu 0186cbe565 Backed out 8 changesets (bug 1620322) for bustages on nsContentSink.cpp . CLOSED TREE
Backed out changeset f41739c64dff (bug 1620322)
Backed out changeset be942a7f329e (bug 1620322)
Backed out changeset a916987c7c71 (bug 1620322)
Backed out changeset ead3484ffb5f (bug 1620322)
Backed out changeset 4e1e8b9afa1a (bug 1620322)
Backed out changeset 473bba698e5a (bug 1620322)
Backed out changeset 0e5e5d41597d (bug 1620322)
Backed out changeset 31b24d79db3d (bug 1620322)

--HG--
rename : toolkit/components/antitracking/ContentBlockingLog.cpp => dom/base/ContentBlockingLog.cpp
rename : toolkit/components/antitracking/ContentBlockingLog.h => dom/base/ContentBlockingLog.h
rename : toolkit/components/antitracking/ContentBlocking.cpp => toolkit/components/antitracking/AntiTrackingCommon.cpp
rename : toolkit/components/antitracking/ContentBlocking.h => toolkit/components/antitracking/AntiTrackingCommon.h
2020-03-09 22:18:36 +02:00
Ehsan Akhgari 5045d313c2 Bug 1620322 - Part 8: Rename AntiTrackingCommon to ContentBlocking; r=baku
Differential Revision: https://phabricator.services.mozilla.com/D65821

--HG--
rename : toolkit/components/antitracking/AntiTrackingCommon.cpp => toolkit/components/antitracking/ContentBlocking.cpp
rename : toolkit/components/antitracking/AntiTrackingCommon.h => toolkit/components/antitracking/ContentBlocking.h
extra : moz-landing-system : lando
2020-03-09 18:12:40 +00:00
Ehsan Akhgari f658ede842 Bug 1620322 - Part 3: Move MaybeGetDocumentURIBeingLoaded to AntiTrackingUtils; r=baku
Differential Revision: https://phabricator.services.mozilla.com/D65751

--HG--
extra : moz-landing-system : lando
2020-03-09 18:12:28 +00:00
Ehsan Akhgari 78677f7812 Bug 1620322 - Part 2: Refactor the code for content blocking events and notifications out of AntiTrackingCommon.cpp; r=baku
Differential Revision: https://phabricator.services.mozilla.com/D65743

--HG--
extra : moz-landing-system : lando
2020-03-09 18:12:26 +00:00
Noemi Erli a48fac9e3b Backed out 8 changesets (bug 1620322) for causing bustages in ContentBlockingLog.cpp CLOSED TREE
Backed out changeset 3dcf513e36cb (bug 1620322)
Backed out changeset 46714855ce1d (bug 1620322)
Backed out changeset 0eb2b5f7322f (bug 1620322)
Backed out changeset 72d640fa0740 (bug 1620322)
Backed out changeset 4533bb4e5177 (bug 1620322)
Backed out changeset 659270edd419 (bug 1620322)
Backed out changeset 6802c18b1914 (bug 1620322)
Backed out changeset 60ff34db9f15 (bug 1620322)

--HG--
rename : toolkit/components/antitracking/ContentBlockingLog.cpp => dom/base/ContentBlockingLog.cpp
rename : toolkit/components/antitracking/ContentBlockingLog.h => dom/base/ContentBlockingLog.h
rename : toolkit/components/antitracking/ContentBlocking.cpp => toolkit/components/antitracking/AntiTrackingCommon.cpp
rename : toolkit/components/antitracking/ContentBlocking.h => toolkit/components/antitracking/AntiTrackingCommon.h
2020-03-09 19:19:41 +02:00
Ehsan Akhgari 1195c302a4 Bug 1620322 - Part 8: Rename AntiTrackingCommon to ContentBlocking; r=baku
Differential Revision: https://phabricator.services.mozilla.com/D65821

--HG--
rename : toolkit/components/antitracking/AntiTrackingCommon.cpp => toolkit/components/antitracking/ContentBlocking.cpp
rename : toolkit/components/antitracking/AntiTrackingCommon.h => toolkit/components/antitracking/ContentBlocking.h
extra : moz-landing-system : lando
2020-03-09 10:23:07 +00:00
Ehsan Akhgari a860758740 Bug 1620322 - Part 3: Move MaybeGetDocumentURIBeingLoaded to AntiTrackingUtils; r=baku
Differential Revision: https://phabricator.services.mozilla.com/D65751

--HG--
extra : moz-landing-system : lando
2020-03-09 10:20:12 +00:00