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

310 Коммитов

Автор SHA1 Сообщение Дата
Doug Thayer 3f9b0177d2 Bug 1616186 - Don't try to write StartupCache if it doesn't exist r=froydnj
The exact circumstances of how this is showing up in the wild aren't
clear - there seem to be a couple of ways we can get here. However it
all revolves around early shutdowns (i.e., from the select profile popup)
- before the StartupCache is ever initialized. In any case, the solution
shouldn't change based on the exact circumstances - if we don't have a
StartupCache, there's no need to write one. Also, don't bother lazy
initializing it if it doesn't exist yet.

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

--HG--
extra : moz-landing-system : lando
2020-02-18 17:49:47 +00:00
Doug Thayer c5782f5af1 Bug 1615045 - Remove mWrittenOnce data race r=decoder
Reordering the mWrittenOnce check should be sufficient to eliminate
the data race; however, I made mWrittenOnce an atomic just to reduce
the fragility of this since it is intended to be written from and
read to on multiple threads.

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

--HG--
extra : moz-landing-system : lando
2020-02-14 20:29:48 +00:00
Doug Thayer bce7bb97fe Bug 1615045 - Remove extraneous extra write to StartupCache r=froydnj
This was just left in, and does not need to be here. We want to be
spawning the background thread here which we will wait on from
xpcom-shutdown.

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

--HG--
extra : moz-landing-system : lando
2020-02-14 20:29:21 +00:00
Cosmin Sabou 302a8d76a6 Backed out 2 changesets (bug 1615045) for tsan failures on StartupCache.cpp.
CLOSED TREE

Backed out changeset c0414b3adbe8 (bug 1615045)
Backed out changeset 56ef1d43a305 (bug 1615045)
2020-02-14 19:32:41 +02:00
Doug Thayer 4509399ad6 Bug 1615045 - Remove extraneous extra write to StartupCache r=froydnj
This was just left in, and does not need to be here. We want to be
spawning the background thread here which we will wait on from
xpcom-shutdown.

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

--HG--
extra : moz-landing-system : lando
2020-02-14 13:40:16 +00:00
Doug Thayer f564eb1f40 Bug 1607505 - Start writing StartupCache earlier in shutdown r=froydnj a=reland CLOSED TREE
The initial thought for getting the StartupCache out of the shutdown
path was to simply not write it during shutdown, as it should write
60 seconds after startup, and the theory was that if the user shut
down within the first 60 seconds of use, they were likely updating or
something and it shouldn't matter. However, considering how many of
our users only ever open one tab, I think it's rather likely that
users are starting up firefox to go to a web site, then closing it
when done with that website, and then maybe opening up a new instance
in order to go to a different website. Accordingly it still makes
sense to continue writing it. However, we may as well leverage a
background thread for this and get it kicked off earlier during
shutdown, so we don't sit there blocking in the destructor late
during shutdown.

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

--HG--
extra : source : 7b7b147b6955cee07e0c115993446bfbd59cf7e2
extra : histedit_source : 6990122d6b1ac4939b0e4b0a5e452183fb981e19
2020-02-12 19:02:12 +00:00
shindli cdd059e2c2 Backed out 2 changesets (bug 1607505) for causing xpcshell permafailures in netwerk/test/unit/test_alt-data_simple.js CLOSED TREE
Backed out changeset d79f1d283acd (bug 1607505)
Backed out changeset 7b7b147b6955 (bug 1607505)
2020-02-12 22:37:08 +02:00
Doug Thayer d1210e8164 Bug 1607505 - Start writing StartupCache earlier in shutdown r=froydnj
The initial thought for getting the StartupCache out of the shutdown
path was to simply not write it during shutdown, as it should write
60 seconds after startup, and the theory was that if the user shut
down within the first 60 seconds of use, they were likely updating or
something and it shouldn't matter. However, considering how many of
our users only ever open one tab, I think it's rather likely that
users are starting up firefox to go to a web site, then closing it
when done with that website, and then maybe opening up a new instance
in order to go to a different website. Accordingly it still makes
sense to continue writing it. However, we may as well leverage a
background thread for this and get it kicked off earlier during
shutdown, so we don't sit there blocking in the destructor late
during shutdown.

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

--HG--
extra : moz-landing-system : lando
2020-02-12 19:02:12 +00:00
Cosmin Sabou d115a145d6 Backed out 2 changesets (bug 1607505) for causing bc leaks in browser_startupcache_telemetry.
Backed out changeset eb423c859513 (bug 1607505)
Backed out changeset db2b0b9a9886 (bug 1607505)

--HG--
extra : amend_source : fbcabe4b0dbda5d493ab988e97e727205986ba9d
2020-02-12 04:36:23 +02:00
Doug Thayer 6281907674 Bug 1607505 - Start writing StartupCache earlier in shutdown r=froydnj
The initial thought for getting the StartupCache out of the shutdown
path was to simply not write it during shutdown, as it should write
60 seconds after startup, and the theory was that if the user shut
down within the first 60 seconds of use, they were likely updating or
something and it shouldn't matter. However, considering how many of
our users only ever open one tab, I think it's rather likely that
users are starting up firefox to go to a web site, then closing it
when done with that website, and then maybe opening up a new instance
in order to go to a different website. Accordingly it still makes
sense to continue writing it. However, we may as well leverage a
background thread for this and get it kicked off earlier during
shutdown, so we don't sit there blocking in the destructor late
during shutdown.

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

--HG--
extra : moz-landing-system : lando
2020-02-11 19:14:35 +00:00
Doug Thayer 87af0f0874 Bug 1606102 - Don't use putNew in StartupCache::LoadArchive r=froydnj
We can't guarantee uniqueness of the keys here because the file might
be corrupt. So we should check if the key exists and if it does, bail
out.

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

--HG--
extra : moz-landing-system : lando
2019-12-30 18:50:56 +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
Doug Thayer cc57ad9bcb Bug 1587112 - Make asserts in StartupCache::LoadArchive explicit r=njn
There is no behavior change here - these asserts were previously being hit
inside the operator+ of RangedPtr, but this makes them explicit.

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

--HG--
extra : moz-landing-system : lando
2019-10-22 03:15:18 +00:00
Doug Thayer 8ef17f5f9f Bug 1586744 - Explicitly track StartupCache table's memory r=njn
This was not being fully tracked as a result of bug 1550108.

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

--HG--
extra : moz-landing-system : lando
2019-10-16 15:41:54 +00:00
Doug Thayer aa100ca679 Bug 1587107 - Increase StartupCache bg thread stack sizes r=njn
In bug 1550108 we added a thread to prefetch the contents of the
startup cache file, and as part of that we reduced its stack size
and the stack size of the thread which writes the file. However
it seems we set the write thread's stack size too low.

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

--HG--
extra : moz-landing-system : lando
2019-10-10 05:39:15 +00:00
Doug Thayer c93f700860 Bug 1550108 - Reduce stack size on StartupCache threads r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D46225

--HG--
extra : moz-landing-system : lando
2019-10-04 20:45:41 +00:00
Doug Thayer e64355e5cd Bug 1550108 - Prefetch StartupCache off main thread r=froydnj
Does what it says on the tin. Once we have a central scheduling
system this should likely just consume that.

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

--HG--
extra : moz-landing-system : lando
2019-10-04 20:45:32 +00:00
Doug Thayer 87f736bc12 Bug 1550108 - Compact the StartupCache if it is bloated r=froydnj
The first run loads more things into the StartupCache than are
used on the second and subsequent runs. This just ensures that if
the StartupCache diverges too far from its actual use that we will
rebuild it.

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

--HG--
extra : moz-landing-system : lando
2019-10-04 20:45:18 +00:00
Doug Thayer 5a64723655 Bug 1550108 - Eliminate large buffer copies from StartupCache r=froydnj
The signatures were updated in the previous patch to hand us the raw,
uncopied buffers. This just adjusts the callsites to match.

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

--HG--
extra : moz-landing-system : lando
2019-10-04 20:45:09 +00:00
Doug Thayer a74957c6e6 Bug 1550108 - Change StartupCache format from zip to custom r=froydnj
I am not aware of anything that depends on StartupCache being a
zip file, and since I want to use lz4 compression because inflate
is showing up quite a lot in profiles, it's simplest to just use
a custom format. This loosely mimicks the ScriptPreloader code,
with a few diversions:

- Obviously the contents of the cache are compressed. I used lz4
  for this as I hit the same file size as deflate at a compression
  level of 1, which is what the StartupCache was using previously,
  while decompressing an order of magnitude faster. Seemed like
  the most conservative change to make. I think it's worth
  investigating what the impact of slower algs with higher ratios
  would be, but for right now I settled on this. We'd probably
  want to look at zstd next.
- I use streaming compression for this via lz4frame. This is not
  strictly necessary, but has the benefit of not requiring as
  much memory for large buffers, as well as giving us a built-in
  checksum, rather than relying on the much slower CRC that we
  were doing with the zip-based approach.
- I coded the serialization of the headers inline, since I had to
  jump back to add the offset and compressed size, which would
  make the nice Code(...) method for the ScriptPreloader stuff
  rather more complex. Open to cleaner solutions, but moving it
  out just felt like extra hoops for the reader to jump through
  to understand without the benefit of being more concise.

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

--HG--
extra : moz-landing-system : lando
2019-10-04 20:44:59 +00:00
Doug Thayer 47ada02be2 Bug 1550108 - Avoid decompressing entries just to check if they exist r=kmag
This will not behave exactly the same if we had previously written bad
data for the entry that would fail to decompress. I imagine this is rare
enough, and the consequences are not severe enough, that this should be
fine.

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

--HG--
extra : moz-landing-system : lando
2019-10-04 20:44:32 +00:00
Doug Thayer 05e64f1f70 Bug 1550108 - Don't read from app/gre caches in StartupCache r=kmag
I thought I had already written out the patch to remove these, but
apparently not. Per discussion in the startup cache telemetry bug,
there should be no reason for doing this.

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

--HG--
extra : moz-landing-system : lando
2019-10-04 20:44:18 +00:00
Cosmin Sabou 14938bad3b Backed out 10 changesets (bug 1550108) for causing build bustages on StartupCache.cpp.
Backed out changeset cbadfa2bbd7e (bug 1550108)
Backed out changeset 2560f0ab6ebf (bug 1550108)
Backed out changeset 0a1fa8d8bb3c (bug 1550108)
Backed out changeset 62416909cf67 (bug 1550108)
Backed out changeset 60991713b1e2 (bug 1550108)
Backed out changeset f950e30afd90 (bug 1550108)
Backed out changeset e63d0a1fec38 (bug 1550108)
Backed out changeset 7a009d42e7e7 (bug 1550108)
Backed out changeset 395affa4c205 (bug 1550108)
Backed out changeset 0fd41e9dbd2a (bug 1550108)

--HG--
rename : mfbt/lz4/lz4.c => mfbt/lz4.c
rename : mfbt/lz4/lz4.h => mfbt/lz4.h
2019-09-29 01:14:31 +03:00
Doug Thayer 4fce63cac2 Bug 1550108 - Reduce stack size on StartupCache threads r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D46225

--HG--
extra : moz-landing-system : lando
2019-09-27 18:17:23 +00:00
Doug Thayer 8d6b517ecd Bug 1550108 - Prefetch StartupCache off main thread r=froydnj
Does what it says on the tin. Once we have a central scheduling
system this should likely just consume that.

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

--HG--
extra : moz-landing-system : lando
2019-09-27 18:17:21 +00:00
Doug Thayer 4187f5ece3 Bug 1550108 - Compact the StartupCache if it is bloated r=froydnj
The first run loads more things into the StartupCache than are
used on the second and subsequent runs. This just ensures that if
the StartupCache diverges too far from its actual use that we will
rebuild it.

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

--HG--
extra : moz-landing-system : lando
2019-09-27 18:17:17 +00:00
Doug Thayer cf2166a011 Bug 1550108 - Eliminate large buffer copies from StartupCache r=froydnj
The signatures were updated in the previous patch to hand us the raw,
uncopied buffers. This just adjusts the callsites to match.

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

--HG--
extra : moz-landing-system : lando
2019-09-27 18:17:13 +00:00
Doug Thayer eb024f4ee6 Bug 1550108 - Change StartupCache format from zip to custom r=froydnj
I am not aware of anything that depends on StartupCache being a
zip file, and since I want to use lz4 compression because inflate
is showing up quite a lot in profiles, it's simplest to just use
a custom format. This loosely mimicks the ScriptPreloader code,
with a few diversions:

- Obviously the contents of the cache are compressed. I used lz4
  for this as I hit the same file size as deflate at a compression
  level of 1, which is what the StartupCache was using previously,
  while decompressing an order of magnitude faster. Seemed like
  the most conservative change to make. I think it's worth
  investigating what the impact of slower algs with higher ratios
  would be, but for right now I settled on this. We'd probably
  want to look at zstd next.
- I use streaming compression for this via lz4frame. This is not
  strictly necessary, but has the benefit of not requiring as
  much memory for large buffers, as well as giving us a built-in
  checksum, rather than relying on the much slower CRC that we
  were doing with the zip-based approach.
- I coded the serialization of the headers inline, since I had to
  jump back to add the offset and compressed size, which would
  make the nice Code(...) method for the ScriptPreloader stuff
  rather more complex. Open to cleaner solutions, but moving it
  out just felt like extra hoops for the reader to jump through
  to understand without the benefit of being more concise.

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

--HG--
extra : moz-landing-system : lando
2019-09-27 22:15:35 +00:00
Doug Thayer 5f9554635c Bug 1550108 - Avoid decompressing entries just to check if they exist r=kmag
This will not behave exactly the same if we had previously written bad
data for the entry that would fail to decompress. I imagine this is rare
enough, and the consequences are not severe enough, that this should be
fine.

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

--HG--
extra : moz-landing-system : lando
2019-09-27 22:15:01 +00:00
Doug Thayer 5775d5e284 Bug 1550108 - Don't read from app/gre caches in StartupCache r=kmag
I thought I had already written out the patch to remove these, but
apparently not. Per discussion in the startup cache telemetry bug,
there should be no reason for doing this.

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

--HG--
extra : moz-landing-system : lando
2019-09-27 22:15:01 +00:00
Tom Schuster 0e913c22c4 Bug 1558915 - Use infallible nsIURI::SchemeIs in various places r=Ehsan
Differential Revision: https://phabricator.services.mozilla.com/D40677

--HG--
extra : moz-landing-system : lando
2019-08-07 19:49:40 +00:00
Cosmin Sabou c3430326e6 Backed out changeset ca88862d6b63 (bug 1558915) for causing build bustages on StartupCacheUtils. CLOSED TREE 2019-08-07 13:20:32 +03:00
Tom Schuster 8bc1f5ada8 Bug 1558915 - Use infallible nsIURI::SchemeIs in various places r=Ehsan
Differential Revision: https://phabricator.services.mozilla.com/D40677

--HG--
extra : moz-landing-system : lando
2019-08-07 09:36:56 +00:00
Razvan Maries eedbf1137f Backed out changeset b197ca57677a (bug 1558915) for build bustages. CLOSED TREE 2019-08-07 01:04:43 +03:00
Tom Schuster 03c7998ef2 Bug 1558915 - Use infallible nsIURI::SchemeIs in various places r=Ehsan
Differential Revision: https://phabricator.services.mozilla.com/D40677

--HG--
extra : moz-landing-system : lando
2019-08-06 20:19:41 +00:00
Mark Banner e88940a4dc Bug 1554162 - Enable ESLint for startupcache/. r=froydnj
Depends on D32493

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

--HG--
rename : startupcache/test/browser.ini => startupcache/test/browser/browser.ini
rename : startupcache/test/browser_startupcache_telemetry.js => startupcache/test/browser/browser_startupcache_telemetry.js
extra : moz-landing-system : lando
2019-05-25 02:07:26 +00:00
Mike Conley ddb4502ec8 Bug 1544037 - Skip exists check when trying to open startupcache zip file archive. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D31086

--HG--
extra : moz-landing-system : lando
2019-05-21 17:32:45 +00:00
Andreea Pavel 846e7d0d9b Backed out 2 changesets (bug 1544037) for build bustages at StartupCache.cpp on a CLOSED TREE
Backed out changeset 8242c6c52f6c (bug 1544037)
Backed out changeset c19e86931d1a (bug 1544037)
2019-05-21 17:06:26 +03:00
Mike Conley 8cfb70661e Bug 1544037 - Skip exists check when trying to open startupcache zip file archive. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D31086

--HG--
extra : moz-landing-system : lando
2019-05-16 18:53:59 +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
Gijs Kruitbosch 8ea5584575 Bug 1543970 - give up removing the startup cache file from the previous profile location after 6 years, r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D27280

--HG--
extra : moz-landing-system : lando
2019-04-12 14:07:40 +00:00
Mark Banner 444bfa1fba Bug 1536091 - Relax the startup cache test restrictions to account for QuantumBar not loading search-one-offs.js. r=kmag
Differential Revision: https://phabricator.services.mozilla.com/D26684

--HG--
extra : moz-landing-system : lando
2019-04-11 07:20:16 +00:00
Gijs Kruitbosch 1e96300cf3 Bug 1353013 - create preloaded newtab browser from an idle task, only in top window(s), r=dthayer
This limits us to 1 preloaded browser per window, in the top 3 normal windows + top 3 private windows.
If we try to create additional browsers beyond that, we instead move a pre-existing browser across.

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

--HG--
extra : moz-landing-system : lando
2019-03-19 17:29:48 +00:00
shindli a7af1edc71 Backed out 3 changesets (bug 1353013) for a11y failures in accessible/tests/mochitest/relations/test_tabbrowser.xul CLOSED TREE
Backed out changeset af8bce2330e9 (bug 1353013)
Backed out changeset a3d1302b06c0 (bug 1353013)
Backed out changeset 976afd1adf84 (bug 1353013)
2019-03-18 18:21:16 +02:00
Gijs Kruitbosch e306931fb1 Bug 1353013 - create preloaded newtab browser from an idle task, only in top window(s), r=dthayer
This limits us to 1 preloaded browser per window, in the top 3 normal windows + top 3 private windows.
If we try to create additional browsers beyond that, we instead move a pre-existing browser across.

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

--HG--
extra : moz-landing-system : lando
2019-03-12 14:34:39 +00:00
Doug Thayer 55db157391 Bug 1364235 - Collect telemetry stats on startup cache hits and misses r=kmag
In bug 1264235 we have some indication that observed bugs with the
startup cache might have been resolved, but we don't really know
until we collect data. Collecting these stats will give us the
ability to have more certainty that the startup cache is functioning
correctly in the wild.

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

--HG--
extra : moz-landing-system : lando
2019-03-05 16:52:57 +00:00
Alex Gaynor 0e903787da Bug 1415508 - use Span in constructing a byte input stream; r=mayhemer
Differential Revision: https://phabricator.services.mozilla.com/D20687

--HG--
extra : moz-landing-system : lando
2019-02-25 19:11:20 +00:00
Ehsan Akhgari e5e885ae31 Bug 1521000 - Part 2: Adjust our clang-format rules to include spaces after the hash for nested preprocessor directives r=sylvestre
# ignore-this-changeset

--HG--
extra : amend_source : 7221c8d15a765df71171099468e7c7faa648f37c
extra : histedit_source : a0cce6015636202bff09e35a13f72e03257a7695
2019-01-18 10:16:18 +01: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
Ehsan Akhgari 490e611801 Bug 1508472 - Part 5: Fifth batch of comment fix-ups in preparation for the tree reformat r=sylvestre
This is a best effort attempt at ensuring that the adverse impact of
reformatting the entire tree over the comments would be minimal. I've used a
combination of strategies including disabling of formatting, some manual
formatting and some changes to formatting to work around some clang-format
limitations.

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

--HG--
extra : moz-landing-system : lando
2018-11-29 10:30:46 +00:00