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

217 Коммитов

Автор SHA1 Сообщение Дата
Valentin Gosu 1a1f42da37 Bug 1714307 - Run modernize-use-default-member-init --fix check on netwerk r=necko-reviewers,kershaw
This changeset is the result of adding modernize-use-default-member-init to
tools/clang-tidy/config.yaml then proceeding to run
`./mach static-analysis check netwerk/ --fix`
I then went through the resulting fix and manually updated all of the member
variables which were missed due to them having a non-trivial constructor.

Note that the tool was only run on Linux, so code that only runs on some
platforms may have been missed.

The member variables that are still initialized in the contructor definition
are:
  - bitfields (not all currently supported compilers allow default-member-init
  - variables that are initialized via a parameter
  - variables that use code not visible in the header file

There are a few advantages to landing this change:
- fewer lines of code - now declaration is in the same place as initialization
  this also makes it easier to see when looking at the header.
- it makes it harder to miss initializing a member when adding a new contructor
- variables that depend on an include guard look much nicer now

Additionally I removed some unnecessary reinitialization of NetAddr members
(it has a constructor that does that now), and changed nsWifiScannerDBus to
use the thread-safe strtok_r instead of strtok.

Differential Revision: https://phabricator.services.mozilla.com/D116980
2021-06-11 07:10:41 +00:00
Csoregi Natalia 938a6943c6 Backed out changeset 6e00f8bd2acc (bug 1714307) for causing hazard bustage. CLOSED TREE 2021-06-09 21:50:03 +03:00
Valentin Gosu d1513f313e Bug 1714307 - Run modernize-use-default-member-init --fix check on netwerk r=necko-reviewers,kershaw
This changeset is the result of adding modernize-use-default-member-init to
tools/clang-tidy/config.yaml then proceeding to run
`./mach static-analysis check netwerk/ --fix`
I then went through the resulting fix and manually updated all of the member
variables which were missed due to them having a non-trivial constructor.

Note that the tool was only run on Linux, so code that only runs on some
platforms may have been missed.

The member variables that are still initialized in the contructor definition
are:
  - bitfields (not all currently supported compilers allow default-member-init
  - variables that are initialized via a parameter
  - variables that use code not visible in the header file

There are a few advantages to landing this change:
- fewer lines of code - now declaration is in the same place as initialization
  this also makes it easier to see when looking at the header.
- it makes it harder to miss initializing a member when adding a new contructor
- variables that depend on an include guard look much nicer now

Additionally I removed some unnecessary reinitialization of NetAddr members
(it has a constructor that does that now), and changed nsWifiScannerDBus to
use the thread-safe strtok_r instead of strtok.

Differential Revision: https://phabricator.services.mozilla.com/D116980
2021-06-09 10:20:04 +00:00
Valentin Gosu d595491cc7 Bug 1714307 - Autofix static-analysis warnings in netwerk/ r=necko-reviewers,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D116701
2021-06-04 12:35:16 +00:00
Butkovits Atila 692bda1ca1 Backed out changeset c4b44c4ef15b (bug 1714307) for causing build bustages on nsHTTPCompressConv.h. CLOSED TREE 2021-06-04 13:53:37 +03:00
Valentin Gosu 98146ae90b Bug 1714307 - Autofix static-analysis warnings in netwerk/ r=necko-reviewers,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D116701
2021-06-04 10:00:55 +00:00
Paul Zuehlcke 9cecd28621 Bug 1661330 - Log STATE_ALLOWED_TRACKING_CONTENT to the ContentBlockingLog if a channel is allowed. r=geckoview-reviewers,dimi,droeh
Differential Revision: https://phabricator.services.mozilla.com/D109716
2021-04-13 16:11:20 +00:00
Alexis Beingessner 3f1a425606 Bug 1686616 - make IO use Components instead of Services. r=kmag
Differential Revision: https://phabricator.services.mozilla.com/D105530
2021-02-18 13:26:32 +00:00
Alexis Beingessner bd14ca539e Bug 1686616 - make ThirdPartyUtil use Components instead of Services. r=kmag
Differential Revision: https://phabricator.services.mozilla.com/D105523
2021-02-18 13:26:29 +00:00
Masatoshi Kimura a29e207781 Bug 1685900 - Split internal and external contentPolicyType. r=ckerschb,smaug
Differential Revision: https://phabricator.services.mozilla.com/D101271
2021-01-15 12:07:16 +00:00
Narcis Beleuzu 0322452233 Backed out changeset a52961071dcd (bug 1685900) for Build bustage in nsContentSecurityManager.cpp. CLOSED TREE 2021-01-15 04:04:37 +02:00
Masatoshi Kimura b384f14cde Bug 1685900 - Split internal and external contentPolicyType. r=ckerschb,smaug
Differential Revision: https://phabricator.services.mozilla.com/D101271
2021-01-15 04:02:41 +02:00
Dorel Luca 9ed19e2828 Backed out changeset a52961071dcd (bug 1685900) for Build bustage in nsContentSecurityManager.cpp. CLOSED TREE 2021-01-15 02:45:34 +02:00
Masatoshi Kimura 87e50835c4 Bug 1685900 - Split internal and external contentPolicyType. r=ckerschb,smaug
Differential Revision: https://phabricator.services.mozilla.com/D101271
2021-01-14 20:44:54 +00:00
Simon Giesecke 9758d919eb Bug 1583109 - Use StringJoin(Append) where easily possible. r=nika
Bug 1583109 introduced new function templates StringJoin and StringJoinAppend.
These are now used to replace several custom loops across the codebase that
implement string-joining algorithms to simplify the code.

Differential Revision: https://phabricator.services.mozilla.com/D98750
2020-12-17 14:58:18 +00:00
Csoregi Natalia d8c9489b13 Backed out changeset 16d174e7c342 (bug 1583109) for bustage on nsReadableUtils.h. CLOSED TREE 2020-12-16 22:51:26 +02:00
Simon Giesecke 72babae175 Bug 1583109 - Use StringJoin(Append) where easily possible. r=nika
Bug 1583109 introduced new function templates StringJoin and StringJoinAppend.
These are now used to replace several custom loops across the codebase that
implement string-joining algorithms to simplify the code.

Differential Revision: https://phabricator.services.mozilla.com/D98750
2020-12-16 19:38:23 +00:00
Simon Giesecke 9379d0240f Bug 1679987 - Use nsTokenizedRange where easily possible. r=xpcom-reviewers,nika
Differential Revision: https://phabricator.services.mozilla.com/D98308
2020-12-16 19:10:34 +00:00
Simon Giesecke 971b645fe3 Bug 1660470 - Add missing include directives/forward declarations. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D87865
2020-11-23 16:21:38 +00:00
Ricky Stewart 02a7b4ebdf Bug 1654103: Standardize on Black for Python code in `mozilla-central`.
Allow-list all Python code in tree for use with the black linter, and re-format all code in-tree accordingly.

To produce this patch I did all of the following:

1. Make changes to tools/lint/black.yml to remove include: stanza and update list of source extensions.

2. Run ./mach lint --linter black --fix

3. Make some ad-hoc manual updates to python/mozbuild/mozbuild/test/configure/test_configure.py -- it has some hard-coded line numbers that the reformat breaks.

4. Make some ad-hoc manual updates to `testing/marionette/client/setup.py`, `testing/marionette/harness/setup.py`, and `testing/firefox-ui/harness/setup.py`, which have hard-coded regexes that break after the reformat.

5. Add a set of exclusions to black.yml. These will be deleted in a follow-up bug (1672023).

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D94045
2020-10-26 18:34:53 +00:00
Bogdan Tara da1098d4aa Backed out 10 changesets (bug 1654103, bug 1672023, bug 1518999) for PanZoomControllerTest.touchEventForResult gv-junit failures CLOSED TREE
Backed out changeset ff3fb0b4a512 (bug 1672023)
Backed out changeset e7834b600201 (bug 1654103)
Backed out changeset 807893ca8069 (bug 1518999)
Backed out changeset 13e6b92440e9 (bug 1518999)
Backed out changeset 8b2ac5a6c98a (bug 1518999)
Backed out changeset 575748295752 (bug 1518999)
Backed out changeset 65f07ce7b39b (bug 1518999)
Backed out changeset 4bb80556158d (bug 1518999)
Backed out changeset 8ac8461d7bd7 (bug 1518999)
Backed out changeset e8ba13ee17f5 (bug 1518999)
2020-10-24 03:36:18 +03:00
Ricky Stewart c0cea3b0fa Bug 1654103: Standardize on Black for Python code in `mozilla-central`. r=remote-protocol-reviewers,marionette-reviewers,webdriver-reviewers,perftest-reviewers,devtools-backward-compat-reviewers,jgilbert,preferences-reviewers,sylvestre,maja_zf,webcompat-reviewers,denschub,ntim,whimboo,sparky
Allow-list all Python code in tree for use with the black linter, and re-format all code in-tree accordingly.

To produce this patch I did all of the following:

1. Make changes to tools/lint/black.yml to remove include: stanza and update list of source extensions.

2. Run ./mach lint --linter black --fix

3. Make some ad-hoc manual updates to python/mozbuild/mozbuild/test/configure/test_configure.py -- it has some hard-coded line numbers that the reformat breaks.

4. Make some ad-hoc manual updates to `testing/marionette/client/setup.py`, `testing/marionette/harness/setup.py`, and `testing/firefox-ui/harness/setup.py`, which have hard-coded regexes that break after the reformat.

5. Add a set of exclusions to black.yml. These will be deleted in a follow-up bug (1672023).

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D94045
2020-10-23 20:40:42 +00:00
Dorel Luca 1ff59cb7a3 Backed out changeset 7558c8821a07 (bug 1654103) for multiple failures. CLOSED TREE 2020-10-22 03:51:06 +03:00
Ricky Stewart 50762dacab Bug 1654103: Standardize on Black for Python code in `mozilla-central`. r=remote-protocol-reviewers,marionette-reviewers,webdriver-reviewers,perftest-reviewers,devtools-backward-compat-reviewers,jgilbert,preferences-reviewers,sylvestre,maja_zf,webcompat-reviewers,denschub,ntim,whimboo,sparky
Allow-list all Python code in tree for use with the black linter, and re-format all code in-tree accordingly.

To produce this patch I did all of the following:

1. Make changes to tools/lint/black.yml to remove include: stanza and update list of source extensions.

2. Run ./mach lint --linter black --fix

3. Make some ad-hoc manual updates to python/mozbuild/mozbuild/test/configure/test_configure.py -- it has some hard-coded line numbers that the reformat breaks.

4. Add a set of exclusions to black.yml. These will be deleted in a follow-up bug (1672023).

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D94045
2020-10-21 21:27:27 +00:00
Dimi Lee 7a61308533 Bug 1669731 - P3. Add Allow API to ChannelClassifierService. r=timhuang,nhnt11
UI needs to distinguish the cases when a channel is shimmed and is
unshimmed.
When a channel is unshimmed, we unblock the channel and simply treat the channel as a
non-tracking channel.
When a channel is shimmed, although the channel is unblocked by
URLCLassifier, we still want to show it in the UI. For this case,
URLClassifier will notify a content blocking event when a channel is
unblocked.

This patch adds a new allow API, so the caller can use unblock() or
allow() depending upon the case it requires.

Differential Revision: https://phabricator.services.mozilla.com/D93271
2020-10-14 09:17:04 +00:00
Dimi Lee d56e33dd5e Bug 1669731 - P1. Rename STATE_UNBLOCKED_UNSAFE_CONTENT to STATE_UNBLOCKED_TRACKING_CONTENT r=timhuang
unsafe content is for Safe Browsing(phishing, malware, etc), we should use tracking content instead.

Differential Revision: https://phabricator.services.mozilla.com/D93269
2020-10-14 09:16:39 +00:00
Simon Giesecke de7bab0f06 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
Dimi Lee f3da525903 Bug 1662362 - Record STATE_UNBLOCKED_UNSAFE_CONTENT event to content blocking log when unblock API of URL Classifier is called r=nhnt11,timhuang
Differential Revision: https://phabricator.services.mozilla.com/D88957
2020-09-11 17:48:29 +00:00
Dimi Lee 98b1f35a8b Bug 1652927 - Refine URL Classifier logging r=baku
This patch does the following:
1. Introduce a new log module "nsChannelClassifierLeak" for less
   important debug message
2. Sync the format of debug message - "ClassName::FunctionName - description [this]"
3. Print uri and top-level uri in the entry point of
   AsyncChannelClassifier, remove logging uri in some functions

Differential Revision: https://phabricator.services.mozilla.com/D83610
2020-07-20 10:09:37 +00:00
Butkovits Atila 24034383b2 Backed out changeset 2c0c87130a49 (bug 1652927) for bustage at nsChannelClassifier.cpp. CLOSED TREE 2020-07-20 12:48:06 +03:00
Dimi Lee 9b282b34b5 Bug 1652927 - Refine URL Classifier logging r=baku
This patch does the following:
1. Introduce a new log module "nsChannelClassifierLeak" for less
   important debug message
2. Sync the format of debug message - "ClassName::FunctionName - description [this]"
3. Print uri and top-level uri in the entry point of
   AsyncChannelClassifier, remove logging uri in some functions

Differential Revision: https://phabricator.services.mozilla.com/D83610
2020-07-17 18:45:52 +00:00
Simon Giesecke 202c188ca0 Bug 1652960 - Remove unnecessary includes from Document.h. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D83634
2020-07-15 15:48:53 +00:00
Sylvestre Ledru 1dbb63db2b Bug 1519636 - Reformat recent changes to the Google coding style r=andi
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D83258
2020-07-14 09:34:19 +00:00
Kris Maglione 9d78661f88 Bug 1649221: Update ChromeUtils.generateQI callers to pass strings. r=mccr8,remote-protocol-reviewers,marionette-reviewers,perftest-reviewers,webcompat-reviewers,geckoview-reviewers,preferences-reviewers,agi,whimboo,Bebe,twisniewski
Differential Revision: https://phabricator.services.mozilla.com/D81594
2020-07-10 23:58:28 +00:00
Dimi Lee c8306bf2d9 Bug 1447935 - P2. Use fission-compatible third-party checks r=baku
Differential Revision: https://phabricator.services.mozilla.com/D80187
2020-07-09 20:10:18 +00:00
Dimi Lee 5c5dfa4064 Bug 1447935 - P1. CreatePairwiseEntitylist uses loading principal when a channel doesn't have an associated top-level window r=baku
loads in appcache doesn't have a top-level window, use loading principal
instead.

Differential Revision: https://phabricator.services.mozilla.com/D80186
2020-07-09 20:10:16 +00:00
Razvan Maries cb161b6b55 Backed out 2 changesets (bug 1447935) for perma failures on test_headless.js. CLOSED TREE
Backed out changeset 0332d1b01f63 (bug 1447935)
Backed out changeset bcf6ab4e4f50 (bug 1447935)
2020-07-09 15:53:12 +03:00
Dimi Lee 84e027594f Bug 1447935 - P2. Use fission-compatible third-party checks r=baku
Differential Revision: https://phabricator.services.mozilla.com/D80187
2020-07-09 11:32:45 +00:00
Dimi Lee 3f4421f020 Bug 1447935 - P1. CreatePairwiseEntitylist uses loading principal when a channel doesn't have an associated top-level window r=baku
loads in appcache doesn't have a top-level window, use loading principal
instead.

Differential Revision: https://phabricator.services.mozilla.com/D80186
2020-07-09 11:32:37 +00:00
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