Commit Graph

61 Commits

Author SHA1 Message Date
Nika Layzell
5f45e08c22 Bug 1650163 - Part 1: Switch native remoteType values to nsCString, r=farre,geckoview-reviewers,agi
Differential Revision: https://phabricator.services.mozilla.com/D82104
2020-07-08 20:15:59 +00:00
Mihai Alexandru Michis
e53e708b23 Backed out 3 changesets (bug 1650163) for causing bustages in nsContentSecurityManager.cpp
CLOSED TREE

Backed out changeset 51d7c644a1e6 (bug 1650163)
Backed out changeset 3d2b6908447a (bug 1650163)
Backed out changeset 79141707d47b (bug 1650163)
2020-07-08 21:18:44 +03:00
Nika Layzell
d627e924a9 Bug 1650163 - Part 1: Switch native remoteType values to nsCString, r=farre,geckoview-reviewers,agi
Differential Revision: https://phabricator.services.mozilla.com/D82104
2020-07-08 14:54:48 +00:00
Narcis Beleuzu
ff8a3cf3a3 Backed out 7 changesets (bug 1650163, bug 1649477) for bustages on JSActor.cpp . CLOSED TREE
Backed out changeset 4a21afb65254 (bug 1650163)
Backed out changeset c41753a56f5a (bug 1650163)
Backed out changeset 5fb444c35764 (bug 1650163)
Backed out changeset 830aa93d2b0c (bug 1649477)
Backed out changeset eca6e9dce450 (bug 1649477)
Backed out changeset 5b217aa88289 (bug 1649477)
Backed out changeset 8959d02b840f (bug 1649477)
2020-07-08 04:09:27 +03:00
Nika Layzell
1332ec8539 Bug 1650163 - Part 1: Switch native remoteType values to nsCString, r=farre
Differential Revision: https://phabricator.services.mozilla.com/D82104
2020-07-06 20:30:58 +00:00
Simon Giesecke
a69d79b6db 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
Tomislav Jovanovic
b44d6f025b Bug 1587541 - Enable content scripts for OOP iframes in browser tabs r=robwu
Differential Revision: https://phabricator.services.mozilla.com/D77941
2020-06-12 22:47:34 +00:00
Luca Greco
1034056904 Bug 1593240 - Prevent re-entrancy issues in ExtensionPolicyService::CheckContentScripts related to EPS.loadContentScript calls r=robwu,mixedpuppy
ExtensionPolicyService::CheckContentScripts does retrieve mContentScripts a WebExtensionPolicy instance
and it may call the ExtensionProcessScript methods PreloadContentScript or LoadContentScript while iterating
over it mContentScript.

Both PreloadContentScript and LoadContentScript are going to run some privileged JS code, and LoadContentScript
will load an extension content script. There is a chance that some of the JS code executed could call
WebExtensionPolicy::UnregisterContentScript (or RegisterContentScript) and mutate the mContentScripts array
that EPS::CheckContentScripts is already iterating over, and when that happens it is possible that once the
execution goes back to the ongoing CheckContentScripts iteration, the iterator is invalidated and
the InvalidArrayIndex_CRASH triggered.

Differential Revision: https://phabricator.services.mozilla.com/D69336
2020-04-06 18:59:16 +00:00
Simon Giesecke
9e7322117c Bug 1617628 - Hide nsBaseHashtable Put overloads in nsRefPtrHashtable subclass. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D63899
2020-02-25 17:03:36 +00:00
Rob Wu
186881dd14 Bug 1502525 - Read extensions.webextensions.remote once r=mixedpuppy
Differential Revision: https://phabricator.services.mozilla.com/D60976
2020-02-03 17:27:46 +00:00
Boris Zbarsky
2df1df0176 Bug 1517588. Use nsIPrincipal::IsSystemPrincipal instead of nsContentUtils::IsSystemPrincipal r=bzbarsky
Differential Revision: https://phabricator.services.mozilla.com/D53067
2019-12-05 04:44:32 +00:00
Nihanth Subramanya
3ca6a51ff7 Bug 1600390 - Cache the values of the CSP prefs in the ExtensionPolicyService. r=mixedpuppy
Differential Revision: https://phabricator.services.mozilla.com/D55374
2019-12-03 23:24:42 +00:00
Ehsan Akhgari
c5ab356460 Bug 1592599 - Switch nsIDocShell.getDocShellEnumerator() away from using nsISimpleEnumerator; r=bzbarsky
Differential Revision: https://phabricator.services.mozilla.com/D51100
2019-11-18 20:11:58 +00:00
Shane Caraveo
966ff6e2d8 Bug 1581611 Part 1: add content_scripts to the extension content_security_policy r=rpl,bzbarsky
This patch adds support for including content_scripts CSP in the extensions
manifest, along with all interfaces necessary to access the CSP value.  This does not
implement actual use of the CSP for content scripts.

Differential Revision: https://phabricator.services.mozilla.com/D46824
2019-11-01 06:02:45 +00:00
Shane Caraveo
502af3d339 Bug 1581609 rename extension contentSecurityPolicy to support multiple V3 CSP values r=rpl,webidl
Differential Revision: https://phabricator.services.mozilla.com/D46818
2019-11-01 06:02:22 +00:00
Boris Zbarsky
fef9d123c5 Bug 1582892. Expose the number of strings in a Web IDL enum in a nice way. r=edgar
Differential Revision: https://phabricator.services.mozilla.com/D49536
2019-10-23 03:54:39 +00:00
Daniel Varga
1ba9dcd6bb Backed out changeset f9a4c8d67be3 (bug 1582892) for build bustage at build/src/dom/console/ConsoleInstance. On a CLOSED TREE 2019-10-23 06:13:54 +03:00
Boris Zbarsky
06478c0c0d Bug 1582892. Expose the number of strings in a Web IDL enum in a nice way. r=edgar
Differential Revision: https://phabricator.services.mozilla.com/D49536
2019-10-18 03:26:43 +00:00
Matt Woodrow
1a24638957 Bug 1583700 - Listen for DocumentChannel's on-opening-request as well as HTTP's in ExtensionPolicyService. r=jya
Differential Revision: https://phabricator.services.mozilla.com/D50118
2019-10-22 19:52:16 +00:00
Kannan Vijayan
c690c1925f Bug 1559414 - Rename unaudited pre-fission methods with SameProcess for future audit burndown. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D39378
2019-07-26 16:48:31 +00:00
Rob Wu
cd1d601702 Bug 1551490 - Fix test failures with inline options in HTML about:addons r=kmag
Differential Revision: https://phabricator.services.mozilla.com/D34078
2019-06-09 11:18:54 +00:00
Ryan Hunt
743a2a46fe Bug 1523969 part 23 - Move method definition inline comments to new line in 'toolkit/'. r=ehsan
Differential Revision: https://phabricator.services.mozilla.com/D21124
2019-02-25 16:12:51 -06:00
Boris Zbarsky
465d5e2181 Bug 1528146. Fix how web extensions are injected into about:blank. r=kmag
The basic idea is to make non-initial about:blank fire
document-element-inserted notifications just like every other document.  We
then ensure that there's a notification (initial-document-element-inserted)
that only gets fired once per window for documents that are in a window.  This
notification is what webextensions use to inject into the document.

The old setup which injected into about:blank when its global is created gets
removed in favor of injecting the same way as into every other document.

The changes to Document.cpp are fixing a bug in the "block the parser" stuff
webextensions do.  For about:blank, the blocking happens at a point when the
parser really has nothing else to parse (since it's parsing the empty string).
So the blocking is a no-op.  But we do want to prevent DOMContentLoaded firing,
because otherwise the "end of document" scripts could run before we finish
doing the "beginning of document" work in webextensions.  So we want to make
sure we block DOMContentLoaded, not just the load event.

Differential Revision: https://phabricator.services.mozilla.com/D19892
2019-02-22 21:27:44 +00:00
Coroiu Cristina
6afadf9439 Backed out changeset 367ca1e16853 (bug 1528146) on request by igoldan, assignee didn't replied back on time a=backout 2019-02-22 10:10:33 +02:00
Christoph Kerschbaumer
1a72eb2a6b Bug 1528677: Remove nullchecks for loadinfo since we have loadinfo on all channels. r=baku 2019-02-20 13:27:25 +01:00
Boris Zbarsky
adffade759 Bug 1528146. Fix how web extensions are injected into about:blank. r=kmag
The basic idea is to make non-initial about:blank fire
document-element-inserted notifications just like every other document.  We
then ensure that there's a notification (initial-document-element-inserted)
that only gets fired once per window for documents that are in a window.  This
notification is what webextensions use to inject into the document.

The old setup which injected into about:blank when its global is created gets
removed in favor of injecting the same way as into every other document.

The changes to Document.cpp are fixing a bug in the "block the parser" stuff
webextensions do.  For about:blank, the blocking happens at a point when the
parser really has nothing else to parse (since it's parsing the empty string).
So the blocking is a no-op.  But we do want to prevent DOMContentLoaded firing,
because otherwise the "end of document" scripts could run before we finish
doing the "beginning of document" work in webextensions.  So we want to make
sure we block DOMContentLoaded, not just the load event.

Differential Revision: https://phabricator.services.mozilla.com/D19892
2019-02-15 23:29:34 +00:00
Emilio Cobos Álvarez
dc336a73ba Bug 1517241 - Rename nsIDocument to mozilla::dom::Document. r=smaug
Summary: Really sorry for the size of the patch. It's mostly automatic
s/nsIDocument/Document/ but I had to fix up in a bunch of places manually to
add the right namespacing and such.

Overall it's not a very interesting patch I think.

nsDocument.cpp turns into Document.cpp, nsIDocument.h into Document.h and
nsIDocumentInlines.h into DocumentInlines.h.

I also changed a bunch of nsCOMPtr usage to RefPtr, but not all of it.

While fixing up some of the bits I also removed some unneeded OwnerDoc() null
checks and such, but I didn't do anything riskier than that.
2019-01-03 17:48:33 +01:00
Peter Van der Beken
955ad9221e Bug 1353867 - Change WindowProxyHolder's native type to BrowsingContext. r=bzbarsky
Make the WindowProxyHolder hold a strong reference to a BrowsingContext, as in the future
we might not have a nsPIDOMWindowOuter (if the document is loaded in a different process).

Differential Revision: https://phabricator.services.mozilla.com/D12651
2019-01-02 13:27:05 +00:00
Kris Maglione
93e84eda48 Bug 1513366: Part 5 - Migrate extension process script to a JSM. r=aswan
This simplifies things all around, and gets rid of one more unnecessary
component registration.
2018-12-12 17:58:19 -08:00
Sylvestre Ledru
e5a134f73a Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
# ignore-this-changeset
2018-11-30 11:46:48 +01:00
Ehsan Akhgari
b614d2046a 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
2018-11-29 10:30:46 +00:00
Gabriele Svelto
665dc4ae79 Bug 1493955 - Store floating-point preferences in a locale-independent way r=njn
Differential Revision: https://phabricator.services.mozilla.com/D6796
2018-09-28 20:54:09 +00:00
Bogdan Tara
6941b61899 Backed out changeset ba1fef7b14eb (bug 1493955) for GTest failures CLOSED TREE 2018-09-28 02:42:20 +03:00
Gabriele Svelto
32494f34c7 Bug 1493955 - Store floating-point preferences in a locale-independent way r=njn
Differential Revision: https://phabricator.services.mozilla.com/D6796
2018-09-27 20:41:39 +00:00
Kris Maglione
26780b8d97 Bug 1484373: Follow-up: Fix missed review comment. r=froydnj (implied) 2018-08-24 22:31:10 -07:00
Kris Maglione
2fa464dbde Bug 1486199: Ignore null promises when injecting content scripts. r=mixedpuppy
Differential Revision: https://phabricator.services.mozilla.com/D4287
2018-08-25 14:02:26 -07:00
Kris Maglione
7d1cda5bbb Bug 1486057: Skip uninitialized windows when injecting content scripts. r=mixedpuppy
Differential Revision: https://phabricator.services.mozilla.com/D4286
2018-08-25 14:00:03 -07:00
Kris Maglione
7b03bdbb6b Bug 1484373: Follow-up: Fix null deref. r=bustage CLOSED TREE 2018-08-23 16:05:55 -07:00
Kris Maglione
fa6cdfaf68 Bug 1484373: Follow-up: Fix null deref. r=bustage CLOSED TREE 2018-08-23 16:01:25 -07:00
Kris Maglione
8e4c378705 Bug 1484373: Part 9 - Move more extension page matching logic into policy service. r=mixedpuppy
Differential Revision: https://phabricator.services.mozilla.com/D3699
2018-08-17 22:30:17 -07:00
Kris Maglione
ac78f9effb Bug 1484373: Part 4 - Move more content script injection logic into policy service. r=mixedpuppy
Differential Revision: https://phabricator.services.mozilla.com/D3694
2018-08-17 22:09:23 -07:00
Kris Maglione
cb137ca0ad Bug 1472491: Follow-up: Add missing CC trace for document observer hashtable. r=me 2018-08-14 12:05:11 -07:00
Kris Maglione
30e794ede9 Bug 1472491: Part 2b - Add MozDocumentObserver class to notify on new pattern-matched documents. r=zombie
MozReview-Commit-ID: 29CsJ2mya36
2018-07-31 21:50:34 -07:00
Valentin Gosu
7621447682 Bug 1476928 - Remove nsIURI.CloneIgnoringRef and nsIURI.CloneWithNewRef r=JuniorHsu
The patch introduces NS_GetURIWithNewRef and NS_GetURIWithNewRef which perform the same function.

Differential Revision: https://phabricator.services.mozilla.com/D2239
2018-07-23 11:28:47 +00:00
Adrian Wielgosik
93eb294385 Bug 1460940 - Clean up most remaining C++-side uses of nsIDOMDocument. r=bz
MozReview-Commit-ID: LKRnyDPNlle
2018-05-11 19:46:15 +02:00
Adrian Wielgosik
53b104eab3 Bug 1460940 - Remove nsIDOMDocument uses in toolkit/. r=bz
MozReview-Commit-ID: LJhw1bKsUkn
2018-05-11 19:46:15 +02:00
Kris Maglione
a516420d8c Bug 1430317: Follow-up: Support QI to nsIMemoryReporter. r=me
MozReview-Commit-ID: 6BvZyVh2dP9
2018-01-12 18:52:36 -08:00
Kris Maglione
10085fad20 Bug 1430317: Add memory reporter to show basic information about active WebExtensions. r=erahm
MozReview-Commit-ID: FR8F30bhhA4
2018-01-12 16:01:18 -08:00
Shane Caraveo
5592e73c3a Bug 1393150 prevent remote extensions when e10s is off, r=bz,kmag
MozReview-Commit-ID: HjLLa9vx2UW
2017-09-14 15:12:45 -07:00
Kris Maglione
23f86a0885 Bug 1396449: Part 1 - Use WebExtensionPolicy objects in extension content principals. r=krizsa
Going through the extension policy service rather than using
WebExtensionPolicy objects directly adds a lot of unnecessary overhead to
common operations on extension principals, and also makes the code more
complicated than it needs to be.

We also use weak references to policy objects here, since principals should
ideally lose as much of their elevated privileges as possible once the
extension instance that created them has been destroyed (which is something we
couldn't handle easily when we simply tracked ID strings).

MozReview-Commit-ID: KDNvVdvLkIt
2017-09-05 11:04:43 -07:00