Read-only Git mirror of the Mercurial gecko repositories at https://hg.mozilla.org. How to contribute: https://firefox-source-docs.mozilla.org/contributing/contribution_quickref.html
Перейти к файлу
Ting-Yu Chou dd7965dec0 Bug 1401883 - don't hold unnecessary references to the Windows app shell; r=jimm
When runnables are posted to the main thread's event loop, the event
loop notifies any thread observers that this has been done.  The app
shell registers itself as just such a runnable, and posts messages to
the native event loop that processing native events needs to be done.

On Windows, this posting takes an extra reference to the app shell, to
keep it alive until the message is processed by the native event loop,
since app shell code needs to be invoked during that processing.  The
processing releases this extra reference, so everything stays balanced.

Except that it's possible for messages to be posted to the native event
loop, and then browser shutdown happens.  Those messages are not
processed and the associated references taken are not released.  This
imbalance means that in debug builds, we appear to be leaking the app
shell, and that leaking results in intermittent oranges.

This intermittent orange has manifested itself in a variety of ways over
the years, depending on how big the app shell itself was (since that
changes the number of bytes leaked) and how many leak-checked things the
app shell was holding on to.  This bug is merely the latest
manifestation; the last serious work on analyzing the phenomenon and
fixing it was done in bug 1220517.

The solution proposed in that bug was that we simply stop the extra
reference counting; when the app shell is destroyed normally, we
shouldn't be processing the native event loop any more anyway.  So even
if the native event loop is holding (freed) pointers to the app shell,
we'd never execute the callback and perform a use-after-free.  Reading
through the code suggests that this *ought* to be the case, but the
potential for shooting ourselves in the foot seems awfully high.

In any event, this is not a problem unique to Windows; we have seen this
same sort of thing happen on OS X.  See nsAppShell::ProcessGeckoEvents
in widget/cocoa/nsAppShell.mm.

Here we propose a slightly different solution: we keep track of the
number of native event callbacks we have scheduled, incrementing when we
schedule, and decrementing when we actually run one.  When the app shell
is destroyed, we simply set the number of outstanding events to zero,
and we prohibit the callback from accessing the app shell if there are
no outstanding events.  This solution is analogous to dropping the extra
reference counting, but avoids potential badness if we do wind up
processing native events after the app shell is destroyed.
2018-06-06 11:05:18 -04:00
.cargo Bug 1463416 - Update lockfiles and re-vendor rust dependencies. r=Gankro 2018-05-26 11:09:21 -04:00
.vscode Bug 1423565 - Update tasks.json as per documentation. r=rillian 2017-12-06 14:59:35 +01:00
accessible Bug 1465372 - remove reference to old winxp in manifest file r=jmaher 2018-05-31 04:08:00 +03:00
browser Merge mozilla-central to inbound. a=merge CLOSED TREE 2018-06-06 12:52:15 +03:00
build Bug 1466746 - Debian packages for python-zstandard; r=glandium 2018-06-04 23:10:59 -07:00
caps Bug 1465585: Switch from mozilla::Move to std::move. r=froydnj 2018-06-01 10:45:27 +02:00
chrome Bug 1465585: Switch from mozilla::Move to std::move. r=froydnj 2018-06-01 10:45:27 +02:00
config Bug 1464954 - Call TIERS when invoking the build with individual tier names. r=gps 2018-05-31 21:08:18 -07:00
db Bug 1453193 - Upgrade to SQLite 3.23.1. r=mak 2018-04-11 09:04:00 -04:00
devtools Merge inbound to mozilla-central a=merge 2018-06-06 00:58:30 +03:00
docshell Bug 1465060 - Part 1: Fix warnings for std::move() use r=froydnj 2018-06-01 17:59:07 +02:00
dom Bug 1466083 part 8 - Various minor API changes. r=luke 2018-06-06 12:55:50 +02:00
editor Bug 1465060 - Part 1: Fix warnings for std::move() use r=froydnj 2018-06-01 17:59:07 +02:00
embedding Bug 1431533: Part 5a - Auto-rewrite code to use ChromeUtils import methods. r=florian 2018-01-29 15:20:18 -08:00
extensions Bug 1465060 - Part 1: Fix warnings for std::move() use r=froydnj 2018-06-01 17:59:07 +02:00
gfx Bug 1355656 - Implement test cases for two finger fling gestures. r=botond 2018-05-30 19:43:28 +00:00
gradle/wrapper Bug 1411654 - Part 1: Upgrade to Android-Gradle 3.0+ and build-tools;26.0.2. r=maliu 2017-10-26 11:00:36 -07:00
hal Bug 1465898 - Remove unused code for managing physical audio devices; r=agaynor 2018-06-04 22:28:09 +02:00
image Bug 920630 - Part 5. Remove image/ImageURL.h as unused. r=tnikkel 2018-06-05 20:42:57 -04:00
intl Bug 1444329 - Remove nsIScriptableUnicodeConverter::convertFromByteArray. r=hsivonen 2018-06-04 11:25:54 +01:00
ipc Bug 1461459: Add nightly-only release asserts in GeckoChildProcessHost::PerformAsyncLaunchInternal to investigate failures to asynchronously launch content processes. r=jld 2018-06-05 21:12:20 -04:00
js Bug 1363214 - Remove JS::Realm/JSCompartment inheritance. r=jonco 2018-06-06 14:30:52 +02:00
layout Bug 1392106 - fix w3c-css received tests manifest conflicts. r=me, a=testonly CLOSED TREE 2018-06-06 06:41:27 -04:00
media Bug 1465060 - Part 1: Fix warnings for std::move() use r=froydnj 2018-06-01 17:59:07 +02:00
memory Bug 1465585: Switch from mozilla::Move to std::move. r=froydnj 2018-06-01 10:45:27 +02:00
mfbt Merge inbound to mozilla-central a=merge 2018-06-06 00:58:30 +03:00
mobile Bug 1466640 - [2.1] Add desktop mode test. r=snorp 2018-06-06 15:54:25 +02:00
modules Bug 1465852. Enforce use of Atomic for static prefs gotten off the main thread. r=njn 2018-06-05 17:12:16 -04:00
mozglue Bug 1466168: Remove mozilla::Forward in favor of std::forward. r=froydnj 2018-06-02 09:33:26 +02:00
netwerk Bug 1465465 - Block ports 427, 548 and 6697, r=annevk, r=valentin 2018-06-05 07:49:02 +02:00
nsprpub Bug 1432480, land NSPR_4_19_RTM, no code changes, only version numbers. Require version 4.19 for building. r=me 2018-03-05 17:05:18 +01:00
other-licenses Bug 1465585: Switch from mozilla::Move to std::move. r=froydnj 2018-06-01 10:45:27 +02:00
parser Bug 1392106 - random-if more win7 tests for missing letters. r=RyanVM 2018-06-01 09:29:35 -04:00
python Bug 1417920 - squash pytest warnings about Test* classes; r=ted.mielczarek 2018-06-01 15:39:54 -04:00
security Merge mozilla-central to inbound. a=merge CLOSED TREE 2018-06-06 12:52:15 +03:00
services Bug 1463750 - Move RemoteSettings to services/settings/ r=mgoodwin 2018-05-24 15:32:40 +02:00
servo Bug 1466645: Remove PropertyId::name. r=xidorn 2018-06-06 09:47:16 +02:00
startupcache Bug 1465585: Switch from mozilla::Move to std::move. r=froydnj 2018-06-01 10:45:27 +02:00
storage Bug 1466497 - Enable ESLint rule require-expected-throws-or-rejects for storage/test/unit. r=mak 2018-06-01 14:03:20 +01:00
taskcluster Merge inbound to mozilla-central a=merge 2018-06-06 00:58:30 +03:00
testing Bug 1465430 - removed references to old winxp in manifest files. r=jmaher 2018-06-06 05:43:00 +03:00
third_party Merge inbound to mozilla-central a=merge 2018-06-06 00:58:30 +03:00
toolkit Merge mozilla-central to inbound. a=merge CLOSED TREE 2018-06-06 12:52:15 +03:00
tools Bug 1466083 part 8 - Various minor API changes. r=luke 2018-06-06 12:55:50 +02:00
uriloader Bug 1465585: Switch from mozilla::Move to std::move. r=froydnj 2018-06-01 10:45:27 +02:00
view Backed out 18 changesets (bug 1462784) for failures in devtools/client/performance/test/unit/test_tree-model-08.js on a CLOSED TREE 2018-06-01 01:06:29 +03:00
widget Bug 1401883 - don't hold unnecessary references to the Windows app shell; r=jimm 2018-06-06 11:05:18 -04:00
xpcom Merge inbound to mozilla-central. a=merge 2018-06-06 12:36:55 +03:00
xpfe/appshell Bug 1455676 part 11. Remove use of nsIDOMNode from xpfe/. r=qdot 2018-05-29 22:58:49 -04:00
.arcconfig Bug 1460463 - Update .arcconfig to make history mutable; r=gps 2018-05-09 23:49:52 +00:00
.clang-format Bug 1414764 - Remove Mozilla specific options to avoid build warnings with gcc and -Wcomment enabled. r=sylvestre 2017-11-06 11:47:40 +02:00
.clang-format-ignore Bug 1464452 - Add richtext to the list of thirdparties r=andi 2018-05-25 09:01:11 -07:00
.cron.yml Bug 1466552 Automated file updates for beta/release r=RyanVM 2018-06-04 15:30:57 +00:00
.eslintignore Bug 1461785 - Update eslint ignore file to no longer ignore dom/media/mediasource. r=standard8 2018-05-14 16:49:39 -04:00
.eslintrc.js Bug 1466497 - Enable ESLint rule require-expected-throws-or-rejects for storage/test/unit. r=mak 2018-06-01 14:03:20 +01:00
.flake8 bug 1463425 - Add more directories to the flake8 list r=ahal 2018-05-22 06:26:22 -07:00
.gdbinit Bug 1400460 - Rename nsIAtom as nsAtom. r=hiro. 2017-10-03 09:05:19 +11:00
.gdbinit_python
.gitignore Bug 1439727 - Ignore third_party/python/psutil/tmp/ in VCS; r=nalexander 2018-03-07 08:59:48 -08:00
.hgignore Bug 1454466 - Move raptor in-tree; r=ahal 2018-04-16 17:15:38 -04:00
.hgtags No bug - Tagging mozilla-central 93443d36d4bd53dba004f7b73430879f96daa681 with FIREFOX_NIGHTLY_61_END a=release DONTBUILD CLOSED TREE 2018-05-07 16:27:53 +00:00
.inferconfig
.lldbinit Bug 1400460 - Rename nsIAtom as nsAtom. r=hiro. 2017-10-03 09:05:19 +11:00
.mailmap NO BUG - Use ato's new address. r=me 2018-02-26 15:59:29 +00:00
.taskcluster.yml bug 1432364 - remove comment about docker sha allowlists. r=gps 2018-05-29 12:45:21 -07:00
.yamllint
.ycm_extra_conf.py
AUTHORS Bug 1459852 - Get rid of the AUTHORS list r=mossop 2018-05-08 10:37:41 +02:00
CLOBBER Bug 1459785 - Update clobber file for ANGLE update; see also bug 1421146. r=me 2018-06-05 16:43:34 -06:00
Cargo.lock Bug 1466789: Bump cssparser again. r=me 2018-06-05 17:19:10 +02:00
Cargo.toml Bug 1463416 - Update lockfiles and re-vendor rust dependencies. r=Gankro 2018-05-26 11:09:21 -04:00
GNUmakefile
LEGAL
LICENSE
Makefile.in Bug 1461836 - Write out complete configure dependencies from configure for consumption by make and non-make backends. r=mshal 2018-05-21 14:01:50 -07:00
Pipfile Bug 1463834 - vendored hglib, updated to python-hglib r=davehunt 2018-05-31 18:04:54 -07:00
Pipfile.lock Bug 1463834 - vendored hglib, updated to python-hglib r=davehunt 2018-05-31 18:04:54 -07:00
README.txt Bug 1460030 - Update the nightly URL in the README.txt file r=kohei 2018-05-08 21:22:10 +02:00
aclocal.m4
build.gradle Bug 1457863 - 1. Update kotlin to 1.2.41; r=nalexander 2018-05-02 13:49:57 -04:00
client.mk Bug 1461836 - Write out complete configure dependencies from configure for consumption by make and non-make backends. r=mshal 2018-05-21 14:01:50 -07:00
client.py
configure.in
configure.py Bug 1461836 - Write out complete configure dependencies from configure for consumption by make and non-make backends. r=mshal 2018-05-21 14:01:50 -07:00
gradle.properties Bug 1453413 - Use aapt2 to build Firefox for Android. r=mcomella 2018-04-11 09:59:22 -07:00
gradlew
mach
moz.build Bug 1346026 - Vendor pipenv 2018.5.18 and transient dependencies; r=ahal 2018-05-17 19:06:20 +01:00
moz.configure Bug 1462493 - Add a check to warn about sccache usage with tup; r=chmanchester 2018-05-24 15:10:17 -04:00
mozilla-config.h.in Bug 1463637: Remove mozilla-config.h hacks for Hunspell extra includes. r=ted 2018-05-22 20:36:39 -07:00
old-configure.in Backed out changeset cbf0895981cd (bug 1270217) for turning bug 1405083 into permafail. a=backout 2018-06-03 13:08:10 +03:00
package-lock.json Bug 1429260 - Add tests to verify handling of payment detail properties it is possible to updateWith. r=jaws 2018-05-24 17:34:42 -07:00
package.json Bug 1464100 - Update eslint-plugin-no-unsanitized to v3.0.2. r=ahal 2018-05-24 16:54:54 +01:00
settings.gradle Bug 1444546 - Part 2: Build annotationProcessors with Gradle. r=jchen 2018-02-22 16:11:14 -08:00
test.mozbuild

README.txt

An explanation of the Mozilla Source Code Directory Structure and links to
project pages with documentation can be found at:

    https://developer.mozilla.org/en/Mozilla_Source_Code_Directory_Structure

For information on how to build Mozilla from the source code, see:

    https://developer.mozilla.org/en/docs/Build_Documentation

To have your bug fix / feature added to Mozilla, you should create a patch and
submit it to Bugzilla (https://bugzilla.mozilla.org). Instructions are at:

    https://developer.mozilla.org/en/docs/Creating_a_patch
    https://developer.mozilla.org/en/docs/Getting_your_patch_in_the_tree

If you have a question about developing Mozilla, and can't find the solution
on https://developer.mozilla.org, you can try asking your question in a
mozilla.* Usenet group, or on IRC at irc.mozilla.org. [The Mozilla news groups
are accessible on Google Groups, or news.mozilla.org with a NNTP reader.]

You can download nightly development builds from the Mozilla FTP server.
Keep in mind that nightly builds, which are used by Mozilla developers for
testing, may be buggy. Firefox nightlies, for example, can be found at:

    https://archive.mozilla.org/pub/firefox/nightly/latest-mozilla-central/
            - or -
    https://www.mozilla.org/firefox/channel/desktop/#nightly