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

171 Коммитов

Автор SHA1 Сообщение Дата
edgul 57acf63da4 Bug 1745972 - Added assertions to verify additions and removals of mRecs. r=necko-reviewers,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D161215
2022-12-12 21:32:12 +00:00
Randell Jesup 4c109a25fb Bug 1207753 - netwerk/cache2 thread-safety annotations r=necko-reviewers,valentin
Differential Revision: https://phabricator.services.mozilla.com/D160392
2022-11-12 00:00:49 +00:00
Cristian Tuns ee55bd7851 Backed out changeset 6a036b7abe73 (bug 1207753) for causing build bustages CacheFile.h CLOSED TREE 2022-11-11 15:26:46 -05:00
Randell Jesup 4c09f799cd Bug 1207753 - netwerk/cache2 thread-safety annotations r=necko-reviewers,valentin
Differential Revision: https://phabricator.services.mozilla.com/D160392
2022-11-11 20:07:26 +00:00
edguloien 6f463ede32 Bug 1745972 - Dispatch cache wrapper deletion to caller thread to acquire lock before deletion and safety-removal from frecency array. r=kershaw,necko-reviewers,valentin
Differential Revision: https://phabricator.services.mozilla.com/D151764
2022-08-29 17:29:32 +00:00
Randell Jesup c5917ed65a Bug 1207753: Basic thread-safety annotations to quiet errors until real annotations land r=nika
Differential Revision: https://phabricator.services.mozilla.com/D141062
2022-03-17 18:39:15 +00:00
Kershaw Chang ca859523ff Bug 1745972 - Check if CacheIndexRecordWrapper is still in mFrecencyArray, r=necko-reviewers,valentin
The idea in this patch is like D99680, but the difference is that mFrecencyArray now contains CacheIndexRecordWrapper.
This should be able to help us track why CacheIndexRecordWrapper is released before removing it from mFrecencyArray.

Differential Revision: https://phabricator.services.mozilla.com/D139469
2022-03-11 19:40:44 +00:00
Randell Jesup 6ef1621b21 Bug 1747439: netwerk/cache2 cleanup r=necko-reviewers,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D135167
2022-01-12 20:38:37 +00:00
Marian-Vasile Laza 205e4f70a7 Backed out changeset 7c1a1109d729 (bug 1747439) for causing build bustages on CacheEntry.cpp. CLOSED TREE 2022-01-12 16:52:24 +02:00
Randell Jesup 4037dc1397 Bug 1747439: netwerk/cache2 cleanup r=necko-reviewers,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D135167
2022-01-12 13:54:01 +00:00
Randell Jesup 3a919a88f1 Bug 1746875: netwerk/cache memory reporter cleanup r=necko-reviewers,dragana
Differential Revision: https://phabricator.services.mozilla.com/D134294
2021-12-21 22:52:17 +00:00
Kershaw Chang c4afcf5b50 Bug 1662676 - Use a proof of lock everywhere, r=necko-reviewers,dragana
Differential Revision: https://phabricator.services.mozilla.com/D118163
2021-06-21 21:18:38 +00:00
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
Kershaw Chang e412a4f3bf Bug 1662676 - Wrap CacheIndexRecord, r=necko-reviewers,dragana
Differential Revision: https://phabricator.services.mozilla.com/D113112
2021-05-17 21:16:33 +00:00
Dorel Luca 241907c8fc Backed out changeset dc1a00f252c8 (bug 1662676) for cpp failures in CacheIndexRecordWrapper. CLOSED TREE 2021-05-17 18:13:14 +03:00
Kershaw Chang f5dce82d78 Bug 1662676 - Wrap CacheIndexRecord, r=necko-reviewers,dragana
Differential Revision: https://phabricator.services.mozilla.com/D113112
2021-05-17 13:55:45 +00:00
Kershaw Chang 318303d8e8 Bug 1662676 - Add diagnostic assertion at more places r=necko-reviewers,dragana
Differential Revision: https://phabricator.services.mozilla.com/D106939
2021-03-09 08:35:45 +00:00
David Major bc943f076f Bug 1688292 - Fix non-unified build errors in netwerk/cache2/ r=necko-reviewers,valentin
This is a drive-by fix while I was looking into something else.

Differential Revision: https://phabricator.services.mozilla.com/D102795
2021-01-25 12:23:13 +00:00
Kershaw Chang 0eebf69d04 Bug 1662676 r=necko-reviewers,valentin
Differential Revision: https://phabricator.services.mozilla.com/D99680
2020-12-22 16:44:36 +00:00
Butkovits Atila d25ca898cd Backed out changeset 9b4ab01fda40 (bug 1662676) for gv-junit failures. CLOSED TREE 2020-12-21 20:20:04 +02:00
Kershaw Chang 1c40c3d129 Bug 1662676 r=necko-reviewers,valentin
Differential Revision: https://phabricator.services.mozilla.com/D99680
2020-12-21 15:19:46 +00:00
Michal Novotny fe4555c51f Bug 1662011 - Remove hash stats code from the cache, r=valentin,necko-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D88739
2020-08-31 06:53:06 +00:00
Michal Novotny a58fc4abae Bug 1645052 - Do not store number of bytes written to the cache in preferences, r=valentin,necko-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D88488
2020-08-28 09:22:45 +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
MahakBansal 4452860213 Bug 1614659 - CacheIndex::Shutdown() should not check if files exist before removing them.r=michal
Differential Revision: https://phabricator.services.mozilla.com/D70094

--HG--
extra : moz-landing-system : lando
2020-04-10 08:14:19 +00:00
Michal Novotny 3ab8b4b548 Bug 1614619 - Eviction algorithm should first evict entries of a content type that’s above a limit r=valentin
This patch implements limit for media content type in the cache. When we need to evict something from the cache and media is over the limit, it's evicted first.

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

--HG--
extra : moz-landing-system : lando
2020-03-02 12:17:32 +00:00
Michal Novotny 47f2a10a01 Bug 1614610 - Have cache occupancy for each content-type in cache index r=valentin
Differential Revision: https://phabricator.services.mozilla.com/D63624

--HG--
extra : moz-landing-system : lando
2020-02-24 09:09:54 +00:00
Simon Giesecke b50347f917 Bug 1611415 - Prefer using std::move over forget. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D60980

--HG--
extra : moz-landing-system : lando
2020-02-13 14:38:48 +00:00
shindli 91aa0518dd Backed out changeset 0c982bc69cb3 (bug 1611415) for causing build bustages in /builds/worker/workspace/build/src/obj-firefox/dist/include/nsCOMPtr CLOSED TREE 2020-02-12 20:13:29 +02:00
Simon Giesecke f604a47fa5 Bug 1611415 - Applied FixItHints from mozilla-non-std-move. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D60980

--HG--
extra : moz-landing-system : lando
2020-02-12 17:24:41 +00:00
Eric Rahm 2c08316c5d Bug 1610070 - Part 3: Convert the rest of netwerk/ to use UniquePtr. r=mayhemer
Differential Revision: https://phabricator.services.mozilla.com/D60341

--HG--
extra : moz-landing-system : lando
2020-02-11 16:20:08 +00:00
Sylvestre Ledru 187e9bafaf Bug 1519636 - Automatically reformat recent changes using clang-format r=Ehsan
# ignore-this-changeset

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

--HG--
extra : moz-landing-system : lando
2020-01-21 09:51:27 +00:00
Michal Novotny b66b7fa491 Bug 1606207 - Remove first-party cache isolation telemetry r=mayhemer
Differential Revision: https://phabricator.services.mozilla.com/D59352

--HG--
extra : moz-landing-system : lando
2020-01-14 13:53:01 +00:00
Chris Peterson 406763af7f Bug 1570499 - Part 1: Replace MOZ_FALLTHROUGH macro with C++17's [[fallthrough]] attribute. r=froydnj
This changeset is a simple find and replace of `MOZ_FALLTHROUGH` and `[[fallthrough]]`.

Unfortunately, the MOZ_FALLTHROUGH_ASSERT macro (to assert on case fallthrough in debug builds) is still necessary after switching from [[clang::fallthrough]] to [[fallthrough]] because:

* MOZ_ASSERT(false) followed by [[fallthrough]] triggers a -Wunreachable-code warning in DEBUG builds
* but MOZ_ASSERT(false) without [[fallthrough]] triggers a -Wimplicit-fallthrough warning in NDEBUG builds.

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

--HG--
extra : moz-landing-system : lando
2019-12-20 07:16:43 +00:00
Gabriele Svelto 5dc21d568c 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

--HG--
extra : moz-landing-system : lando
2019-12-06 09:17:57 +00:00
Emilio Cobos Álvarez 74327c26b4 Bug 1599615 - Make some necko code less nsresult-happy. r=kershaw,valentin
Stuff that's infallible and not virtual has no reason to return an nsresult.

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

--HG--
extra : moz-landing-system : lando
2019-12-02 13:21:06 +00:00
Michal Novotny 224fc95a6b Bug 1548472 - Collect telemetry about how is the cache split by the content type, r=mayhemer
Like in case of bug 1506534, this telemetry is sampled periodically every time 2GB of data is written to the cache, i.e. when the cache was used for some time and there is a chance that its content has changed significantly.

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

--HG--
extra : moz-landing-system : lando
2019-05-08 13:15:40 +00:00
Sylvestre Ledru e226046cb8 Bug 1547143 - Format the tree: Be prescriptive with the pointer style (left) r=Ehsan
# ignore-this-changeset

Depends on D28954

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

--HG--
extra : moz-landing-system : lando
2019-05-01 08:47:10 +00:00
Michal Novotny 1efe8b8b26 Bug 1506534 - Collect telemetry to measure how much penalty we will experience with first-party cache isolation, r=mayhemer, data-r=chutten
Whenever a cache entry is accessed during a document load, eTLD+1 of the top level document is added to the entry's metadata. Number of accessing sites is also stored in cache index. So we know how many copies of each entry would we have if we did a first party isolation without data deduplication. The telemetry is sent every time we write 2GB to the cache and then the data is reset. Telemetry report ID is an identifier of the telemetry cycle and it's used to invalidate eTLD+1 hashes in all cache entries.

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

--HG--
extra : moz-landing-system : lando
2019-04-25 12:21:17 +00:00
Michal Novotny 98cbfe2ba6 Bug 1533369 - Add content type to cache index, r=mayhemer
This patch adds content-type to metadata in cache entry and it is then propagated down to the cache index.

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

--HG--
extra : moz-landing-system : lando
2019-03-27 14:32:12 +00:00
Michal Novotny 8f0afd4311 Bug 1151815 - Remove expiration time from the cache index, r=mayhemer
Differential Revision: https://phabricator.services.mozilla.com/D22499

--HG--
extra : moz-landing-system : lando
2019-03-11 14:29:34 +00:00
Sylvestre Ledru 265e672179 Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
# ignore-this-changeset

--HG--
extra : amend_source : 4d301d3b0b8711c4692392aa76088ba7fd7d1022
2018-11-30 11:46:48 +01:00
Chris Peterson 2afd829d0f Bug 1469769 - Part 6: Replace non-failing NS_NOTREACHED with MOZ_ASSERT_UNREACHABLE. r=froydnj
This patch is an automatic replacement of s/NS_NOTREACHED/MOZ_ASSERT_UNREACHABLE/. Reindenting long lines and whitespace fixups follow in patch 6b.

MozReview-Commit-ID: 5UQVHElSpCr

--HG--
extra : rebase_source : 4c1b2fc32b269342f07639266b64941e2270e9c4
extra : source : 907543f6eae716f23a6de52b1ffb1c82908d158a
2018-06-17 22:43:11 -07:00
Kris Maglione 6b12d08f7d Bug 1462937: Update callers to use nsIFile::GetDirectoryEntries as a nsIDirectoryEnumerator. r=froydnj
MozReview-Commit-ID: Iv4T1MVAF5

--HG--
extra : rebase_source : 1c518883d082884db7f9323a5acc20361228c26b
extra : histedit_source : 70a73c23d1199d3bfbb5379c78930401166c094b
2018-05-19 20:17:45 -07:00
Andi-Bogdan Postelnicu 3f2298c2f6 Bug 1457411 - Update netwerk module to make use of newer methods introduced with c++11 and c++14. r=valentin
MozReview-Commit-ID: 666LNaHyiuQ

--HG--
extra : rebase_source : f3a24e0342d8dcdf9020dd473bc6b1045cbc533b
2018-04-30 19:46:04 +03:00