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

5 Коммитов

Автор SHA1 Сообщение Дата
Mike Hommey 7523430127 Bug 1330533 - Use FuzzerDriver directly instead of wrapping it in a libfuzzer_main function. r=decoder
Going further from the previous changes, all libfuzzer_main really does
is call the init function, and then proceed to call the fuzzer driver
with the testing function.

So instead of calling that function for it to do all that, the
LibFuzzerRunner can just call the init function itself, and then
call the fuzzer driver with the testing function.

--HG--
extra : rebase_source : 2eb1a2ae763ef21827471cd32addceacefc1ac5d
2017-01-12 14:44:18 +09:00
Mike Hommey cc6c5d8f71 Bug 1330533 - Pass LibFuzzerInitFunc and LibFuzzerTestingFunc to libfuzzer_main. r=decoder
The LibFuzzerRunner code lives in libxul. It's unnecessary complications
to have it call back a function in the firefox executable just so that
it calls another function that is in libxul. Passing the init and
testing functions to the libfuzzer_main function allows to just bypass
that roundtrip, simplifying the setup.

--HG--
extra : rebase_source : ba72c029a904e05fe3b0ed5984c1bad946b73c6a
2017-01-12 14:50:14 +09:00
Mike Hommey 92c5bff388 Bug 1330533 - Remove argc/argv arguments to XRE_LibFuzzerSetMain. r=decoder
The function given to XRE_LibFuzzerSetMain is called from somewhere that
does have access to argc/argv already, so we can avoid passing them
to XRE_LibFuzzerSetMain.

This actually might fix subtle issues with argc/argv not really matching
reality when calling the LibFuzzerMain function in the current code:
some arguments are handled before the call, and both argc and argv are
modified from within XRE_main, but the values stored for the
LibFuzzerMain call still are the original ones.

Argv being a pointer, and it not being reallocated, the value stored for
the LibFuzzerMain call points to the changed one, but argc, being an
integer, is not modified accordingly.

In fact, it's actually worse, because while the Gecko code doesn't
reallocate argv, gtk_main might. So if some GTK flag is passed on the
command line, there's also a possibility that the LibFuzzerMain function
will do a use-after-free.

So all in all, it's just better to use the set of modified argc/argv
from XRE_main instead of storing them from main().

--HG--
extra : rebase_source : 92b89909eab0fc2f67ce372b959bb0e3ed12cd2b
2017-01-12 11:59:37 +09:00
Mike Hommey 2330dcf840 Bug 1306327 - Move reading application.ini to XRE_main. r=bsmedberg
Reading application.ini involves using nsCOMPtr<nsIFile>, and that can
only happen through the XPCOM glue, which we eventually want to get rid
of.

So, while keeping the command line argument/environment variable
handling in nsBrowserApp, we move the actually parsing of the file to
XRE_main, where things can be handled without the XPCOM glue.

--HG--
extra : rebase_source : 487960a671476d4edae4f568c37efa6563ef4dff
2017-01-10 16:43:23 +09:00
Mike Hommey 5f3d2e8810 Bug 1306327 - Add a new XRE Bootstrap API that wraps all the XRE methods. r=bsmedberg
This is the first step towards changing how nsBrowserApp and other current
XPCOM glue users start up Gecko.

The goal here is to expose the same API via a single object with a
VTable instead of the current XPCOM glue machinery. Instead of creating
an entirely new API and changing everything to use it, we go forward
with smaller steps for a more comprehensible transition.

--HG--
extra : rebase_source : c2cf90ab3bb812b9ea75c70c9766f1a47ea50828
2016-12-15 16:46:18 +09:00