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

2004 Коммитов

Автор SHA1 Сообщение Дата
Tim Huang 15c3ab7c9c Bug 1492607 - Part 1: Making postMessage to be aware of OAs when the targetOrigin is "*." r=arthuredelstein,baku
This patch adds a MOZ_DIAGNOSTIC_ASSERT for assuring the OAs
are matching when the targetOrigin is "*" for the postMessage().
But it ignores the FPD in OA since the FPDs are possible to be
different.

We also add a new pref 'privacy.firstparty.isolate.block_post_message'
for allowing blocking postMessage across different FPDs.

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

--HG--
extra : moz-landing-system : lando
2018-10-25 06:47:08 +00:00
Kyle Machulis ca0550b32b Bug 1492648 - Move from nsDocShellLoadInfo to nsDocShellLoadState r=bzbarsky,nika
Creates the nsDocShellLoadState object, which is basically
nsDocShellLoadInfo plus a few extra fields to make it usable as a
single argument to nsDocShell::LoadURI (and eventually
nsDocShell::InternalLoad).

Subframe history handling is a huge logic block in
nsDocShell::LoadURI, which is only used on history loads. This patch
also extracts the logic out into its own function to make the body of
LoadURI clearer.

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

--HG--
rename : docshell/base/nsDocShellLoadInfo.cpp => docshell/base/nsDocShellLoadState.cpp
rename : docshell/base/nsDocShellLoadInfo.h => docshell/base/nsDocShellLoadState.h
extra : moz-landing-system : lando
2018-10-26 03:50:37 +00:00
Collin Wing 795a861aad Bug 1497087 Remove eula support from addons manager r=Gijs,aswan
Differential Revision: https://phabricator.services.mozilla.com/D8149

--HG--
extra : rebase_source : 906a5e7e38ba1293002579e699425c7410601d92
extra : source : 2d0174d68cec998537cb529f688c96cfa729a892
2018-10-19 21:52:20 +00:00
Margareta Eliza Balazs 1a7c7d8823 Merge mozilla-central to autoland. a=merge CLOSED TREE 2018-10-23 12:31:53 +03:00
Andrea Marchesini 4439acd683 Bug 1498510 - Move nsICSPEventListener out of CSP object, r=ckerschb 2018-10-23 08:17:13 +02:00
Julian Descottes 73e3a16c0d Bug 1499096 - Use ok() with 2 arguments instead of 3 when possible;r=Standard8
Depends on D8740.
This changeset replaces calls to ok with 3 arguments to calls with 2 arguments
in situations where the switch does not have a significant impact on the assert.

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

--HG--
extra : moz-landing-system : lando
2018-10-23 07:13:35 +00:00
Mark Banner ceaeb93550 Bug 1486741 - Enable ESLint rule comma-dangle for all of mozilla-central (automatic fixes). r=mossop
Differential Revision: https://phabricator.services.mozilla.com/D8389

--HG--
extra : moz-landing-system : lando
2018-10-19 12:55:39 +00:00
Narcis Beleuzu 5d00f78a13 Backed out changeset 8dd09fad1f35 (bug 1492648) for bc failures on browser_auto_close_window.js
--HG--
rename : docshell/base/nsDocShellLoadState.cpp => docshell/base/nsDocShellLoadInfo.cpp
rename : docshell/base/nsDocShellLoadState.h => docshell/base/nsDocShellLoadInfo.h
2018-10-19 10:11:33 +03:00
Kyle Machulis 0bb3246aa5 Bug 1492648 - Move from nsDocShellLoadInfo to nsDocShellLoadState r=bzbarsky,nika
Creates the nsDocShellLoadState object, which is basically
nsDocShellLoadInfo plus a few extra fields to make it usable as a
single argument to nsDocShell::LoadURI (and eventually
nsDocShell::InternalLoad).

Subframe history handling is a huge logic block in
nsDocShell::LoadURI, which is only used on history loads. This patch
also extracts the logic out into its own function to make the body of
LoadURI clearer.

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

--HG--
rename : docshell/base/nsDocShellLoadInfo.cpp => docshell/base/nsDocShellLoadState.cpp
rename : docshell/base/nsDocShellLoadInfo.h => docshell/base/nsDocShellLoadState.h
extra : moz-landing-system : lando
2018-10-18 22:14:54 +00:00
Christoph Kerschbaumer bf820bc9d2 Bug 1499355: EnsurePreloadCSP on SystemPrincipal should return error. r=baku 2018-10-17 07:05:55 +02:00
vinoth 7b887cfbbc Bug 1498885 - Assertion added in ContentSecurityPolicyPermitsJSAction() to not allow eval with SystemPrincipal r=ckerschb
Differential Revision: https://phabricator.services.mozilla.com/D8683

--HG--
extra : moz-landing-system : lando
2018-10-15 08:02:04 +00:00
Jan de Mooij cfc1f8fa90 Bug 1491728 - Fix ContentPrincipal::GetSiteOrigin to handle IPv6 addresses correctly. r=bzbarsky
The problem is that we used ThirdPartyUtil.getBaseDomain and for IP addresses that
returns the host, and for IPv6 addresses GetHost strips the '[' and ']' brackets.
Then when we passed that IP address to SetHost, we failed because SetHost wants
the brackets to be present.

This patch changes GetSiteOrigin to call getBaseDomain on the TLD service instead,
so we can handle this case ourselves by not calling SetHost when we have an IP
address. GetBaseDomain still uses ThirdPartyUtil.

I tried to add a test for this (with an iframe + postMessage) but the mochitest
http server doesn't support IPv6.

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

--HG--
extra : moz-landing-system : lando
2018-10-01 12:16:39 +00:00
Kris Maglione b9ad1e41b7 Bug 1473933: Remove xpinstallConfirm dialog. r=aswan
Differential Revision: https://phabricator.services.mozilla.com/D6854

--HG--
extra : rebase_source : 15a43212697a02ef7aa35eccc4b3c09bd195d7ed
2018-09-25 15:33:52 -07:00
Christoph Kerschbaumer 60e3239dee Bug 1490874: Log Principal based Security Errors to the Security pane in the console. r=smaug 2018-09-25 07:25:05 +02:00
shindli 0b6d93ef4d Backed out changeset 510e95767aeb (bug 1490874) for security failures in browser/components/payments/test/mochitest/test_basic_card_form.html CLOSED TREE 2018-09-24 11:43:30 +03:00
Christoph Kerschbaumer 0df81cd9f4 Bug 1490874: Log Principal based Security Errors to the Security pane in the console. r=smaug 2018-09-24 09:34:04 +02:00
Jan de Mooij 4a02cf562c Bug 1491342 - Ignore document.domain in ShouldWaiveXray. r=bholley
We want to get rid of JS_GetCompartmentPrincipals. The origin stored in CompartmentPrivate does not account for document.domain changes because that's a per-realm thing.

Fortunately we should not have waivers in any cases that involve document.domain.

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

--HG--
extra : moz-landing-system : lando
2018-09-21 07:13:15 +00:00
Andrea Marchesini d654a2915d Bug 1422456 - Origin for about: URL should not contain query or ref parts, r=smaug 2018-09-14 20:07:22 +02:00
Jan de Mooij cb90b553cd Bug 1487032 - Store origin/site info in CompartmentPrivate. r=bholley
This will let us answer the following questions (in a performant way):

1) What's the compartment's origin? Necessary to implement compartment-per-origin.
2) What's the origin's site? Necessary for the new Wrap() algorithm.
3) Has any realm in the compartment set document.domain? Necessary for the new Wrap() algorithm.

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

--HG--
extra : moz-landing-system : lando
2018-09-11 09:01:14 +00:00
Jan de Mooij 9a0c648a30 Bug 1489196 - Don't call SetDomain in ContentPrincipal::Read. r=bholley
This fixes two issues:

1) We no longer SetHasExplicitDomain() when the domain is null.
2) We avoid the unnecessary (because new principal) wrapper recomputation.

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

--HG--
extra : moz-landing-system : lando
2018-09-06 16:40:56 +00:00
Nika Layzell 933f7fe4d4 Bug 1485177 - Add |siteOrigin| information to nsIPrincipal r=Ehsan
Differential Revision: https://phabricator.services.mozilla.com/D4140

--HG--
extra : moz-landing-system : lando
2018-09-05 03:22:16 +00:00
Tiberius Oros 2fe7330f2d Backed out changeset 33c7b0ea5caa (bug 1485177) for assertion failure at builds/worker/workspace/build/src/caps/ContentPrincipal.cpp on a CLOSED TREE 2018-09-01 05:06:55 +03:00
Nika Layzell 452350d97c Bug 1485177 - Add |siteOrigin| information to nsIPrincipal, r=Ehsan
Differential Revision: https://phabricator.services.mozilla.com/D4140

--HG--
extra : moz-landing-system : lando
2018-09-01 00:52:00 +00:00
Timothy Guan-tin Chien bfd7aeb85d Bug 1431255 - Part III, Create per-origin sandboxes from XPCJSRuntime and load UA widgets scripts r=bholley,jaws,sfink
This patch creates the basic structure on how the widget scripts can be loaded
and be pointed to the Shadow Root, from the UAWidgetsChild.jsm.

The UAWidgetsClass class asks for a sandbox from Cu.getUAWidgetScope(), which
calls into XPCJSRuntime::GetUAWidgetScope(). It creates and keeps the
sandboxes, in a GCHashMap keyed to the origin, so we could reuse it if needed.

MozReview-Commit-ID: J6W4PDQWMcN

--HG--
extra : rebase_source : a62b0a22195f09cdb508df72c954e20d18c7bf68
2018-06-27 11:34:07 -07:00
Boris Zbarsky 754087a992 Bug 1446940 part 5. Stop getting docshells from windows via getInterface in dom/editor/etc code. r=kmag 2018-08-01 13:07:11 -04:00
Jorg K ba1be252a0 Bug 1478441 - Introduce nsIURIWithSpecialOrigin needed for Thunderbird. r=baku 2018-07-31 11:27:00 +03:00
Boris Zbarsky 75abc43e0d Bug 1476145 part 8. Stop using getInterface(nsIDOMWindowUtils) in various test code. r=kmag 2018-07-24 19:47:43 -04:00
Andrea Marchesini f6768a8ff6 Bug 1228139 - Remove nsIURIWithPrincipal - part 3 - main part, r=bz
nsIURIWithPrincipal is currently used to retrieve the nsIPrincipal from a
BlobURL object.  BlobURLProtocolHandler has a hashtable containing, for each
blobURL, a BlobImpl and its nsIPrincipal. This patch introduces
BlobURLProtocolHandler::GetBlobURLPrincipal() that retrieves the nsIPrincipal
from this hashtable.

This patch fixes also a bug in how the revocation of blobURLs is broadcasted to
other processes. This should be done immediately because each process creates
its own timer to revoke them after 5 seconds.

An important change is related to NS_SecurityCompareURIs() where, if 1 (or
both) of the 2 URIs to compare, is a revoked BlobURL, we will QI its URL to
nsIStandardURL and fail out at that point.
2018-07-24 22:15:57 +02:00
Andrea Marchesini 212fc6788b Bug 1228139 - Remove nsIURIWithPrincipal - part 1 - Use of NullPrincipal when nsIURIWithPrincipal.getPrincipal() returns a nullptr, r=bz 2018-07-24 22:15:17 +02:00
Valentin Gosu 7937c7c4cc 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

--HG--
extra : moz-landing-system : lando
2018-07-23 11:28:47 +00:00
Andrea Marchesini 4e97b69ebf Bug 1476306 - Moving NullPrincipal/ContentPrincipal/SystemPrincipal under mozilla namespace - part 3 - ContentPrincipal, r=ckerschb 2018-07-17 21:38:48 +02:00
Andrea Marchesini 58f78c6f5d Bug 1476306 - Moving NullPrincipal/ContentPrincipal/SystemPrincipal under mozilla namespace - part 2 - SystemPrincipal, r=ckerschb 2018-07-17 21:38:19 +02:00
Andrea Marchesini a053cf1c15 Bug 1476306 - Moving NullPrincipal/ContentPrincipal/SystemPrincipal under mozilla namespace - part 1 - NullPrincipal, r=ckerschb 2018-07-17 21:37:48 +02:00
Kris Maglione caa1a1228b Bug 1473631: Part 10 - Replace pref observers with callbacks in ScriptSecurityManager. r=njn
MozReview-Commit-ID: COEgATfeEj

--HG--
extra : rebase_source : 8cdd70210041b0140ef951b3899dc324e0a9d74c
2018-07-05 14:53:14 -07:00
Bogdan Tara a8850882a7 Merge autoland to mozilla-central. a=merge 2018-07-17 00:58:15 +03:00
Andrea Marchesini ceea0172b0 Bug 1473587 - CSP Violation events should have the correct sample for inline contexts, r=jorendorff, r=ckerschb 2018-07-16 17:58:04 +02:00
Tim Huang c0118a2d73 Bug 1473247 - Part 1: Fixing the issue that the IP addresses won't be set for first party domains. r=arthuredelstein,baku
Right now, the firstPartyDomain won't be set when using IP addresses as
first party domains. It is because of that the TLD service won't accept
IP addresses as valid hosts. The patch fixes this problem by detecting
that if the host is a IP address. If it is, we will still set the
firstPartyDoamin with the IP address.

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

--HG--
extra : moz-landing-system : lando
2018-07-13 19:53:15 +00:00
Olli Pettay de99e4460b Bug 1439153 - Make WebExtensions work with Shadow DOM/WebComponents, r=kmag
--HG--
extra : rebase_source : 83638cba42eea1523d32d06a2eb14df20cbab404
2018-07-14 05:26:15 +03:00
imjching 0c7582c716 Bug 1416066 - Enable caching for scripts with codebase URLs of about:home, about:newtab, and about:welcome. r=kmag
MozReview-Commit-ID: HC3cNVxWLe6

--HG--
extra : rebase_source : eab95e34618bf1ac856b44db89800b615c6503b8
2018-07-03 21:24:52 -04:00
Andrea Marchesini 5fff1762ad Bug 1418236 - Correct EventTarget for CSP violation events, r=ckerschb 2018-07-10 17:40:21 +02:00
Andrea Marchesini 14d462eeb3 Bug 1418246 - Return valid columnNumber value in CSP violation events, r=ckerschb 2018-07-05 08:21:04 +02:00
Tim Huang f5dcf5b4b6 Bug 1470156 - Part 2: Fixing the crashing problem when using an invalid character in a firstPartyDomain. r=baku
This patch adds a sanitization of firstPartyDomain when calling the
OriginAttributes::CreateSuffix() and remove the release assert there.
The cookies API for the web extension can use a arbitrary string for the
firstPartyDomain. So, we should sanitize the firstPartyDomain before
we creating a suffix. The release assert is not required anymore since
the firstPartyDomain is sanitized

Depends on D1845.

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

--HG--
extra : moz-landing-system : lando
2018-07-03 13:47:45 +00:00
Kris Maglione 26c59776be Bug 1470965: Fix refcount sanity in nsIPrincipal.addonPolicy getter. r=mixedpuppy
MozReview-Commit-ID: KuDN3joKi7S

--HG--
extra : source : d28d3a80e781ae10cbc97775415827ec93193c56
2018-06-26 00:19:46 -07:00
shindli 13098ab1ef Backed out 3 changesets (bug 1470023, bug 1469719, bug 1470965) for | toolkit/components/perfmonitoring/tests/browser/browser_compartments.js on a CLOSED TREE
Backed out changeset bab121b4dd84 (bug 1469719)
Backed out changeset d28d3a80e781 (bug 1470965)
Backed out changeset 1adc0372343e (bug 1470023)
2018-06-26 22:57:54 +03:00
Kris Maglione ab6b58eddf Bug 1470965: Fix refcount sanity in nsIPrincipal.addonPolicy getter. r=mixedpuppy
MozReview-Commit-ID: KuDN3joKi7S

--HG--
extra : rebase_source : e2caed633f39896df6c065abcb18791b582d8f59
2018-06-26 00:19:46 -07:00
Valentin Gosu a8e3a8c349 Bug 1448330 - Make nsIURI.clone a private method r=mayhemer
MozReview-Commit-ID: 1efpeaEPaXP

--HG--
extra : rebase_source : e660f1e5bcae9b7119bc5b37713691069272b375
2018-06-14 13:05:43 +02:00
Joel Maher 50b91c0a14 Bug 1405428 - skip-if = verify on mochitests which do not pass test-verify. r=gbrown 2018-06-10 05:01:47 -04:00
Emilio Cobos Álvarez fffb25b74f Bug 1465585: Switch from mozilla::Move to std::move. r=froydnj
This was done automatically replacing:

  s/mozilla::Move/std::move/
  s/ Move(/ std::move(/
  s/(Move(/(std::move(/

Removing the 'using mozilla::Move;' lines.

And then with a few manual fixups, see the bug for the split series..

MozReview-Commit-ID: Jxze3adipUh
2018-06-01 10:45:27 +02:00
Jan de Mooij 08cef83f24 Bug 1464374 part 4 - Remove unused nsScriptSecurityManager::doGetObjectPrincipal. r=bz 2018-05-31 11:28:49 +02:00
Boris Zbarsky b134958200 Bug 1452666. Implement nsISerializable on expanded principals. r=kmag 2018-05-24 02:43:14 -04:00
Tom Schuster 937d9326cd Bug 1453916 - Allow canvas extraction from webextension content-script even with resistFingerprinting turned on. r=kmag,bz
--HG--
extra : rebase_source : d67c589e8819407bb5acc4378d029288dd9295be
2018-05-14 20:49:32 +02:00
Gijs Kruitbosch faf68417dc Bug 1461407 - make about:home unlinkable again and improve behavior of serialized principals across changes to URLs, r=bz,Mardak,mikedeboer
Making about:home unlinkable changes its URL structure. Prior to this change,
it is a nested URL. After this change, it no longer is.

We store serialized versions of principals in some cases. These include
details about whether the URI is nested etc. This is problematic for the
about:home change because the change in nesting changes the origin of the
page, so the origin  would mismatch between the principal and its URL.
To avoid this, we always re-create URIs for about: URIs when deserializing
them from strings, ensuring we don't create bogus principals.

MozReview-Commit-ID: 87zVUFgbusn

--HG--
extra : rebase_source : a7ad0dc3b1ea39521517da648f234d35d9a1729f
2018-05-14 22:04:49 +01:00
Adrian Wielgosik 074d88de5a Bug 1460940 - Convert nsIPrincipal to use nsIDocument. r=bz
MozReview-Commit-ID: z1TGWtS1KG

--HG--
extra : rebase_source : e5291c40eb017c1e3fd69333ac108dda852fb8cd
2018-05-11 19:46:15 +02:00
Brian Grinstead a61cbe6dae Bug 1460685 - Backed out changeset 09ee763947c3 (bug 1352513);r=Gijs
The security.allow_chrome_frames_inside_content pref was added to support
XUL extension compat after the hiddenWindow special case was removed in
Bug 1145470. Since we don't need to support that use-case anymore, this
changeset backs out the change that relanded the special case with the pref.
MozReview-Commit-ID: 4keMEIQvt1Y

--HG--
extra : rebase_source : 1a9c54c9807eaed2645d0ea03b5064ed7472d7a4
2018-05-11 16:26:07 -07:00
Valentin Gosu bd4365d7e7 Bug 1448058 - Remove nsIMutable from URI implementations r=mayhemer
* Also removes NS_TryToMakeImmutable, NS_TryToSetImmutable, URIIsImmutable
* NS_EnsureSafeToReturn, nsINetUtil.toImmutableURI

MozReview-Commit-ID: 5eFtFm2CQt7

--HG--
extra : rebase_source : 1f3d23ec646883e76844d42113bc1c71c01a1ad7
2018-05-09 18:21:24 +02:00
Andrea Marchesini 5b65a3ab01 Bug 1374745 - nsScriptSecurityManager should not use a string bundle before profile selection, r=ckerschb 2018-05-08 15:52:53 +02:00
Chris Peterson 71422dcaa9 Bug 1457813 - Part 2: Replace non-asserting NS_PRECONDITIONs with MOZ_ASSERTs. r=froydnj
s/NS_PRECONDITION/MOZ_ASSERT/ and reindent

MozReview-Commit-ID: KuUsnVe2h8L

--HG--
extra : source : c14655ab3df2c9b1465dd8102b9d25683359a37b
2018-04-28 12:50:58 -07:00
Kris Maglione fc4672bb17 Bug 1456035: Follow-up: Delete redundant test_extensionURL.html, which fails with wrapper errors. r=me f=aswan CLOSED TREE
MozReview-Commit-ID: F5LmwfizygB

--HG--
extra : amend_source : 478bc62294f7a311f960a0b3e888261473254d15
2018-04-25 17:01:36 -07:00
Andrea Marchesini 6bcc1f6196 Bug 1328964 - part 2 - WorkletThread r=baku
Initial version r=smaug.
Rebased to c616a6fd5e4b by Jan-Ivar Bruaroey <jib@mozilla.com> r=karlt.
Rebased to 83de58ddda20 by Karl Tomlinson <karlt+@karlt.net> r=baku.

MozReview-Commit-ID: Lo8TWtN8qyz

--HG--
extra : rebase_source : ffcb7b835ea49cda3e25dfa94a91b3725fdbfb29
2018-04-12 15:14:48 +12:00
Tomislav Jovanovic 9e09943ad5 Bug 1441336 - Use addon permissions for PerformanceTiming properties r=bz,kmag
We need to side-step existing cross-origin checks in Performance Timing code
when the caller is a web extension content script that otherwise has permission
to access the cross-origin resource.

MozReview-Commit-ID: 8IgtqZgPWgY

--HG--
extra : rebase_source : e8152c5d8ab32096d1ff7f97311c1b43b57c3694
2018-04-04 16:54:26 +02:00
Boris Zbarsky 6c499a3613 Bug 1448414. Remove the DOM_OBJECT classinfo bit. r=kmag 2018-03-28 22:46:23 -04:00
Coroiu Cristina 29fa060fbe Backed out changeset 9e41e9c653f2 (bug 1448414) for mochitest failures Permission denied to create wrapper for object of class XPCComponents_Interfaces on a CLOSED TREE 2018-03-29 12:21:00 +03:00
Boris Zbarsky 7513177d1c Bug 1449211. Stop special-casing XUL command dispatchers and tree selections in content XBL scopes. r=kmag 2018-03-28 22:46:23 -04:00
Boris Zbarsky 05346e7ec6 Bug 1448414. Remove the DOM_OBJECT classinfo bit. r=kmag 2018-03-28 22:46:23 -04:00
Tom Ritter 449237fc51 Bug 1378552 - Reduce the liklihood of inadvertently misusing NullPrincipal::Create(). r=ckerschb
NullPrincipal::Create() (will null OA) may cause an OriginAttributes bypass.
We change Create() so OriginAttributes is no longer optional, and rename
Create() with no arguments to make it more explicit about what the caller is doing.

MozReview-Commit-ID: 7DQGlgh1tgJ
2018-03-22 13:36:20 -05:00
Valentin Gosu af5eeff2e3 Bug 1442239 - Make URI deserialization (nsISerializable.read) happen via nsIURIMutator only r=mayhemer
* Deserialization now only happens via a mutator
* The CID for URI implementations actually returns the nsIURIMutator for each class
* The QueryInterface of mutators implementing nsISerializable will now act as a finalizer if passed the IID of an interface implemented by the URI it holds

MozReview-Commit-ID: H5MUJOEkpia

--HG--
extra : rebase_source : 01c8d16f7d31977eda6ca061e7889cedbf6940c2
2018-03-19 20:22:32 +01:00
Andreea Pavel e5950c0d39 Backed out 2 changesets (bug 1442239) for xpcshell failures at widget/tests/unit/test_taskbar_jumplistitems.js on a CLOSED TREE
Backed out changeset 513cd669aca1 (bug 1442239)
Backed out changeset aef4c73f736f (bug 1442239)
2018-03-19 21:19:26 +02:00
Valentin Gosu f0c7a1ae13 Bug 1442239 - Make URI deserialization (nsISerializable.read) happen via nsIURIMutator only r=mayhemer
* Deserialization now only happens via a mutator
* The CID for URI implementations actually returns the nsIURIMutator for each class
* The QueryInterface of mutators implementing nsISerializable will now act as a finalizer if passed the IID of an interface implemented by the URI it holds

MozReview-Commit-ID: H5MUJOEkpia

--HG--
extra : rebase_source : 8ebb459445cab23288a6c4c86e4e00c6ee611e34
2018-03-08 13:35:10 +01:00
Christian Holler 022546f573 Bug 1442716 - [caps] Handle empty origin gracefully in FUZZING. r=baku 2018-03-02 19:48:49 +01:00
Christian Holler 2d642a506c Bug 1440397 - Handle unexpected principal tag gracefully in FUZZING. r=baku 2018-03-02 19:01:00 +01:00
Valentin Gosu 34872b6d20 Bug 1441688 - Remove nsIIPCSerializableURI.Deserialize r=mayhemer
MozReview-Commit-ID: 8gwX3vSKWNX

--HG--
extra : rebase_source : a2c21a7e66aa8be3c2e345ca64feea967b380491
2018-03-05 04:14:44 +01:00
Valentin Gosu f102a081b2 Bug 1434163 - Make all nsIURI attributes readonly r=mayhemer
MozReview-Commit-ID: KtjO8VWjPF5

--HG--
extra : rebase_source : 061a6db73e36b3a0b3732d44379bbc10e8268f9a
2018-02-27 00:07:48 +01:00
Nathan Froyd c821ec9351 Bug 1441584 - part 1 - declare inner URI Mutator classes final; r=valentin
For documentation purposes and to assist the compiler.
2018-02-27 20:13:57 -05:00
Valentin Gosu 27e9e0be9f Bug 1433958 - Change code that sets nsIURI.host to use nsIURIMutator r=mayhemer
MozReview-Commit-ID: 7T5gCu8WOfa

--HG--
extra : rebase_source : 752c34e5f9dde2e16fc9243c11860b987acbcb93
2018-02-26 20:43:47 +01:00
Valentin Gosu 7bd0336d01 Bug 1433958 - Change code that sets nsIURI.pathQueryRef to use nsIURIMutator r=mayhemer
MozReview-Commit-ID: HVyZ3E1XuLN

--HG--
extra : rebase_source : fd122b3122e0f3eb371d429bd86ad35d09dcfbf6
2018-02-26 20:43:45 +01:00
Jason Orendorff e7c94fff59 Bug 1439063 - Part 1: Move several public headers from js/src to js/public. r=jandem.
js/src/jsalloc.h -> js/public/AllocPolicy.h
jsalloc.cpp -> js/src/util/AllocPolicy.cpp
jsbytecode.h -> merge into js/public/TypeDecls.h
jsprf.h -> js/public/Printf.h
jsprf.cpp -> js/src/util/Printf.cpp
jsprototypes.h -> public/ProtoKey.h
jswrapper.h -> js/Wrapper.h

--HG--
rename : js/src/jsalloc.h => js/public/AllocPolicy.h
rename : js/src/jsprf.h => js/public/Printf.h
rename : js/src/jsprototypes.h => js/public/ProtoKey.h
rename : js/src/jswrapper.h => js/public/Wrapper.h
rename : js/src/jsalloc.cpp => js/src/util/AllocPolicy.cpp
rename : js/src/jsprf.cpp => js/src/util/Printf.cpp
extra : rebase_source : 98b16d94c469202eab0303a8da844f1d0b6aa809
extra : amend_source : e0b16c1077226d6fe240f4d7096537f93b43f2b8
extra : histedit_source : d94e0ba7904a7d66742c7fac43f638aaec4fa4e5
2018-02-21 10:30:19 -06:00
Christoph Kerschbaumer 81b5848031 Bug 1432358: Update OverridesCSP to account for systemprincipal. r=kmag
--HG--
extra : source : 6840396ed6ec8cdc9e77e253c1c61258a24fb987
extra : intermediate-source : a67e95bd0ccf13faa26aaa6b56fd1d826a7608ec
2018-02-01 14:05:05 +01:00
Chris Peterson d09123f248 Bug 1436263 - Part 1: Replace `final override` virtual function specifiers with just `final`. r=froydnj
MozReview-Commit-ID: DE5HkIhsZ6D

--HG--
extra : rebase_source : 94831c1e13a840dd2ea0600f64bcf70c2bf938d9
extra : source : cf9283bf1b0bca3a6311c98e227329d451f80ecb
2018-02-05 22:46:57 -08:00
Sebastian Hengst a6cab8c4e8 Backed out 4 changesets (bug 1432358) for failing xpcshell's test_ext_contentscript_triggeringPrincipal.js
Backed out changeset ef7b8eef07c1 (bug 1432358)
Backed out changeset 2fa11c525da3 (bug 1432358)
Backed out changeset a67e95bd0ccf (bug 1432358)
Backed out changeset 91c948c94506 (bug 1432358)
2018-02-12 19:58:28 +02:00
Christoph Kerschbaumer c7f8358db8 Bug 1432358: Update OverridesCSP to account for systemprincipal. r=kmag
--HG--
extra : source : 6840396ed6ec8cdc9e77e253c1c61258a24fb987
2018-02-01 14:05:05 +01:00
Andrew McCreight 5dec0e0beb Bug 1432992, part 1 - Remove definitions of Ci, Cr, Cc, and Cu. r=florian
This patch was autogenerated by my decomponents.py

It covers almost every file with the extension js, jsm, html, py,
xhtml, or xul.

It removes blank lines after removed lines, when the removed lines are
preceded by either blank lines or the start of a new block. The "start
of a new block" is defined fairly hackily: either the line starts with
//, ends with */, ends with {, <![CDATA[, """ or '''. The first two
cover comments, the third one covers JS, the fourth covers JS embedded
in XUL, and the final two cover JS embedded in Python. This also
applies if the removed line was the first line of the file.

It covers the pattern matching cases like "var {classes: Cc,
interfaces: Ci, utils: Cu, results: Cr} = Components;". It'll remove
the entire thing if they are all either Ci, Cr, Cc or Cu, or it will
remove the appropriate ones and leave the residue behind. If there's
only one behind, then it will turn it into a normal, non-pattern
matching variable definition. (For instance, "const { classes: Cc,
Constructor: CC, interfaces: Ci, utils: Cu } = Components" becomes
"const CC = Components.Constructor".)

MozReview-Commit-ID: DeSHcClQ7cG

--HG--
extra : rebase_source : d9c41878036c1ef7766ef5e91a7005025bc1d72b
2018-02-06 09:36:57 -08:00
Boris Zbarsky 0920564cb3 Bug 1435483 part 3. Remove nsIXPCException. r=qdot
This interface is not usable from JS, because we don't expose initialize() in
the WebIDL bindings for Exception.  And C++ doesn't use it.

MozReview-Commit-ID: LsIm4YA0YZE
2018-02-05 16:34:04 -05:00
Andrea Marchesini 8cdf705535 Bug 1435174 - Remove the renaming 'using namespace workers', r=bkelly 2018-02-05 19:55:07 +01:00
Andrew McCreight 589eaa7bb4 Bug 1434952 - Remove signed.applets.codebase_principal_support pref. r=mrbkap
MozReview-Commit-ID: K8nic9kw8gF

--HG--
extra : rebase_source : 2f99d4594c88a4e6f38cbe740af8e10a5a528a81
2018-02-01 12:44:59 -08:00
Florian Quèze 2b1c8dccb6 Bug 1339461 - script-generated patch to convert foo.indexOf(...) == -1 to foo.includes(), r=Mossop. 2018-02-01 20:45:22 +01:00
Andrea Marchesini 7e52540256 Bug 1432963 - Fixing workers headers - part 16 - JSSettings in a workerinternals namespace, r=smaug 2018-01-31 08:24:59 +01:00
Kris Maglione 918ed6c474 Bug 1431533: Part 5a - Auto-rewrite code to use ChromeUtils import methods. r=florian
This was done using the following script:
37e3803c7a/processors/chromeutils-import.jsm

MozReview-Commit-ID: 1Nc3XDu0wGl

--HG--
extra : source : 12fc4dee861c812fd2bd032c63ef17af61800c70
extra : intermediate-source : 34c999fa006bffe8705cf50c54708aa21a962e62
extra : histedit_source : b2be2c5e5d226e6c347312456a6ae339c1e634b0
2018-01-29 15:20:18 -08:00
Andrea Marchesini 3513d1c407 Bug 1413112 - Renaming Workers.h to WorkerCommon.h, r=bkelly
--HG--
rename : dom/workers/Workers.h => dom/workers/WorkerCommon.h
2018-01-30 10:10:04 +01:00
Cosmin Sabou 9a65a40178 Backed out 3 changesets (bug 1431533) for Android mochitest failures on testEventDispatcher on a CLOSED TREE
Backed out changeset a1eca62826a1 (bug 1431533)
Backed out changeset 34c999fa006b (bug 1431533)
Backed out changeset e2674287e57f (bug 1431533)
2018-01-30 07:17:48 +02:00
Kris Maglione 6476f95b13 Bug 1431533: Part 5a - Auto-rewrite code to use ChromeUtils import methods. r=florian
This was done using the following script:
37e3803c7a/processors/chromeutils-import.jsm

MozReview-Commit-ID: 1Nc3XDu0wGl

--HG--
extra : source : 12fc4dee861c812fd2bd032c63ef17af61800c70
2018-01-29 15:20:18 -08:00
Brindusan Cristian af8879d1eb Backed out 2 changesets (bug 1431533) for ESlint failures on a CLOSED TREE
Backed out changeset 6e56f4c8843e (bug 1431533)
Backed out changeset 12fc4dee861c (bug 1431533)
2018-01-30 02:32:43 +02:00
Kris Maglione c276bb9375 Bug 1431533: Part 5a - Auto-rewrite code to use ChromeUtils import methods. r=florian
This was done using the following script:
37e3803c7a/processors/chromeutils-import.jsm

MozReview-Commit-ID: 1Nc3XDu0wGl

--HG--
extra : rebase_source : c004a023389f1f6bf3d2f3efe93c13d423b23ccd
2018-01-29 15:20:18 -08:00
Valentin Gosu ea4e6b68ff Bug 1431204 - Make nsIURI.spec readonly r=mayhemer
MozReview-Commit-ID: 1l1CBUotIPh

--HG--
extra : rebase_source : 92af70ad412719d93222551b658f313cefd85e75
2018-01-19 15:26:07 +01:00
Valentin Gosu 89445898bd Bug 1431204 - Only addref the mutator if is not null r=mayhemer
MozReview-Commit-ID: 94VsIsLxx2T

--HG--
extra : rebase_source : 3608e624bd8dce13ac7a5dac45a3522b3b685460
2018-01-19 15:26:03 +01:00
Anthony Ramine 0f6e750881 Bug 1431449 - Make URLParams::ParseInput call URLParams::Parse instead of the opposite; r=bz
This trades off more virtual calls in URLParams::ParseInput, while removing any extra
allocation when calling URLParams::Parse.

MozReview-Commit-ID: HrIqsguQjrk

--HG--
extra : rebase_source : fd6d4f0455f5c3df72bd3518b98359ac8759a89d
2018-01-18 13:13:51 +01:00
Anthony Ramine fbcfbecb79 Bug 1431449 - Introduce URLParams::Parse; r=bz
MozReview-Commit-ID: LicbWjZHxjz

--HG--
extra : rebase_source : c49df723c73c03d64b4b9ca5f6d3a52735e38b7d
2018-01-18 12:53:35 +01:00
Chris Peterson 37efe4d0e6 Bug 1428535 - Add missing override specifiers to overridden virtual functions. r=froydnj
MozReview-Commit-ID: DCPTnyBooIe

--HG--
extra : rebase_source : cfec2d96faeb11656d86d760a34e0a04cacddb13
extra : intermediate-source : 6176724d63788b0fe8caa3f91607c2d93dbaa7ec
extra : source : eebbb0600447f9b64aae3bcd47b4be66c02a51ea
2017-11-05 19:37:28 -08:00
Boris Zbarsky 7ebac0960f Bug 1424474 part 1. Make sure we don't call into the chrome registry's AllowContentToAccess with non-chrome URLs. r=gijs
MozReview-Commit-ID: I3DyrYGpGC2
2017-12-21 10:54:43 -05:00
Florian Quèze 0f55cd45be Bug 1421992 - script-generated patch to replace do_execute_soon, do_print and do_register_cleanup with executeSoon, info and registerCleanupFunction, rs=Gijs. 2017-12-21 11:10:23 +01:00
Florian Quèze 032c961e0a Bug 1421992 - script-generated patch to replace do_check_* functions with their Assert.* equivalents, rs=Gijs. 2017-12-21 11:08:17 +01:00
Bogdan Tara 9ac9aa3461 Merge mozilla-central to inbound. r=merge a=merge on a CLOSED TREE 2017-12-20 00:17:00 +02:00
Jonathan Kingston 2cb1afc933 Bug 1420622 - Remove feed and pcast protocols. r=Gijs
MozReview-Commit-ID: KAC9MmLiuBG

--HG--
extra : rebase_source : 076fc5a6acc75362ceffee1b5150e1598af41673
2017-12-19 16:12:29 +00:00
Gijs Kruitbosch 0d38343e35 Bug 1424261, r=bz
--HG--
extra : rebase_source : 2bead652bbfd4cd251b431e04e3002c38c1a7a7b
2017-12-12 10:53:10 -06:00
Gijs Kruitbosch 780f9529bd Bug 1422177 - add tests for moz-icon being non-linkable from the web, r=bz,jkt
MozReview-Commit-ID: 83aeiM6Vjky

--HG--
extra : rebase_source : ccdbdb017f87c81fdecf38717164d46cf65222b6
2017-12-04 15:26:34 +00:00
Valentin Gosu 5a83d2bc0b Bug 1420954 - Make nsIURIMutator setters return nsIURIMutator so we can chain setters r=bagder
MozReview-Commit-ID: 53BD91hB2yi

--HG--
extra : rebase_source : 3c4f5b9ad8820353ae108b982026048dbf599d95
2017-12-05 02:35:21 +01:00
Mark Banner 41c7322062 Bug 1421968 - Fix more instances of .getService to use Services.jsm where possible. r=mossop
MozReview-Commit-ID: 2EbsWq7VPrI

--HG--
extra : rebase_source : 4e751a74b641b99b01af0947bf2eeaafb3fe8c62
2017-11-30 12:04:16 +00:00
shindli 7ba06ee564 Backed out 2 changesets (bug 1420954) for build failure in /builds/worker/workspace/build/src/obj-firefox/dist/include/nsIURIMutator.h:340:3: r=backout on a CLOSED TREE
Backed out changeset 8ce0a0d49d9e (bug 1420954)
Backed out changeset 480c6e1721e9 (bug 1420954)
2017-12-03 01:10:14 +02:00
Valentin Gosu f903a38639 Bug 1420954 - Make nsIURIMutator setters return nsIURIMutator so we can chain setters r=bagder
MozReview-Commit-ID: 53BD91hB2yi

--HG--
extra : rebase_source : 45594a92e1a9f18f2f4b5bb2824b5f8ced584eab
2017-12-02 23:09:34 +01:00
Gijs Kruitbosch e77ee731e9 Bug 1222924 - stop allowing webpages to link to moz-icon: , r=mrbkap
MozReview-Commit-ID: FKEDboWIfFQ

--HG--
extra : rebase_source : 801317b5746c6e84431c6a8f2097b83523646016
2017-11-22 21:31:41 +00:00
Kris Maglione 7cdbab4b1e Bug 1415352: Part 5b - Use the last component principal as principal to inherit for data: URLs. r=bz,krizsa
The logic for choosing the principal here was originally written before
loadInfo had a separate principalToInherit field, and we needed to specify it
via the triggeringPrincipal instead. At that point, we had to choose a
component principal with permission to load the URI at the start of the
request.

However, now that we have a separate field for the principal to inherit, it's
only needed after access checks have passed and we know that we have a URI
which inherits a principal. In that case, the current logic causes us to
always inherit the first principal in the whitelist (which is the page
principal) for URIs (such as data: URIs) that always inherit, where we really
want to inherit the last (which is the extension principal).

MozReview-Commit-ID: EPoUNuOCwrH

--HG--
extra : rebase_source : 535083e3dd4598ac4e8ea187d27d61ac2ac48476
2017-11-22 14:20:26 -08:00
Kris Maglione d81173fce7 Bug 1415352: Part 5a - Allow extension codebase principals to override CSP. r=bz
We currently use plain extension codebase principals for most of the extension
stylesheets that we inject into content pages. Since we want the content
loaded by those stylesheets to be exempt from CSP, and can't safely use
expanded principals for their loads, we need to make plain extension codebase
principals exempt from CSP.

MozReview-Commit-ID: IIAUWU68nor

--HG--
extra : rebase_source : f7447e1d87c8d75b97de580a641fcac6333a9f27
2017-11-07 14:25:59 -08:00
Valentin Gosu d2d8524673 Bug 1415205 - Add nsIURIMutator impls for all objects implementing nsIURI r=bagder
This also changes URIUtils.cpp:DeserializeURI() to use the mutator to instantiate new URIs, instead of using their default constructor.

MozReview-Commit-ID: JQOvIquuQAP

--HG--
extra : rebase_source : e146624c5ae423f7f69a738aaaafaa55dd0940d9
2017-11-20 17:11:30 +01:00
Andrea Marchesini 155b15b8e0 Bug 1414755 - Get rid of ContentPrincipalInfoOriginNoSuffix, r=bz, r=bkelly
This patch uses MozURL in ServiceWorkerRegistrar and in DBScheme to obtain the
origin of a URL. This is safe because the URL is always http/https/ftp.

It also changes the serialization of Principal in nsJSPrincipals in order to
pass the originNoSuffix together with the OriginAttributes and the spec.
2017-11-15 11:19:26 +01:00
Felipe Gomes d68bb1d91f Bug 1409148 - Drop the old contentPluginClose.png icon and replace it with the modern svg version. r=johannh
This also updates its :hover and :active visuals to match the tab bar

MozReview-Commit-ID: 98LiqClr3SG

--HG--
extra : rebase_source : 4f20c5803702a2da731a1eb6880e2b68e1867f9e
2017-11-10 14:05:00 -02:00
Sebastian Hengst 9d26579fa1 Backed out 6 changesets (bug 1409148) for failing mochitest caps/tests/mochitest/test_bug292789.html on Android. r=backout on a CLOSED TREE
Backed out changeset 6fe2a24e51ca (bug 1409148)
Backed out changeset 0b032b6e0655 (bug 1409148)
Backed out changeset 78eebd668bf1 (bug 1409148)
Backed out changeset acfd8cf8c4ec (bug 1409148)
Backed out changeset 4d486418cd55 (bug 1409148)
Backed out changeset 0da5d54d003c (bug 1409148)

--HG--
rename : toolkit/themes/shared/plugins/plugin-blocked.svg => browser/themes/shared/notification-icons/plugin-blocked.svg
rename : toolkit/themes/shared/plugins/plugin.svg => browser/themes/shared/notification-icons/plugin.svg
2017-11-10 02:59:06 +02:00
Felipe Gomes 62c5288e77 Bug 1409148 - Drop the old contentPluginClose.png icon and replace it with the modern svg version. r=johannh
This also updates its :hover and :active visuals to match the tab bar

MozReview-Commit-ID: SijUvVrAAF

--HG--
extra : rebase_source : 7a3b711a32edd76e3ed02e5ccb9aa1fbb48e3345
2017-11-09 14:41:48 -02:00
Andreea Pavel 62b7374667 Backed out 6 changesets (bug 1409148) for ESlint failure at browser/base/content/test/plugins/browser_CTP_overlay_styles.js:73 r=backout
Backed out changeset 86e066b54fc3 (bug 1409148)
Backed out changeset bd2913f16345 (bug 1409148)
Backed out changeset 331d0da78f3e (bug 1409148)
Backed out changeset 86d7f89e9cfb (bug 1409148)
Backed out changeset 9159635ae827 (bug 1409148)
Backed out changeset 59532da5ffff (bug 1409148)

--HG--
rename : toolkit/themes/shared/plugins/plugin-blocked.svg => browser/themes/shared/notification-icons/plugin-blocked.svg
rename : toolkit/themes/shared/plugins/plugin.svg => browser/themes/shared/notification-icons/plugin.svg
extra : rebase_source : 62b608b3daa611c3b06c3912e9b84db0cb6710ba
2017-11-09 23:42:41 +02:00
Felipe Gomes 5da35dc1d7 Bug 1409148 - Drop the old contentPluginClose.png icon and replace it with the modern svg version. r=johannh
This also updates its :hover and :active visuals to match the tab bar

MozReview-Commit-ID: SijUvVrAAF

--HG--
extra : rebase_source : 7a3b711a32edd76e3ed02e5ccb9aa1fbb48e3345
2017-11-09 14:41:48 -02:00
Kris Maglione 27c96362b9 Bug 1412345: Downgrade expanded principals before inheriting. r=bz,krizsa
There are several ways that expanded principals can be used as triggering
principals for requests. While that works fine for security checks, it also
sometimes causes them to be inherited, and used as result principals in
contexts where expanded principals aren't allowed.

This patch changes our inheritance behavior so that expanded principals are
downgraded to the most appropriate constituent principal when they would
otherwise be inherited.

The logic for choosing the most appropriate principal is a bit suspect, and
may eventually need to be changed to always select the last whitelist
principal, but I chose it to preserve the current principal downgrade behavior
used by XMLHttpRequest for the time being.

MozReview-Commit-ID: 9fvAKr2e2fa

--HG--
extra : rebase_source : c30df1b3851c11fed5a1d6a7fb158cec14933182
2017-11-02 19:56:27 -07:00
Kris Maglione b46bd8b6b0 Bug 1411817: Add do_AddRef overloads for nsCOMPtr<T> and nsRevocableEventPtr<T>. r=froydnj
MozReview-Commit-ID: gEU7whtNHc

--HG--
extra : rebase_source : 6763e6b31be8a3341f968eef057b756fbfe3cbbe
extra : amend_source : da6140fb0559d78b46e80e72e8b6768bf2364fb1
2017-10-25 19:46:50 -07:00
Kris Maglione 257d9118dc Bug 1409249: Require singleton constructors to return explicit already_AddRefed. r=froydnj
Right now, NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR expects singleton
constructors to return already-addrefed raw pointers, and while it accepts
constructors that return already_AddRefed, most existing don't do so.

Meanwhile, the convention elsewhere is that a raw pointer return value is
owned by the callee, and that the caller needs to addref it if it wants to
keep its own reference to it.

The difference in convention makes it easy to leak (I've definitely caused
more than one shutdown leak this way), so it would be better if we required
the singleton getters to return an explicit already_AddRefed, which would
behave the same for all callers.


This also cleans up several singleton constructors that left a dangling
pointer to their singletons when their initialization methods failed, when
they released their references without clearing their global raw pointers.

MozReview-Commit-ID: 9peyG4pRYcr

--HG--
extra : rebase_source : 2f5bd89c17cb554541be38444672a827c1392f3f
2017-10-16 21:08:42 -07:00
Nicholas Nethercote 7c69d69eb3 Bug 1409960 - Remove ClassInfoData. r=bz.
This class does some caching of an nsIClassInfo's flags and name. Presumably it
made sense at some time in the past, but now it's only used by
CanCreateWrapper(). It's simpler to just directly get the flags and name when
needed, so this patch does that and removes the class.

--HG--
extra : rebase_source : 0f11844ca6be4ff007b50d95bb8f5a88037fb1b5
2017-10-19 10:11:21 +11:00
Nicholas Nethercote 78030c0e7b Bug 1409598 - Change nsIXPCScriptable::className and nsIClassInfo::{contractID,classDescription} from string to AUTF8String. r=froydnj.
This lets us replace moz_xstrdup() of string literals with AssignLiteral(),
among other improvements.

--HG--
extra : rebase_source : 9994d8ccb4f196cf63564b0dac2ae6c4370defb4
2017-10-18 13:17:26 +11:00
Kris Maglione bd6d63772a Bug 1407428: Hand out a const array reference for expanded principal whiteList. r=krizsa
The current API makes the life time and ownership of the result array unclear
without careful reading. The result array is always owned by the principal,
and its lifetime tied to the lifetime of the principal itself. Returning a
const array reference makes this clear, and should prevent callers from
accidentally modifying the returned array.

MozReview-Commit-ID: 3f8mhynkKAj

--HG--
extra : source : 237acf2879f6222bc4b076c377bf026d18a6ebef
extra : amend_source : dfaf6e88e3c4758f7fdcf7fb422d457edafab1b7
2017-10-10 15:00:16 -07:00
Sebastian Hengst 11a2b8ef67 Backed out changeset 237acf2879f6 (bug 1407428) for frequent crashes, e.g. in xpcshell's test_bug248970_cookie.js. r=backout on a CLOSED TREE
--HG--
extra : amend_source : 1ccac4fb953566239cba8db7d6f8bdca4ce48b35
2017-10-16 00:00:15 +02:00
Kris Maglione 7d8f8ea3d6 Bug 1407428: Hand out a const array reference for expanded principal whiteList. r=krizsa
The current API makes the life time and ownership of the result array unclear
without careful reading. The result array is always owned by the principal,
and its lifetime tied to the lifetime of the principal itself. Returning a
const array reference makes this clear, and should prevent callers from
accidentally modifying the returned array.

MozReview-Commit-ID: 3f8mhynkKAj

--HG--
extra : rebase_source : d2a5e0862f8c964fb5a3e46b50c2e9629b218699
extra : amend_source : 27d7a7ef5da6fe2aa1104009b6ee067465db73e1
2017-10-10 15:00:16 -07:00
Dan Banner 7caa92d5d8 Bug 1408777 - Automatically fix instances of missing semicolons in the tree. r=Standard8
MozReview-Commit-ID: Jm8BRgt6mIv
2017-10-15 20:50:39 +01:00
Kris Maglione 84fb189b82 Bug 1407056: Part 2 - Override page CSP for loads by expanded principals. r=bz,krizsa
Per the CSP specification, content injected by extensions is meant to be
exempt from page CSP. This patch takes care of the most common case of content
injected by extension content scripts, which always have expanded principals
which inherit from the page principal.

In a follow-up, we'll probably need to extend the exemption to stylesheet
content loaded by extension codebase principals.

MozReview-Commit-ID: GlY887QAb5V

--HG--
extra : rebase_source : 1371b4e4e7f330b7f7721d4aa169fcb52a7622d0
2017-10-07 14:53:30 -07:00
Nicholas Nethercote d225f7151b Bug 1400460 - Rename nsIAtom as nsAtom. r=hiro.
(Path is actually r=froydnj.)

Bug 1400459 devirtualized nsIAtom so that it is no longer a subclass of
nsISupports. This means that nsAtom is now a better name for it than nsIAtom.

MozReview-Commit-ID: 91U22X2NydP

--HG--
rename : xpcom/ds/nsIAtom.h => xpcom/ds/nsAtom.h
extra : rebase_source : ac3e904a21b8b48e74534fff964f1623ee937c67
2017-10-03 09:05:19 +11:00
Amy Chung 3eec3617b1 Bug 1399590 - Modify the argument of nsICookiePermission::CanAccess for changing nsIURI to nsIPrincipal. r=jdm 2017-10-03 14:37:11 +08:00
Nicholas Nethercote dfd3b7e7aa Bug 1400459 (part 2) - Devirtualize nsIAtom. r=heycam.
This patch merges nsAtom into nsIAtom. For the moment, both names can be used
interchangeably due to a typedef. The patch also devirtualizes nsIAtom, by
making it not inherit from nsISupports, removing NS_DECL_NSIATOM, and dropping
the use of NS_IMETHOD_. It also removes nsIAtom's IIDs.

These changes trigger knock-on changes throughout the codebase, changing the
types of lots of things as follows.

- nsCOMPtr<nsIAtom> --> RefPtr<nsIAtom>

- nsCOMArray<nsIAtom> --> nsTArray<RefPtr<nsIAtom>>
  - Count() --> Length()
  - ObjectAt() --> ElementAt()
  - AppendObject() --> AppendElement()
  - RemoveObjectAt() --> RemoveElementAt()

- ns*Hashtable<nsISupportsHashKey, ...> -->
  ns*Hashtable<nsRefPtrHashKey<nsIAtom>, ...>

- nsInterfaceHashtable<T, nsIAtom> --> nsRefPtrHashtable<T, nsIAtom>
  - This requires adding a Get() method to nsRefPtrHashtable that it lacks but
    nsInterfaceHashtable has.

- nsCOMPtr<nsIMutableArray> --> nsTArray<RefPtr<nsIAtom>>
  - nsArrayBase::Create() --> nsTArray()
  - GetLength() --> Length()
  - do_QueryElementAt() --> operator[]

The patch also has some changes to Rust code that manipulates nsIAtom.

MozReview-Commit-ID: DykOl8aEnUJ

--HG--
extra : rebase_source : 254404e318e94b4c93ec8d4081ff0f0fda8aa7d1
2017-09-26 08:33:21 +10:00
Nicholas Nethercote 041d2fa02a Bug 1400459 (part 1) - Remove return value from nsIAtom::ToUTF8String(). r=froydnj.
It's infallible.

--HG--
extra : rebase_source : 0b1e03c65233a227d84efeb9717a7cb1c464e4c8
2017-09-25 16:38:18 +10:00
Chris Peterson 45aa2a8e8e Bug 870698 - Part 2: Replace Append("") with AppendLiteral(""). r=erahm
MozReview-Commit-ID: CrkIP4iHP1U

--HG--
extra : rebase_source : 5dc4e91a3f1860773c199f1abf3f66479218834a
extra : intermediate-source : ba51cc79847f2b43ba616f4a5d2bbc6958ca9f6d
extra : source : 1fda2fa990cc918c748ffa14fcc5dbe13fe3bdc3
2017-09-03 22:14:11 -07:00
Chris Peterson 9f4c1f5278 Bug 870698 - Part 1: Replace Assign("") with AssignLiteral(""). r=erahm
MozReview-Commit-ID: A0u9PP49OW3

--HG--
extra : rebase_source : 7d5286959f510eb4b7df1b7e32d5b9b58719c48b
extra : intermediate-source : f552b4a78236c42bc09030b3eb008725a3edb9c8
extra : source : 26ac4a1014f6661a70e3bf9f552407e12c2c3981
2017-09-03 22:12:56 -07:00
Jason Orendorff ddaf859c55 Bug 1363200 - JSAPI for realms: Change a few XPConnect methods to take Realm arguments instead of JSCompartments. r=mrbkap
This also introduces JS::GetObjectRealmOrNull, which returns an object's realm,
or null if the object is a cross-compartment wrapper. In the new order,
wrappers can't have realms, since they must be shared across all realms in a
compartment. We're introducing this new function early (even though it's
*currently* possible to assign a realm to wrappers) in order to see in
advance if the possibility of returning null will cause problems.
(It looks like it won't.)

--HG--
extra : rebase_source : e55ebbbc4edf2a18ce267198928246592060e339
extra : source : d6bfce1187aa13dbfab03f9566ff7b05b6705e70
2017-06-28 12:31:53 -07:00
Jason Orendorff ce74f6c158 Bug 1363200 - JSAPI for realms: Move mIsContentXBLScope to the CompartmentPrivate. r=mrbkap
In the new order, it will be a compartment-level bit rather than a
realm-level bit, so it does not belong on the Scope.

--HG--
extra : rebase_source : 44aa4620f7fd7f8d253c8c7f09bf8c97c00ff061
extra : source : 5a9c01720d7929e43aa70341d3821bfaa2479592
2017-07-12 15:00:47 -05:00
Andrew McCreight bfd580fb71 Bug 1186409 - Use Cu.getGlobalForObject when importing properties off a JSM global. r=kmag
With JSM global sharing, the object returned by Cu.import() is a
NonSyntacticVariablesObject, rather than a global. Various code tries
to use properties from a JSM global via an import.

Cu.importGlobalProperties can also be used in some places.

MozReview-Commit-ID: HudCXO2GKN0

--HG--
extra : rebase_source : 6b5fa6f5509397504cb461a761f6cc2399f18c40
2017-06-23 13:51:14 -07:00
Sebastian Hengst 9d15132cd1 merge mozilla-central to autoland. r=merge a=merge 2017-09-06 11:28:07 +02:00
Kris Maglione 04acc0aace Bug 1396449: Part 2 - Use atoms to test WebExtension permissions. r=krizsa
The extension policy services uses atoms internally for permission names, so
using them directly rather than strings is considerably cheaper.

MozReview-Commit-ID: Io8EuOXHKVy

--HG--
extra : rebase_source : 577b4bdf7f899729e4cf92961a8e9e25bf886a72
2017-09-03 18:51:02 -07:00
Kris Maglione b3ba0520ee 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

--HG--
extra : rebase_source : 1b567919d2461bd0315d1a7d89f330cbd585f579
2017-09-05 11:04:43 -07:00
Karl Tomlinson 648484651d bug 1384701 get system fonts in EnsureInit() which is on main thread even with servo r=manishearth
GTK should be used only from the main thread, but the specific symptom before
this change was that creating a GtkEntry causes
pango_cairo_font_map_get_default() to be called.  This function returns a
different font map on each thread.  The font map is leaked when StyleThreads
are leaked at exit.

Font caches are usually expensive and so using the existing font map on the
main thread is preferable.

A GtkEntry already exists on the main thread, as well as style contexts for
most other system fonts, and so it is more efficient to create these on the
main thread while the style contexts exist.

Doing this also avoids the need for Gecko_nsFont_InitSystem() to hold a global
lock to avoid concurrently calling into GTK through LookAndFeel::GetColor().

MozReview-Commit-ID: DSOwEUeYmtV

--HG--
extra : rebase_source : 971bc565e465b2d2482308006f68451ecaa6e264
2017-09-04 18:29:04 +12:00
Xidorn Quan 4750451d3d Bug 1387993 - Enable chrome mochitests on linux debug build. r=jmaher
MozReview-Commit-ID: Aj0movJBDI9

--HG--
extra : rebase_source : c33c2386fd0ca2e9eed9cb7fc137caf41629f7e4
2017-08-30 10:18:30 +10:00
Chung-Sheng Fu 90189a558c Bug 863246 - Fix test failures r=Gijs
MozReview-Commit-ID: 8tUr27zvs8z

--HG--
extra : rebase_source : 997ace66c37098701d433508c682ed7621a78479
2017-07-19 17:30:01 +08:00
Chung-Sheng Fu 6a8ee766d6 Bug 863246 - Content can only load resource:// URIs declared content-accessible in manifests r=billm,bz
bz:
    caps/nsScriptSecurityManager.cpp

billm:
    browser/extensions/activity-stream/jar.mn
    browser/extensions/onboarding/jar.mn
    chrome/RegistryMessageUtils.h
    chrome/nsChromeRegistry.h
    chrome/nsChromeRegistryChrome.cpp
    chrome/nsChromeRegistryContent.cpp
    netwerk/protocol/res/SubstitutingProtocolHandler.cpp
    netwerk/protocol/res/SubstitutingProtocolHandler.h
    netwerk/protocol/res/nsIResProtocolHandler.idl
    netwerk/protocol/res/nsISubstitutingProtocolHandler.idl
    netwerk/protocol/res/nsResProtocolHandler.cpp
    netwerk/protocol/res/nsResProtocolHandler.h
    xpcom/components/ManifestParser.cpp

MozReview-Commit-ID: 1RXeNn7jdBf

--HG--
extra : rebase_source : 83000448abf58b7956c2eb122604d7ab38ad0f7c
2017-06-08 17:44:09 +08:00
Sebastian Hengst 163be910bb Backed out changeset 05fc8d2d7ca9 (bug 863246) for failing various reftests, e.g. parser/htmlparser/tests/reftest/bug535530-2.html. r=backout on a CLOSED TREE 2017-08-25 16:44:40 +02:00
Sebastian Hengst a8f25b8f67 Backed out changeset a7b0c6ddd812 (bug 863246) 2017-08-25 16:43:33 +02:00
Chung-Sheng Fu 2c9f10e897 Bug 863246 - Fix test failures r=Gijs
MozReview-Commit-ID: 8tUr27zvs8z

--HG--
extra : rebase_source : f9ce0f19c1cceeefac0a015d33b94bb787a34ffb
2017-07-19 17:30:01 +08:00
Chung-Sheng Fu 68b806c637 Bug 863246 - Content can only load resource:// URIs declared content-accessible in manifests r=billm,bz
bz:
    caps/nsScriptSecurityManager.cpp

billm:
    browser/extensions/activity-stream/jar.mn
    browser/extensions/onboarding/jar.mn
    chrome/RegistryMessageUtils.h
    chrome/nsChromeRegistry.h
    chrome/nsChromeRegistryChrome.cpp
    chrome/nsChromeRegistryContent.cpp
    netwerk/protocol/res/SubstitutingProtocolHandler.cpp
    netwerk/protocol/res/SubstitutingProtocolHandler.h
    netwerk/protocol/res/nsIResProtocolHandler.idl
    netwerk/protocol/res/nsISubstitutingProtocolHandler.idl
    netwerk/protocol/res/nsResProtocolHandler.cpp
    netwerk/protocol/res/nsResProtocolHandler.h
    xpcom/components/ManifestParser.cpp

MozReview-Commit-ID: 1RXeNn7jdBf

--HG--
extra : rebase_source : 749673b7a5bb0b50192a57496b2ea7962bf6b2d7
2017-06-08 17:44:09 +08:00
Gabriele Svelto 7387dc791b Bug 1393435 - Remove unnecessary inclusions of the crash reporter header files; r=mconley
MozReview-Commit-ID: 3tdFDrTYql8

--HG--
extra : rebase_source : cc862688f19afb8a5cf8c7cf915a5d3d45f041b5
2017-08-07 14:10:02 +02:00
Nicholas Nethercote f582d96b98 Bug 1390428 (part 9) - Remove nsXPIDLCString. r=erahm.
This is straightforward, with only two notable things.

- `#include "nsXPIDLString.h" is replaced with `#include "nsString.h"`
  throughout, because all nsXPIDLString.h did was include nsString.h. The
  exception is for files which already include nsString.h, in which case the
  patch just removes the nsXPIDLString.h inclusion.

- The patch removes the |xpidl_string| gtest, but improves the |voided| test to
  cover some of its ground, e.g. testing Adopt(nullptr).

--HG--
extra : rebase_source : 452cc4a08046a1adb1a8099a7e85a1917de5add8
2017-08-17 15:29:03 +10:00