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

195 Коммитов

Автор SHA1 Сообщение Дата
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
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
Jorg K ba1be252a0 Bug 1478441 - Introduce nsIURIWithSpecialOrigin needed for Thunderbird. r=baku 2018-07-31 11:27:00 +03: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 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 a053cf1c15 Bug 1476306 - Moving NullPrincipal/ContentPrincipal/SystemPrincipal under mozilla namespace - part 1 - NullPrincipal, r=ckerschb 2018-07-17 21:37:48 +02: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
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
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
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
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
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 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
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
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
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
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 c86dc10505 Bug 1380227 - Avoid many UTF16toUTF8 and UTF8toUTF16 conversions in nsStringBundle. r=emk.
Most of the names passed to nsIStringBundle::{Get,Format}StringFromUTF8Name
have one of the two following forms:

- a 16-bit C string literal, which is then converted to an 8-bit string in
  order for the lookup to occur;

- an 8-bit C string literal converted to a 16-bit string, which is then
  converted back to an 8-bit string in order for the lookup to occur.

This patch introduces and uses alternative methods that can take an 8-bit C
string literal, which requires changing some signatures in other methods and
functions. It replaces all C++ uses of the old methods.

The patch also changes the existing {Get,Format}StringFromName() methods so
they take an AUTF8String argument for the name instead of a wstring, because
that's nicer for JS code.

Even though there is a method for C++ code and a different one for JS code,
|binaryname| is used so that the existing method names can be used for the
common case in both languages.

The change reduces the number of NS_ConvertUTF8toUTF16 and
NS_ConvertUTF16toUTF8 conversions while running Speedometer v2 from ~270,000 to
~160,000. (Most of these conversions involved the string
"deprecatedReferrerDirective" in nsCSPParser.cpp.)

--HG--
extra : rebase_source : 3bee57a501035f76a81230d95186f8c3f460ff8e
2017-07-12 15:13:37 +10:00
Andrea Marchesini 884d9efc73 Bug 1369316 - Get rid of nsIPrincipal.unknownAppId, r=bholley 2017-06-02 11:05:28 +02:00
Andrea Marchesini cead0b042c Bug 1369310 - Get rid of nsIPrincipal.appStatus, r=bholley 2017-06-02 11:05:28 +02:00
Andrea Marchesini 9a3ddb1908 Bug 1357208 - No warning message when the creation of the principal origin fails, r=bholley 2017-04-19 08:00:11 +02:00
Andrea Marchesini 3c0ea7282d Bug 1347817 - Principal must always have a valid origin - part 4 - origin passed as argument when a principal is created, r=bholley 2017-03-29 08:24:01 +02:00
Andrea Marchesini 6ad34a8c5e Bug 1347817 - Principal must always have a valid origin - part 3 - move origin to BasePrincipal, r=bholley 2017-03-29 08:22:26 +02:00
Andrea Marchesini 8d4516d1d9 Bug 1347817 - Principal must always have a valid origin - part 2 - move OriginAttributes to the BasePrincipal, r=bholley 2017-03-29 08:21:03 +02:00
Andrea Marchesini d0aca06da7 Bug 1347817 - Principal must always have a valid origin - part 1 - renaming GetOriginInternal to GetOriginNoSuffixInternal, r=qdot 2017-03-29 08:19:41 +02:00
Sebastian Hengst 65459a7f0a Backed out changeset a70b549ac35d (bug 1347817) for failing test_websocket-transport.html on OSX 10.10 debug. r=backout 2017-03-29 11:18:41 +02:00
Sebastian Hengst 2d288e10b9 Backed out changeset c0e8522353bd (bug 1347817) 2017-03-29 11:17:22 +02:00
Sebastian Hengst 32c96bb13a Backed out changeset d71d95c73542 (bug 1347817) 2017-03-29 11:17:18 +02:00
Sebastian Hengst f61a4826a3 Backed out changeset 059bcee1ccda (bug 1347817) 2017-03-29 11:17:13 +02:00
Andrea Marchesini 0c636438cd Bug 1347817 - Principal must always have a valid origin - part 4 - origin passed as argument when a principal is created, r=bholley 2017-03-29 08:24:01 +02:00
Andrea Marchesini 9ff7505132 Bug 1347817 - Principal must always have a valid origin - part 3 - move origin to BasePrincipal, r=bholley 2017-03-29 08:22:26 +02:00
Andrea Marchesini 6328758fcf Bug 1347817 - Principal must always have a valid origin - part 2 - move OriginAttributes to the BasePrincipal, r=bholley 2017-03-29 08:21:03 +02:00
Andrea Marchesini d775e1a0a0 Bug 1347817 - Principal must always have a valid origin - part 1 - renaming GetOriginInternal to GetOriginNoSuffixInternal, r=qdot 2017-03-29 08:19:41 +02:00
Andrea Marchesini 8d7c2746ea Bug 1349512 - Move OriginAttributes class in separate files, r=qdot
--HG--
rename : caps/BasePrincipal.cpp => caps/OriginAttributes.cpp
rename : caps/BasePrincipal.h => caps/OriginAttributes.h
2017-03-22 18:45:40 +01:00
Andrea Marchesini 507c00cb9f Bug 1343933 - Renaming Principal classes - part 4 - ContentPrincipal, r=qdot
--HG--
rename : caps/nsPrincipal.cpp => caps/ContentPrincipal.cpp
rename : caps/nsPrincipal.h => caps/ContentPrincipal.h
2017-03-22 11:39:31 +01:00
Andrea Marchesini 1fd1bc3935 Bug 1343933 - Renaming Principal classes - part 2 - NullPrincipal, r=qdot
--HG--
rename : caps/nsNullPrincipal.cpp => caps/NullPrincipal.cpp
rename : caps/nsNullPrincipal.h => caps/NullPrincipal.h
rename : caps/nsNullPrincipalURI.cpp => caps/NullPrincipalURI.cpp
rename : caps/nsNullPrincipalURI.h => caps/NullPrincipalURI.h
2017-03-22 11:38:40 +01:00
Frederik Braun 390a075c26 Bug 1073952: inherit CSP into iframe sandbox srcdoc r=ckerschb,Tomcat
MozReview-Commit-ID: 3fhWCGwgG4A

--HG--
extra : rebase_source : 7e84fafe0ef69b7f6695de825fc254ee0e4209ba
2017-01-30 14:09:37 +01:00
Ehsan Akhgari 15bd78db3c Bug 1347369 - Avoid dynamic allocation of URLParams in OriginAttributes methods; r=baku
These show up in some profiles sometimes, and there is no reason why
the variables can't simply live on the stack.
2017-03-15 23:03:31 -04:00
Yoshi Huang 996e0349b3 Bug 1300671 - set firstPartyDomain on about: pages. r=smaug
When we load about:blank in a remote tab, it will have
LOAD_FLAGS_DISALLOW_INHERIT_PRINCIPAL flag set, which will make
NullPrinicipal as its document principal. So we add
NULL_PRINCIPAL_FIRST_PARTY_DOMAIN as its firstPartyDomain.

So when we load data:, or javascript: URI in a remote tab, it will inherit the
principal from about:blank, hence also inherit the origin attributes.

There are also some about: pages will use codebase principal, so we also
set ABOUT_URI_FIRST_PARTY_DOMAIN as firstPartyDomain on their
principals.
2017-03-14 16:22:02 +08:00
Andrea Marchesini e9195daa8d Bug 1345168 - Get rid of OriginAttributes::Inherit, r=tjr 2017-03-08 07:41:51 +01:00
Ehsan Akhgari 9b370e9857 Bug 1344974 - Part 2: Make the non-virtual helpers for principal equality/subsumption checks inline; r=bholley 2017-03-07 00:29:27 -05:00
Ehsan Akhgari 0f5f27679b Bug 1344974 - Part 1: Factor out more non-virtual helpers for principal equality/subsumption checks; r=bholley 2017-03-07 00:22:21 -05:00
Ehsan Akhgari e3ddbde083 Bug 1340710 - Part 10 - Remove BasePrincipal::EqualsIgnoringAddonId which somehow crept back in during the last rebase
Landed on a CLOSED TREE
2017-03-06 23:22:01 -05:00
Ehsan Akhgari 3812e3f854 Bug 1340710 - Part 9: Speed up the OriginAttributes comparison in BasePrincipal::Subsumes(); r=bholley 2017-03-06 22:31:05 -05:00
Ehsan Akhgari 513af88e99 Bug 1340710 - Part 8: Add a fast path for nsIPrincipal::EqualsConsideringDomain() and nsIPrincipal::SubsumesConsideringDomain(); r=bholley 2017-03-06 22:30:54 -05:00
Ehsan Akhgari e6073c48a5 Bug 1340710 - Part 7: Add a fast path for nsIPrincipal::Equals() and nsIPrincipal::EqualsConsideringDomain(); r=bholley 2017-03-06 22:27:59 -05:00
Ehsan Akhgari 3169d6c35c Bug 1340710 - Part 6: Store BasePrincipal::{mOriginNoSuffix,mOriginSuffix} as a pair of atoms; r=bholley
This has the nice side effect of making nsIPrincipal::GetOrigin() a bit faster
by avoiding computing the origin each time.
2017-03-06 22:27:53 -05:00
Ehsan Akhgari 8f6e8510f6 Bug 1340710 - Part 2: De-virtualize BasePrincipal::Kind(); r=bholley 2017-03-06 22:27:37 -05:00
Kris Maglione ee306e28c0 Bug 1314361 - Part 6: Remove the addonId origin attribute. r=bholley 2016-11-08 17:11:32 -08:00
Kris Maglione 7c5ab514b7 Bug 1314361 - Part 5: Remove origin attribute comparison helpers for ignoring addonId. r=bholley 2016-11-04 14:32:26 -07:00
Kris Maglione af57bdc417 Bug 1314361 - Part 2: Stop using addonId origin attribute for permission checks. r=billm 2016-11-04 15:16:50 -07:00
Kris Maglione 7f01119247 Bug 1314361 - Part 1: Generate nsIPrincipal.addonId from AddonPolicyService rather than origin attributes. r=billm 2016-11-05 22:38:17 -07:00
Olli Pettay f3a30cf48d Bug 1339213 - Inline IsRestrictOpenerAccessForFPI, r=tihuang 2017-02-14 13:45:35 +02:00
Shane Caraveo c7c7bd4f51 Bug 1308640 bypass TP when addon has explicit permission to url, r=bz,kmag,mrbkap
MozReview-Commit-ID: BIhoUY2Ug8k

--HG--
extra : rebase_source : 29cc48becfa958ba8f50d254fa6f30fd1820aef9
2017-02-09 21:08:06 -08:00
Tim Huang 4e31b183a6 Bug 1319773 - Part 2: Add a pref 'privacy.firstparty.isolate.restrict_opener_access' which controls the access of window.opener for different first party domain. r=baku
--HG--
extra : rebase_source : 052dfb3554ba050af85247bcf2587ade26710aac
2017-01-23 10:50:22 +08:00
Tim Huang 3e5d172c95 Bug 1319773 - Part 1: Add a SubsumesConsideringDomainIgnoringFPD in BasePrincipal. r=baku
--HG--
extra : rebase_source : db853a600e666cd11a140153536427c1f4e5882c
2017-01-18 20:17:19 +08:00
Andrea Marchesini 359ae91eac Bug 1328653 - Merging all the various *OriginAttributes to just one, r=huseby 2017-01-12 17:38:48 +01:00
Yoshi Huang 2b7e1dceb6 Bug 1324115 - Part 1: add a C++ helper in nsIPrincipal. r=smaug 2016-12-21 14:59:20 +08:00
Andrea Marchesini f7f5990527 Bug 1317927 - Media caching needs to use origin attributes, r=cpearce, r=jesup 2016-12-07 07:07:09 -10:00
Ehsan Akhgari 5cc591dc59 Bug 1318209 - Remove mozIApplication; r=baku 2016-11-17 10:12:43 -05:00
Andrea Marchesini d5b0cbe35a Bug 1315905 - Cleanup Necko http security check - part 1, r=valentin 2016-11-17 14:52:16 +01:00
Tim Huang 950b86072e Bug 1313627 - Get the firstPartyDomain from the nodePrincipal of the document in nsDocShell::CanAccessItem() if the first party isolation is on. r=smaug 2016-11-10 14:20:38 +08:00
Valentin Gosu 656872593e Bug 1315302 - Remove signedPkg from origin attributes r=baku
MozReview-Commit-ID: L1xvRgeO6De

--HG--
extra : rebase_source : dee943054af499b6e3f0aca2801fa9414f5567be
2016-11-06 16:15:36 +01:00
Kris Maglione 8b10d432c1 Bug 1308920: Part 1 - Add an EqualsIgnoringAddonId method to BasePrincipal. r=bholley
This is meant as a temporary stopgap until we can stop using origin attributes
to store add-on IDs.

MozReview-Commit-ID: DHstOTyu7pR

--HG--
extra : rebase_source : adb8fbfaadf6e914b5aa15c2693a35056669506c
2016-11-02 10:04:13 -07:00
Dave Huseby ce82855c42 Bug 1189086 - Eliminate nsIPrincipal::jarPrefix. r=dveditz 2016-10-24 13:52:00 +02:00
Jonathan Hao 8a70bfa5fc Bug 1302047 - Ignore userContextId and firstPartyDomain when matching permissions. r=baku
--HG--
extra : rebase_source : da81c21da92810d808ebe865a456cc9d04058ce3
2016-09-20 16:35:21 +08:00
Yoshi Huang 10b437080c Bug 1260931 - Part 3: Propagate firstPartyDomain. r=smaug 2016-09-06 10:25:58 +08:00
Yoshi Huang 85a594681d Bug 1260931 - Part 1: add firstPartyDomain. r=smaug
Add an origin attribute called 'firstPartyDomain'.
This value will be extracted from the URL bar.

And the purpose of this attribute is used to isolate the data-jars.
Please see the tor documentation.
https://www.torproject.org/projects/torbrowser/design/#identifier-linkability

The idea is like a superset of 'reject third party cookies', but not
only apply for cookies, it also applies to all data-jars like localStorage,
indexedDB and so on.

So basically an iframe will have its own data-jar, and this data-jar is
isolated by the URL from URL bar, for instance, an iframe
https://facebook.com inside https://cnn.com won't share data-jar with
the iframe (https://facebook.com) in https://bbc.com
2016-09-06 10:25:48 +08:00
Sebastian Hengst 60d03b201e Backed out changeset 935ffd53f193 (bug 1260931) for failing xpcshell test test_packaged_app_service.js. r=backout 2016-09-05 21:16:10 +02:00
Sebastian Hengst c9519f7c29 Backed out changeset b9afda2804fd (bug 1260931) 2016-09-05 21:15:29 +02:00
Yoshi Huang 6cca1d0c54 Bug 1260931 - Part 3: Propagate firstPartyDomain. r=smaug 2016-09-06 01:50:30 +08:00
Yoshi Huang 6c3b62e2fb Bug 1260931 - Part 1: add firstPartyDomain. r=smaug
Add an origin attribute called 'firstPartyDomain'.
This value will be extracted from the URL bar.

And the purpose of this attribute is used to isolate the data-jars.
Please see the tor documentation.
https://www.torproject.org/projects/torbrowser/design/#identifier-linkability

The idea is like a superset of 'reject third party cookies', but not
only apply for cookies, it also applies to all data-jars like localStorage,
indexedDB and so on.

So basically an iframe will have its own data-jar, and this data-jar is
isolated by the URL from URL bar, for instance, an iframe
https://facebook.com inside https://cnn.com won't share data-jar with
the iframe (https://facebook.com) in https://bbc.com
2016-09-06 01:50:15 +08:00
Yoshi Huang 69ed1a79e4 Bug 1244340 - Part 2: add setOriginAttributes in nsIXMLHttpRequest. r=sicking
Add a ChromeOnly method called 'setOriginAttributes' on the XMLHttpRequest,
so that we can override the origin attributes for those XHRs running by XUL
(which will use System Principal).
2016-08-26 18:59:00 +08:00
Rob Wu 9069fff35f Bug 1197451 - Add clipboardWrite permission r=billm
MozReview-Commit-ID: 6d1mQSVWRPe

--HG--
extra : rebase_source : 2f19bab5c9d6db25c60b2b19c06c7027384a04ca
2016-07-08 17:19:17 -07:00
James Andreou 3585e16752 Bug 1283281 - Remove PB Flag from DOMStorage. r=jdm 2016-06-29 14:01:00 +02:00
James Andreou 1d32e86b9c Bug 1269361 - Add mPrivateBrowsingId to OriginAttributes r=ehsan,jdm 2016-06-02 17:03:11 -04:00
Chris Peterson e343bcae34 Bug 1274415 - Fix -Wshadow warnings in caps/ directory. r=dveditz
caps/BasePrincipal.cpp:562:28 [-Wshadow] declaration shadows a local variable
caps/nsScriptSecurityManager.cpp:675:18 [-Wshadow] declaration shadows a local variable
caps/nsScriptSecurityManager.cpp:854:14 [-Wshadow] declaration shadows a local variable
2016-05-19 01:04:46 -07:00
Yoshi Huang ba1bb72568 Bug 1263496 - Part 3: fix for nsNullPrincipal::Create
This fixed the locations listed by
http://searchfox.org/mozilla-central/search?q=nsNullPrincipal::Create(&redirect=true
that needs to inherit origin attributes.
2016-04-27 18:38:07 +08:00
Kris Maglione 6d36833e42 Bug 1254194: Apply a content security policy to all WebExtension documents. r=gabor
MozReview-Commit-ID: HsFFbWdq00b

--HG--
extra : rebase_source : 07e4b6ec8c32f696d5b5987091ffc5ebde2c3061
extra : histedit_source : 20983fe6a9590d7f410276fac248c3d2f711caaa
2016-04-23 20:56:56 -07:00
J. Ryan Stinnett 2a55d065b7 Bug 1238160 - Rename OriginAttributes.mInBrowser and associated methods. r=bz,mayhemer
This change renames OriginAttributes.mInBrowser to mInIsolatedMozBrowser and
nsIPrincipal::GetIsInBrowserElement to GetIsInIsolatedMozBrowserElement.  Other
methods that pass these values around also have name changes.

Tokens such as "inBrowser" have previously been serialized into cache keys, used
as DB column names, stored in app registries, etc.  No changes are made to any
serialization formats.  Only runtime method and variable names are updated.

No behavior changes are made in this patch, so some renamed methods may have
nonsensical implementations.  These are corrected in subsequent patches
focused on behavior.

MozReview-Commit-ID: 66HfMlsXFLs
2016-03-02 10:35:56 -06:00
Yoshi Huang be5bd39145 Bug 1240651 - Annotate addonId into crash report (r=bholley) 2016-02-01 16:05:53 -08:00
Christoph Kerschbaumer fecee7be59 Bug 1224694 - Unify and clean up initialization of CSP (r=sicking) 2016-01-14 13:21:31 -08:00
Nigel Babu ccbf22eae8 Backed out changeset f001a01c85d7 (bug 1224694) for browser-chrome bustage on a CLOSED TREE
--HG--
extra : commitid : 5BUjoFsY8bv
2016-01-14 08:04:50 +05:30
Christoph Kerschbaumer 86457169b6 Bug 1224694 - Unify and clean up initialization of CSP (r=sicking) 2016-01-13 15:51:30 -08:00
Honza Bambas a0a6f7e23c Bug 1165214 - Use OriginAttributes in DOM Storage. r=smaug, r=bholley
--HG--
extra : rebase_source : b63ddb5a24a335f771a856cd20c69cdeb0c92ca0
2016-01-05 07:25:00 -05:00
Yoshi Huang 4b500464f5 Bug 1209162 - Create OriginAttributes subtypes. IGNORE IDL r=sicking. 2015-11-03 09:50:54 +08:00
Christoph Kerschbaumer b967444f19 Bug 663570 - MetaCSP Part 2: Principal changes (r=bz) 2015-11-14 19:28:23 -08:00
Bobby Holley 86c97bb3f4 Bug 1218039 - Add a nice interface for both C++ and JS to access the principal kind. r=gabor 2015-10-26 11:18:14 -07:00
Nathan Froyd 01583602a9 Bug 1207245 - part 6 - rename nsRefPtr<T> to RefPtr<T>; r=ehsan; a=Tomcat
The bulk of this commit was generated with a script, executed at the top
level of a typical source code checkout.  The only non-machine-generated
part was modifying MFBT's moz.build to reflect the new naming.

CLOSED TREE makes big refactorings like this a piece of cake.

 # The main substitution.
find . -name '*.cpp' -o -name '*.cc' -o -name '*.h' -o -name '*.mm' -o -name '*.idl'| \
    xargs perl -p -i -e '
 s/nsRefPtr\.h/RefPtr\.h/g; # handle includes
 s/nsRefPtr ?</RefPtr</g;   # handle declarations and variables
'

 # Handle a special friend declaration in gfx/layers/AtomicRefCountedWithFinalize.h.
perl -p -i -e 's/::nsRefPtr;/::RefPtr;/' gfx/layers/AtomicRefCountedWithFinalize.h

 # Handle nsRefPtr.h itself, a couple places that define constructors
 # from nsRefPtr, and code generators specially.  We do this here, rather
 # than indiscriminantly s/nsRefPtr/RefPtr/, because that would rename
 # things like nsRefPtrHashtable.
perl -p -i -e 's/nsRefPtr/RefPtr/g' \
     mfbt/nsRefPtr.h \
     xpcom/glue/nsCOMPtr.h \
     xpcom/base/OwningNonNull.h \
     ipc/ipdl/ipdl/lower.py \
     ipc/ipdl/ipdl/builtin.py \
     dom/bindings/Codegen.py \
     python/lldbutils/lldbutils/utils.py

 # In our indiscriminate substitution above, we renamed
 # nsRefPtrGetterAddRefs, the class behind getter_AddRefs.  Fix that up.
find . -name '*.cpp' -o -name '*.h' -o -name '*.idl' | \
    xargs perl -p -i -e 's/nsRefPtrGetterAddRefs/RefPtrGetterAddRefs/g'

if [ -d .git ]; then
    git mv mfbt/nsRefPtr.h mfbt/RefPtr.h
else
    hg mv mfbt/nsRefPtr.h mfbt/RefPtr.h
fi

--HG--
rename : mfbt/nsRefPtr.h => mfbt/RefPtr.h
2015-10-18 01:24:48 -04:00
Yoshi Huang 02f27f9218 Bug 1211636 - use ToInteger64 in PopulateFromSuffix. r=bholley
From 76c9c3f887d6bce8b15abd37d5921887a187e18d Mon Sep 17 00:00:00 2001
---
 caps/BasePrincipal.cpp                    | 16 ++++++-------
 caps/moz.build                            |  3 +++
 caps/tests/gtest/TestOriginAttributes.cpp | 37 +++++++++++++++++++++++++++++++
 caps/tests/gtest/moz.build                | 13 +++++++++++
 4 files changed, 61 insertions(+), 8 deletions(-)
 create mode 100644 caps/tests/gtest/TestOriginAttributes.cpp
 create mode 100644 caps/tests/gtest/moz.build
2015-10-06 15:36:10 +08:00
Bobby Holley 75a560dba5 Bug 1208756 - Introduce URI_FETCHABLE_BY_ANYONE and use it for moz-extension. r=bz
This matches the behavior described in
https://developer.chrome.com/extensions/manifest/web_accessible_resources
2015-10-02 15:02:07 -07:00
Bobby Holley dca7589731 Bug 1208756 - Hoist shared CheckMayLoad logic into BasePrincipal. r=bz
This is a pure refactoring.
2015-10-02 14:59:45 -07:00
Yoshi Huang f97211a451 Bug 1167100 - User originAttribute in ContentPrincipalInfo. r=bholley 2015-09-23 18:19:06 +08:00
Bobby Holley ca4a8095de Bug 1209843 - Stop checking for UNKNOWN_APP_ID in all places except those where AppId() is explicitly queried. r=sicking 2015-09-30 16:29:36 -07:00
Stephanie Ouillon 5e14a3b3a8 Bug 1178533 - Add nsIInstallPackagedWebapp for registering permissions when navigating to signed packages r=bholley,fabrice,valentin 2015-08-26 13:12:13 +02:00