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

1768 Коммитов

Автор SHA1 Сообщение Дата
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
Eric Rahm a33f11e0f5 Bug 1391803 - Use nsStringFwd.h for forward declaring string classes. r=froydnj
We should not be declaring forward declarations for nsString classes directly,
instead we should use nsStringFwd.h. This will make changing the underlying
types easier.

--HG--
extra : rebase_source : b2c7554e8632f078167ff2f609392e63a136c299
2017-08-16 16:48:52 -07:00
Shane Caraveo 4437e84fb7 Bug 1391720 remove _blank support for background pages, r=kmag
MozReview-Commit-ID: aRpNSrE483

--HG--
extra : rebase_source : f6a037937350ee7d8f502a9060459a073bd60190
2017-08-18 11:30:01 -07:00
Kris Maglione 7788abbf4f Bug 1356334: Part 4 - Add a helper to synchronously get an extension's name from its ID. r=billm
MozReview-Commit-ID: 8nuvM4PR7XR

--HG--
extra : source : b2a663ffd1446f9f70b220866855a0ecb3503761
extra : histedit_source : 16847e7aececf6c944bbb6b21639629c60bcdc93
2017-08-11 21:22:18 -07:00
Kris Maglione 5e014eb540 Bug 1356334: Part 1 - Add helpers for safely casting principals without COM overhead. r=bholley
MozReview-Commit-ID: EOtK17WiLZl

--HG--
extra : source : 7c880eca810ac03509cc3102bd421b5f386e82cb
2017-04-16 13:32:42 -07:00
Ryan VanderMeulen 3fe1f45009 Backed out 8 changesets (bug 1356334) for frequent test_ext_contentscript_async_loading.html failures on Android debug on a CLOSED TREE.
Backed out changeset 9c677ebfdda0 (bug 1356334)
Backed out changeset 16b49fd1c38a (bug 1356334)
Backed out changeset 4f5bcd2b2dc6 (bug 1356334)
Backed out changeset d832803270ac (bug 1356334)
Backed out changeset b83aea215a82 (bug 1356334)
Backed out changeset b2a663ffd144 (bug 1356334)
Backed out changeset 805c56806930 (bug 1356334)
Backed out changeset 7c880eca810a (bug 1356334)
2017-08-18 11:32:18 -04:00
Nicholas Nethercote dc5e4a62cf Bug 1386103 (part 2, attempt 3) - Convert nsFixed[C]String uses to nsAuto[C]String. r=erahm. 2017-08-09 20:41:40 +10:00
Kris Maglione 03b92c5149 Bug 1356334: Part 4 - Add a helper to synchronously get an extension's name from its ID. r=billm
MozReview-Commit-ID: 8nuvM4PR7XR

--HG--
extra : rebase_source : fecadb38ca64afeb83f1b7b999295586e9c55944
2017-08-11 21:22:18 -07:00
Kris Maglione c22f3ee673 Bug 1356334: Part 1 - Add helpers for safely casting principals without COM overhead. r=bholley
MozReview-Commit-ID: EOtK17WiLZl

--HG--
extra : rebase_source : ac4a18a377d513d276df24f7e9e25903bc437084
2017-04-16 13:32:42 -07:00
Masatoshi Kimura 32e5d77ba4 Bug 1387805 - Remove [deprecated] nsIScriptSecurityManager.getCodebasePrincipal(). r=bz
MozReview-Commit-ID: CY47PBaQ5oy

--HG--
extra : rebase_source : 6a82bae0d3caafadc772a08a1d392ab30c4ad914
2017-08-06 15:31:31 +09:00
Thomas Wisniewski c20797f0fa Bug 1261289 - Allow webextensions to open view-source links. r=mixedpuppy, r=smaug
MozReview-Commit-ID: A8TGE448vBs
2017-06-20 15:23:49 -04:00
Valentin Gosu 7520c99a2c Bug 1380617 - Add nsIURI.displayPrePath r=mcmanus,Gijs
- Use displayPrePath in the pageInfo permissions that shows "Permissions for:"
- The extra displayPrePath method is necessary because it's difficult to compute it manually, as opposed to not having a displaySpecWithoutRef - as it's easy to get that by truncating displaySpec at the first '#' symbol.

MozReview-Commit-ID: 9RM5kQ2OqfC
2017-08-09 17:43:58 +02:00
Phil Ringnalda 858a553b02 Backed out 2 changesets (bug 1386103) for Android x86 build bustage
Backed out changeset eec506d87d03 (bug 1386103)
Backed out changeset 3f9ec011c9bd (bug 1386103)

MozReview-Commit-ID: 8ak71R7vUOC
2017-08-08 22:08:54 -07:00
Nicholas Nethercote 7512aa2dea Bug 1386103 (part 2) - Convert nsFixed[C]String uses to nsAuto[C]String. r=erahm.
In all of these cases the fixed buffer has the same lifetime as the string
object, so we can use nsAuto[C]String for simplicity.

For the 128-length ones in dom/xul/ I just switched to the default of 64 for
simplicity, because the choice of 128 didn't seem that important. (These code
paths weren't hit when I started the browser and opened a few sites.)

Finally, the patch also changes LoggingIdString to use
nsAutoCStringN<NSID_LENGTH>, similar to NullPrincipalURI.
2017-08-01 11:58:56 +10:00
Nicholas Nethercote f941156987 Bug 1386600 - Change nsIStringBundle methods to return |AString| instead of |wstring|. r=emk,sr=dbaron.
This removes about 2/3 of the occurrences of nsXPIDLString in the tree. The
places where nsXPIDLStrings are null-checked are replaced with |rv| checks.

The patch also removes a couple of unused declarations from
nsIStringBundle.idl.

Note that nsStringBundle::GetStringFromNameHelper() was merged into
GetStringFromName(), because they both would have had the same signature.

--HG--
extra : rebase_source : ac40bc31c2a4997f2db0bd5069cc008757a2df6d
2017-08-04 14:40:52 +10:00
Masatoshi Kimura 8b713b2b0f Bug 1375125 - Stop using nsILocalFile in the tree. r=froydnj
This mechanically replaces nsILocalFile with nsIFile in
*.js, *.jsm, *.sjs, *.html, *.xul, *.xml, and *.py.

MozReview-Commit-ID: 4ecl3RZhOwC

--HG--
extra : rebase_source : 412880ea27766118c38498d021331a3df6bccc70
2017-08-04 17:49:22 +09:00
Christoph Kerschbaumer 256e249566 Bug 1381761 - Treating 'data:' documents as unique, opaque origins should still inherit the CSP. r=smaug,dveditz 2017-08-04 14:11:17 +02:00
Masatoshi Kimura 8ed4a80a4e Bug 1322874 - Get rid of nsIURI.originCharset. r=valentin.gosu
nsIURI.originCharset had two use cases:
 1) Dealing with the spec-incompliant feature of escapes in the hash
    (reference) part of the URL.
 2) For UI display of non-UTF-8 URLs.

For hash part handling, we use the document charset instead. For pretty
display of query strings on legacy-encoded pages, we no longer care to them
(see bug 817374 comment 18).

Also, the URL Standard has no concept of "origin charset". This patch
removes nsIURI.originCharset for reducing complexity and spec compliance.

MozReview-Commit-ID: 3tHd0VCWSqF

--HG--
extra : rebase_source : b2caa01f75e5dd26078a7679fd7caa319a65af14
2017-08-02 20:43:30 +09:00
Masatoshi Kimura f143125cc2 Bug 1326520 - Rename nsIURI.path to pathQueryRef. r=valentin.gosu
MozReview-Commit-ID: DqJdTGopR9G

--HG--
extra : rebase_source : e8c9eb03468c075b79013b6e0bd8b367229c24cd
2017-07-29 20:50:21 +09:00
Rajesh Kathiriya 48e6bc2124 Bug 1374620 - Enabled the ESLint dot-notation rule across mozilla-central r=standard8
MozReview-Commit-ID: FadrI2li43G

--HG--
extra : rebase_source : b455e846ab79c8141150517e67e542e3e06d630e
2017-07-25 23:45:41 +05:30
Nicholas Nethercote 72c884bf74 Bug 1384835 (part 3, attempt 2) - Remove the Preferences::Get*CString() variants that return nsAdoptingCString. r=froydnj.
--HG--
extra : rebase_source : d317b25be2ec21d1a60d25da3689e46cdce0b649
2017-07-31 14:28:48 +10:00
Nicholas Nethercote d4f9aa5530 Bug 1384835 (part 2, attempt 2) - Remove the Preferences::Get*String() variants that return nsAdoptingString. r=froydnj.
--HG--
extra : rebase_source : 6c24fbacb03d4adebe5f22b5e7fc60b069913f20
2017-07-31 14:23:50 +10:00
Bob Owen 9fe7a4201d Bug 1378377 Part 1: Expose file:// URI whitelist check to chrome JS. r=bz
This is required so that we can check the whitelist and run domains that are
allowed to use file:// URIs in the file content process.
2017-07-19 09:37:25 +01: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
Valentin Gosu f957fd9eef Bug 945240 - Make nsIURI.host & variants return ASCII strings r=mcmanus
* nsStandardURL::GetHost/GetHostPort/GetSpec contain an punycode encoded hostname.
* Added nsIURI::GetDisplayHost/GetDisplayHostPort/GetDisplaySpec which have unicode hostnames, depending on the hostname, character blacklist and the network.IDN_show_punycode pref
* remove mHostEncoding since it's not needed anymore (the hostname is always ASCII encoded)
* Add mCheckedIfHostA to know when GetDisplayHost can return the regular host, or when we need to use the cached mDisplayHost

MozReview-Commit-ID: 4qV9Ynhr2Jl
* * *
Bug 945240 - Make sure nsIURI.specIgnoringRef/.getSensitiveInfoHiddenSpec/.prePath contain unicode hosts when network.standard-url.punycode-host is set to false r=mcmanus

MozReview-Commit-ID: F6bZuHOWEsj

--HG--
extra : rebase_source : d8ae8bf774eb22b549370ca96565bafc930faf51
2017-07-11 19:09:10 +02:00
Haik Aftandilian 676e702f00 Bug 1334550 - Part 2 - Add nsISubstitutionObserver and update test_extensionURL.html; r=jimm
Adds nsISubstitutionObserver so that substitutions set on a
parent nsISubstitutingProtocolHandler which are then propagated
to child processes can be observed in the child.

Updates test_extensionURL.html to set substitutions on the parent
ExtensionProtocolHandler before trying to load moz-extension URI's
using those substitutions.

MozReview-Commit-ID: JaW1A3uZpoO

--HG--
extra : rebase_source : b908a3ef51c2b077809614fd39595c3255dff7ad
2017-06-21 16:13:23 -07:00
Florian Quèze 2924991bf6 Bug 1368456 - remove Promise.jsm imports in tests, r=mconley. 2017-06-23 11:25:52 +02:00
Kris Maglione 5a4378940a Bug 1375654: Package file_data.txt for chrome mochitests. r=mccr8
MozReview-Commit-ID: 9W8o69z5WUJ

--HG--
extra : rebase_source : a815c5c147f4a70905a87f27b436fc169daa4e1e
extra : amend_source : 3977a27ea9a68312e5d8a648aaeec4d843ff367f
2017-06-22 14:57:52 -07:00
Florian Quèze 5b8f8b884c Bug 1374282 - script generated patch to remove Promise.defer calls, r=Mossop. 2017-06-22 12:51:42 +02:00
Florian Quèze 66f6d259bc Bug 1374282 - script generated patch to remove Task.jsm calls, r=Mossop. 2017-06-22 12:51:42 +02:00
Honza Bambas 9e38f7b8fc Bug 1319111 - Expose 'result principal URI' on LoadInfo as a source for NS_GetFinalChannelURI (removes some use of LOAD_REPLACE flag). r=bz, r=mikedeboer
--HG--
extra : rebase_source : c9690f4b8decd39a10da676bd50ec09cb2ad8892
2017-05-30 18:07:59 +02:00
Peter Van der Beken 9b9495bf79 Bug 1252211 - Remove DOMCI for TreeSelection, XULCommandDispatcher and XULControllers. r=bz.
--HG--
extra : rebase_source : 5a24af4928dbd7754850c6e3ceff6646bfe58c93
2017-05-18 09:07:25 +02:00
Carsten "Tomcat" Book 4a5a3d9f30 Backed out changeset 2c51cdd42834 (bug 1252211) for bustage 2017-06-13 12:20:33 +02:00
Peter Van der Beken 9d549d2f23 Bug 1252211 - Remove DOMCI for TreeSelection, XULCommandDispatcher and XULControllers. r=bz.
--HG--
extra : rebase_source : db24985f7e8f6d4ca4df13015d565ec0063ba355
extra : source : f361697cb50b47dc4db94a6730b6604ab69217f5
2017-05-18 09:07:25 +02:00
Kris Maglione e51750a9c4 Bug 1322235: Part 6 - Replace AddonPolicyService with a stub implementation in ExtensionPolicyService. r=mixedpuppy,zombie
This replaces the JS policy service stubs with a pure C++ version which
directly makes policy decisions based on active WebExtensionPolicy objects.

This is the first step in a larger refactoring, which will remove the
ExtensionManagement module entirely, and replace the current add-on policy
service with direct, non-virtual access to native WebExtensionPolicy objects.

It will also be followed by related changes to migrate the content script and
extension page matching to native code, based on the existing MatchPattern and
WebExtensionPolicy bindings.

MozReview-Commit-ID: 2MpbmXZGiPZ

--HG--
extra : rebase_source : 8b268618164b45605143e858665e592de829a6fa
2017-06-03 17:12:14 -07:00
Andrea Marchesini e7eda19b3d Bug 1369323 - Get rid of nsScriptSecurityManager::GetNoAppCodebasePrincipal, r=bholley 2017-06-02 11:05:28 +02:00
Andrea Marchesini 9eee06711a Bug 1369314 - Fixing comments related to appId in nsIScriptSecurityManager, r=bholley 2017-06-02 11:05:28 +02:00