Commit Graph

394 Commits

Author SHA1 Message Date
Denis Palmeiro
c626a5ea13 Bug 1637886 - Check for valid JSScript* before getting private value r=smaug
Missing check to see if the JSScript coming from exec.GetScript() is valid.

Differential Revision: https://phabricator.services.mozilla.com/D75320
2020-05-14 17:22:52 +00:00
Philip Chimento
f93330de3e Bug 1629293 - Expose js::ErrorReport in public API. r=evilpie
Renames it to JS::ErrorReportBuilder, since it is used to 'build' a
JSErrorReport object.

Differential Revision: https://phabricator.services.mozilla.com/D73521
2020-05-14 04:44:15 +00:00
Tom Schuster
d76da80aa0 Bug 1636624 - Mitigate leaks involving exceptions with CreateSciptError. r=mccr8
Doing this kind of censoring in "CreateScriptError" turns out to be more effort
than I thought. We don't have a JSContext to create Rooted instances.
This still catches all the relevant places where we are creating script-errors without inner-window-ids.

Differential Revision: https://phabricator.services.mozilla.com/D75152
2020-05-13 17:53:57 +00:00
Narcis Beleuzu
a12e8bbd08 Backed out 5 changesets (bug 1505129, bug 1506323, bug 1629293) for bustages on testPrintError.cpp . CLOSED TREE
Backed out changeset ad1ccad76686 (bug 1629293)
Backed out changeset 452e9ab721bd (bug 1629293)
Backed out changeset 72a63e290177 (bug 1629293)
Backed out changeset faeed99f813e (bug 1505129)
Backed out changeset 7bd84a644d2b (bug 1506323)
2020-05-13 21:23:59 +03:00
Philip Chimento
5606c63575 Bug 1629293 - Expose js::ErrorReport in public API. r=evilpie
Renames it to JS::ErrorReportBuilder, since it is used to 'build' a
JSErrorReport object.

Differential Revision: https://phabricator.services.mozilla.com/D73521
2020-05-13 16:10:39 +00:00
Denis Palmeiro
d1ffff7a12 Bug 1501608 - Remove the ELEMENT_SLOT in the ScriptSourceObject and instead use a callback function to return the script element based on the value of the privateValue in the SSO. r=jonco,smaug
We can reduce the size of the SSO by removing the element slot entirely, and instead retrieve the element through a callback function.  The callback will take in the value in the private slot of the SSO, which is either a LoadedScript* (from the browser) or a JSObject* (from the shell).  In addition, this removes the requirement of having a script dom element ready when parsing a JS script which can open up new opportunities for performance.

Differential Revision: https://phabricator.services.mozilla.com/D70417
2020-05-12 19:28:15 +00:00
Honza Bambas
2bfd05461a Bug 1623953 - Do an SRI check in ScriptLoader before reusing a speculative load initiated by <link preload>, r=dpalmeiro,hsivonen
Differential Revision: https://phabricator.services.mozilla.com/D74483
2020-05-12 12:16:38 +00:00
Honza Bambas
3af63237fe Bug 1618292 - Make ScriptLoadRequest derive and use PreloaderBase to support new preload as speculative load feature, r=smaug
Depends on D67483

Differential Revision: https://phabricator.services.mozilla.com/D67481
2020-05-11 14:07:24 +00:00
Tom Schuster
4f64f475f2 Bug 1595046 - Make it possible to inspect every exception value in the web console. r=jonco,baku,mccr8
Differential Revision: https://phabricator.services.mozilla.com/D64437
2020-05-08 20:54:17 +00:00
Dorel Luca
159241fe4b Backed out changeset 4107b758e7ae (bug 1501608) as requested by dev 2020-05-02 15:03:19 +03:00
Denis Palmeiro
792169d380 Bug 1501608 - Remove the ELEMENT_SLOT in the ScriptSourceObject and instead use a callback function to return the script element based on the value of the privateValue in the SSO. r=jonco,smaug
We can reduce the size of the SSO by removing the element slot entirely, and instead retrieve the element through a callback function.  The callback will take in the value in the private slot of the SSO, which is either a LoadedScript* (from the browser) or a JSObject* (from the shell).  In addition, this removes the requirement of having a script dom element ready when parsing a JS script which can open up new opportunities for performance.

Differential Revision: https://phabricator.services.mozilla.com/D70417
2020-04-30 16:21:23 +00:00
Simon Giesecke
191a830575 Bug 1628715 - Part 7: Add MOZ_NONNULL_RETURN to infallible nsTArray::AppendElements. r=xpcom-reviewers,necko-reviewers,nika,valentin
Differential Revision: https://phabricator.services.mozilla.com/D70831
2020-04-24 13:31:14 +00:00
Karl Tomlinson
2aa7834c10 Bug 1628842 give up on reporting off-main-thread exceptions when global creation fails r=baku
and there is no fallback global available.

I assume there is little value in attempting to create another global if a
previous attempt failed.

Differential Revision: https://phabricator.services.mozilla.com/D71152
2020-04-17 04:10:43 +00:00
Tom Schuster
763682c095 Bug 1626100 - Replace SetPendingExceptionAndStack with a ExceptionStack version. r=sfink
Differential Revision: https://phabricator.services.mozilla.com/D69667

--HG--
extra : moz-landing-system : lando
2020-04-09 12:35:59 +00:00
Tom Schuster
b94a359d66 Bug 1626100 - Use ExceptionStack for AutoJSAPI::StealExceptionAndStack. r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D69666

--HG--
extra : moz-landing-system : lando
2020-04-09 12:35:42 +00:00
Tom Schuster
fae4303276 Bug 1626100 - Introduce an ExceptionStack class and StealPendingExceptionStack. r=sfink,mccr8
See also the bug for a more detailed description.

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

--HG--
extra : moz-landing-system : lando
2020-04-09 12:35:29 +00:00
Andreas Farre
63e21eec70 Bug 1620594 - Part 1: Rework NS_ReleaseOnMainThreadSystemGroup. r=nika
To be able to remove SystemGroup, NS_ReleaseOnMainThreadSystemGroup
needs to have its dependency on SystemGroup removed. Since all
releases using SystemGroup would've released on the main thread anyway
we can safely replace NS_ReleaseOnMainThreadSystemGroup with
NS_ReleaseOnMainThread.

Depends on D64390

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

--HG--
extra : moz-landing-system : lando
2020-04-07 15:16:23 +00:00
Honza Bambas
ccf539e928 Bug 1627275 - Let ScriptLoader::OnStreamComplete return an error when verification or processing of the script fails, r=baku
Differential Revision: https://phabricator.services.mozilla.com/D69606

--HG--
extra : moz-landing-system : lando
2020-04-06 11:55:25 +00:00
Eric Rahm
c0a7544ce1 Bug 1626440 - Remove nsAutoPtr usage from dom/script. r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D69111

--HG--
extra : moz-landing-system : lando
2020-04-03 21:05:05 +00:00
Tom Schuster
02c9b657c3 Bug 1623226 - Pass exception stack from AutoJSAPI::ReportException. r=baku
Differential Revision: https://phabricator.services.mozilla.com/D67791

--HG--
extra : moz-landing-system : lando
2020-03-31 01:19:31 +00:00
Dorel Luca
420e7901c9 Backed out 3 changesets (bug 1623226) for Devtools failures in browser/browser_webconsole_stubs_page_error.js. CLOSED TREE
Backed out changeset 312da02ea6d6 (bug 1623226)
Backed out changeset 798079ba88f7 (bug 1623226)
Backed out changeset 83f0b1c5399c (bug 1623226)
2020-03-31 04:16:44 +03:00
Tom Schuster
759822ddcd Bug 1623226 - Pass exception stack from AutoJSAPI::ReportException. r=baku
Differential Revision: https://phabricator.services.mozilla.com/D67791

--HG--
extra : moz-landing-system : lando
2020-03-30 22:45:14 +00:00
Jon Coppeard
c1e3671c97 Bug 1624810 - Set the multi-zone JS holder flag on appropriate cycle collected classes r=mccr8
Set the flag on the affected classes, which are:
 - CallbackTimeoutHandler
 - nsJSArgArray
 - CallbackObject
 - Console
 - MessageEvent
 - IDBIndexCursor
 - ExtendableMessageEvent
 - JSPurpleBuffer

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

--HG--
extra : moz-landing-system : lando
2020-03-26 10:49:06 +00:00
Bas Schouten
1bc21ff19c Bug 1563335 - Part 1: Implement mechanism to throttle JS execution. r=smaug,asuth
Differential Revision: https://phabricator.services.mozilla.com/D59321

--HG--
extra : moz-landing-system : lando
2020-03-26 00:36:24 +00:00
Tom Schuster
d99e2a3133 Bug 1622562 - Remove JSREPORT_IS_WARNING everywhere. r=baku
Differential Revision: https://phabricator.services.mozilla.com/D67029

--HG--
extra : moz-landing-system : lando
2020-03-21 20:14:13 +00:00
Mihai Alexandru Michis
13d1400778 Backed out 4 changesets (bug 1622562) for causing wpt failures.
CLOSED TREE

Backed out changeset 1ab69d63949b (bug 1622562)
Backed out changeset a5c299f23df7 (bug 1622562)
Backed out changeset 233b80b283fb (bug 1622562)
Backed out changeset e76f213e7f04 (bug 1622562)

--HG--
extra : rebase_source : 3765e25897f0d8f95a7304e11713bf5aed8f5b83
2020-03-20 20:56:58 +02:00
Tom Schuster
7328dae6e3 Bug 1622562 - Remove JSREPORT_IS_WARNING everywhere. r=baku
Differential Revision: https://phabricator.services.mozilla.com/D67029

--HG--
extra : moz-landing-system : lando
2020-03-20 17:24:28 +00:00
Emilio Cobos Álvarez
c07f3b6b0b Bug 1622235 - Make defer scripts wait for stylesheets. r=hsivonen
Rename ScriptLoader::mDocumentParsingDone to
ScriptLoader::mDeferCheckpointReached, and make it also get unblocked by
stylesheet loading.

Remove a useless null-check for mDocument as we unconditionally dereference it
below when checking mDocument->HaveFiredDOMTitleChange()

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

--HG--
extra : moz-landing-system : lando
2020-03-20 13:33:11 +00:00
Simon Giesecke
80de7dcd75 Bug 1613985 - Use default for equivalent-to-default constructors/destructors in dom/script. r=smaug
Depends on D66027

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

--HG--
extra : moz-landing-system : lando
2020-03-09 15:04:35 +00:00
Boris Zbarsky
2f1001ccab Bug 1496159 test.
Differential Revision: https://phabricator.services.mozilla.com/D65845

--HG--
extra : moz-landing-system : lando
2020-03-07 04:16:15 +00:00
Christoph Kerschbaumer
de17388af5 Bug 1374612 - CSP: Hide nonce values from the DOM. r=smaug,annevk
Differential Revision: https://phabricator.services.mozilla.com/D62811

--HG--
extra : moz-landing-system : lando
2020-02-29 12:35:46 +00:00
shindli
f5511fecc8 Backed out changeset ec4c2b2a561b (bug 1374612) for causing wpt permafails in /html/dom/reflection-metadata.html CLOSED TREE 2020-02-27 22:46:44 +02:00
Christoph Kerschbaumer
00976af48c Bug 1374612 - CSP: Hide nonce values from the DOM. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D62811

--HG--
extra : moz-landing-system : lando
2020-02-27 18:08:54 +00:00
Dorel Luca
2e1e470d9e Backed out changeset 59fe98b41d80 (bug 1374612) for WPT failures in /html/dom/idlharness.https.html. CLOSED TREE
--HG--
extra : amend_source : a537237327643c365f02c0bfbed643b0d54cf1d5
2020-02-27 14:08:48 +02:00
Christoph Kerschbaumer
ec996a7e9d Bug 1374612 - CSP: Hide nonce values from the DOM. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D62811

--HG--
extra : moz-landing-system : lando
2020-02-27 09:32:04 +00:00
Simon Giesecke
aaf6cb4e75 Bug 1617628 - Hide nsBaseHashtable Put overloads in nsRefPtrHashtable subclass. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D63899

--HG--
extra : moz-landing-system : lando
2020-02-25 17:03:36 +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
Nicolas B. Pierron
f862fc3ecb Bug 1607769 - Remove script loader telemetry added by Bug 1579876 and Bug 1573904. r=jorendorff
Differential Revision: https://phabricator.services.mozilla.com/D60288

--HG--
extra : moz-landing-system : lando
2020-02-03 18:55:44 +00:00
Nazım Can Altınova
551cb5c008 Bug 1609660 - Rename "Script" marker to "ScriptEvaluation". r=gerald
Depends on D60231

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

--HG--
extra : moz-landing-system : lando
2020-01-17 21:26:57 +00:00
Jon Coppeard
d7492d145d Bug 1291535 - Clear the list of dynamic import requests after cancelling them in ScriptLoader::ParsingComplete as we do for other requests r=bzbarsky
Differential Revision: https://phabricator.services.mozilla.com/D59698

--HG--
extra : moz-landing-system : lando
2020-01-14 11:47:21 +00:00
Jonathan Kingston
27ca040dfd Bug 1606774 - Change GetAttribute to GetAttr where possible r=baku
Differential Revision: https://phabricator.services.mozilla.com/D58585

--HG--
extra : moz-landing-system : lando
2020-01-03 23:40:53 +00:00
Ashutosh Tiwari
b1fed54115 Bug 1603690 - Remove a redundant return statement and removed empty lines. r=Ehsan
Differential Revision: https://phabricator.services.mozilla.com/D57086

--HG--
extra : moz-landing-system : lando
2019-12-13 17:49:07 +00:00
Jeff Walden
62a130ba0a Bug 1602882 - Move array operations to a new js/Array.h header. r=sfink,bzbarsky
Differential Revision: https://phabricator.services.mozilla.com/D56595

--HG--
extra : moz-landing-system : lando
2019-12-11 06:17:44 +00:00
Gabriele Svelto
ace6d1063f Bug 1600545 - Remove useless inclusions of header files generated from IDL files in dom/ 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/D55442

--HG--
extra : moz-landing-system : lando
2019-12-06 09:24:56 +00:00
Boris Zbarsky
75124bdd98 Bug 1517588. Use nsIPrincipal::IsSystemPrincipal instead of nsContentUtils::IsSystemPrincipal r=bzbarsky
Differential Revision: https://phabricator.services.mozilla.com/D53067

--HG--
extra : moz-landing-system : lando
2019-12-05 04:44:32 +00:00
Dorel Luca
a381d5c96d Backed out changeset f6e53d1c6518 (bug 1600545) for Android build bustage. CLOSED TREE 2019-12-04 17:32:27 +02:00
Gabriele Svelto
bc9290f767 Bug 1600545 - Remove useless inclusions of header files generated from IDL files in dom/ 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/D55442

--HG--
extra : moz-landing-system : lando
2019-12-04 15:01:19 +00:00
Honza Bambas
ce072f8e6a Bug 1594449 - <link rel="preload"> implemented as a speculative load initiated during the prescan phase in the HTML5 parser, disabled by default, only supports "script" and "styles" types, r=ckerschb
Differential Revision: https://phabricator.services.mozilla.com/D52019

--HG--
extra : moz-landing-system : lando
2019-11-27 21:45:12 +00:00