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

2846 Коммитов

Автор SHA1 Сообщение Дата
Dorel Luca ba31c8c2b2 Backed out 3 changesets (bug 1389251) for browser-chrome failure on browser/base/content/test/pageinfo/browser_pageinfo_image_info.js. CLOSED TREE
Backed out changeset a76a3251a9d2 (bug 1389251)
Backed out changeset c6baebf7b34c (bug 1389251)
Backed out changeset 6e89a11ae28e (bug 1389251)
2018-06-15 06:18:04 +03:00
Valentin Gosu 316f7bf9ac Bug 1389251 - Add esc_Spaces that may be used to force escaping of spaces r=bz,jdescottes
MozReview-Commit-ID: 7VgNlkWqrPK

--HG--
extra : rebase_source : c7ea99bc727a82e652871e78c222e8d5d642a52e
2018-06-12 03:05:03 +02:00
Valentin Gosu 01487f76fb Bug 1389251 - Do not escape spaces in nsSimpleURI r=bz
This change makes nsEscape::T_EscapeURL not escape spaces when passed esc_OnlyNonASCII.
This fixes a web-compat issue for URLs such as "javascript: alert('hello');" and the fact that data: URIs with spaces around MIME type are rejected.

MozReview-Commit-ID: B78AacLxGBp

--HG--
extra : rebase_source : fcef25fab58f7da1732725054ae684588f2e0e89
2018-06-12 03:03:57 +02:00
Andrea Marchesini c60afa7b18 Bug 1466314 - StreamBlobImpl should wrap the cloned stream with InputStreamLengthWrapper if needed, r=smaug 2018-06-13 08:37:26 -07:00
Honza Bambas 4bec70d83f Bug 1468071. r=valentin 2018-06-12 10:50:39 -04:00
Honza Bambas eef37ac56e Bug 1413868. r=valentin 2018-06-07 13:56:16 -04:00
Andrea Marchesini 1590c0bec2 Bug 1466101 - Fix a debug-only variable use in InputStreamLengthHelper, r=mayhemer 2018-06-05 23:19:00 +02:00
Csoregi Natalia 2f779be8d9 Merge mozilla-central to autoland. a=merge CLOSED TREE 2018-06-02 01:03:45 +03: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
Andrea Marchesini 77e2dca204 Bug 1460561 - nsMultiplexInputStream should behave correctly when NS_InputStreamIsBuffered() is used, r=michal, r=froydnj 2018-05-24 07:51:53 +02:00
Andrea Marchesini 1bfb8a0e93 Bug 1464090 - Assertion in InputStreamLengthHelper::GetAsyncLength to avoid dealing with nsIAsyncInputStream, r=mayhemer 2018-05-31 18:12:26 +02:00
Andrea Marchesini f6ec0a57a4 Bug 1464090 - InputStreamLengthHelper must swap the callback in order to release them on the owning thread, r=mayhemer 2018-05-31 18:12:25 +02:00
Andrea Marchesini 4a5b123402 Bug 1464090 - Implement InputStreamLengthWrapper to make any stream nsIInputStreamLength and nsIAsyncInputStreamLength, r=froydnj 2018-05-31 18:12:25 +02:00
Josh Aas cedb6a19de Bug 1457941: Add a number of result checks to nsLocalFileWin, avoid use of uninitialized values. r=froydnj 2018-05-30 19:04:00 +03:00
Markus Stange 423ce68542 Bug 1462784 - Relabel various other stuff as being OTHER. r=njn
Any more specific work that is happening in these methods will have its own
specific category labeling in that specific code. The instances touched in this
patch are more on the outside and don't really know what kind of code is going
to be running inside.

MozReview-Commit-ID: 47NO1DZzkdH

--HG--
extra : rebase_source : 344c380ddaaf42a1fd820a26b762c61ee9e2d524
2018-05-18 17:58:43 -04:00
Csoregi Natalia fc2ed6e92a Backed out 18 changesets (bug 1462784) for ESlint failure on FlameGraph.js:1297. CLOSED TREE
Backed out changeset 79556798ff9f (bug 1462784)
Backed out changeset 88321efb673b (bug 1462784)
Backed out changeset 7880f9dc7023 (bug 1462784)
Backed out changeset 71fe35fd1f7e (bug 1462784)
Backed out changeset a543b94b049a (bug 1462784)
Backed out changeset d1ca8b0f2221 (bug 1462784)
Backed out changeset 68eabfbf3c16 (bug 1462784)
Backed out changeset 34e71c789903 (bug 1462784)
Backed out changeset 6fe79d1ca1bd (bug 1462784)
Backed out changeset e5ad2e525ea9 (bug 1462784)
Backed out changeset 329645ff1e23 (bug 1462784)
Backed out changeset e09c38853172 (bug 1462784)
Backed out changeset 0663d1a6d2da (bug 1462784)
Backed out changeset 106967fc29d2 (bug 1462784)
Backed out changeset 99b4a433a8e5 (bug 1462784)
Backed out changeset 1d38a4cf5a4a (bug 1462784)
Backed out changeset 692017229de6 (bug 1462784)
Backed out changeset c2911a626671 (bug 1462784)
2018-06-01 23:42:00 +03:00
Markus Stange 3f54b9a3dd Bug 1462784 - Relabel various other stuff as being OTHER. r=njn
Any more specific work that is happening in these methods will have its own
specific category labeling in that specific code. The instances touched in this
patch are more on the outside and don't really know what kind of code is going
to be running inside.

MozReview-Commit-ID: 47NO1DZzkdH

--HG--
extra : rebase_source : f807c14bf6a592e0c651e15b63d1e7d63e4b0159
2018-05-18 17:58:43 -04:00
Andrea Marchesini 7dcc1b6880 Bug 1434553 - Implement nsIInputStreamLength and nsIAsyncInputStreamLength - part 9 - necko and docShell, r=mayhemer, r=smaug 2018-05-23 07:12:36 +02:00
Andrea Marchesini 767ed01fe0 Bug 1434553 - Implement nsIInputStreamLength and nsIAsyncInputStreamLength - part 7 - nsIMultiplexInputStream exposes nsIInputStreamLength, r=froydnj, r=mayhemer 2018-05-23 07:12:35 +02:00
Andrea Marchesini cb2d1c2cfe Bug 1434553 - Implement nsIInputStreamLength and nsIAsyncInputStreamLength - part 4 - SlicedInputStream exposes nsIInputStreamLength, r=froydnj 2018-05-23 07:12:35 +02:00
Andrea Marchesini 1b19a3a663 Bug 1434553 - Implement nsIInputStreamLength and nsIAsyncInputStreamLength - part 3 - InputStreamLengthHelper, r=froydnj 2018-05-23 07:12:35 +02:00
Andrea Marchesini 86aef1bfc6 Bug 1434553 - Implement nsIInputStreamLength and nsIAsyncInputStreamLength - part 1 - IDL, r=mayhemer, r=froydnj, r=smaug 2018-05-23 07:12:34 +02:00
Kris Maglione 6b12d08f7d Bug 1462937: Update callers to use nsIFile::GetDirectoryEntries as a nsIDirectoryEnumerator. r=froydnj
MozReview-Commit-ID: Iv4T1MVAF5

--HG--
extra : rebase_source : 1c518883d082884db7f9323a5acc20361228c26b
extra : histedit_source : 70a73c23d1199d3bfbb5379c78930401166c094b
2018-05-19 20:17:45 -07:00
Kris Maglione 5ad7ba0bf1 Bug 1462483: Part 1 - Explicitly return a nsIDirectoryEnumerator from nsIFile::GetDirectoryEntries. r=froydnj
All of our GetDirectoryEntries implementations return a
nsIDirectoryEnumerator, and a lot of relies on this, and explicitly QIs to it.
That gets a bit ugly, and in JS code, a bit expensive. We should just return a
directory enumerator directly if that's part of the API contract.

MozReview-Commit-ID: IUeEB1Ih1Wu

--HG--
extra : rebase_source : 6fffb2d4b0f83db1fd270423a195379acef0dfe4
2018-05-17 15:06:48 -07:00
Marco Bonardo c67bc6cc9a Bug 1430023 - Get rid of some remaining localstore.rdf code. r=mossop
MozReview-Commit-ID: LqqSsb2h1Yv

--HG--
extra : rebase_source : 1a89abfbe75e17ed4be3a9fa52eef2d1db9f99bd
2018-05-09 10:49:35 +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
Michael Kaply c2f87a5b92 Bug 1418953 - Remove NS_APP_USER_SEARCH_DIR. r=florian
MozReview-Commit-ID: DYzdJtz5aEH

--HG--
extra : rebase_source : 4dc75dfb011a174b7baf50e6f7faa720d88e4723
2018-04-24 15:19:47 -05:00
Kris Maglione 33ff77dabf Bug 1363925: Part 3 - Move more install logic from XPIProvider to XPIInstall. r=aswan
MozReview-Commit-ID: 87PXV43Lpn9

--HG--
extra : rebase_source : dfc38cfb001455243449d7fe0da7f9294e88c8c2
extra : histedit_source : 6e561d0601dcca8da34c926b72e65a126bd40572
2018-04-21 18:29:33 -07:00
Nathan Froyd 2d58b9d7fb Bug 1455178 - avoid static constructors for atom initialization; r=njn
For reasons unknown, if you give MSVC:

// Foo.h
struct Foo
{
  ...
};

extern const Foo gFoo;

// Foo.cpp, which necessarily includes Foo.h.
extern constexpr Foo gFoo = {
};

MSVC will create a static initializer for gFoo and place it in the
read/write data section, rather than the read-only data section.
Removing the `extern const` declaration seems to be enough to make this
problem go away.  We need to adjust the declaration of other variables
to compensate for the non-visibility of gFoo in the header file.
2018-04-22 16:53:22 -04:00
Andrea Marchesini 2bbc9938e9 Bug 1453955 - Synchronize access to various stream classes' async wait callback reference - SlicedInputStream, r=mayhemer 2018-04-13 16:40:20 +02:00
Sebastian Hengst 0819f35e51 Backed out 4 changesets (bug 525063) on request from Andi. a=backout
Backed out changeset 516c4fb1e4b8 (bug 525063)
Backed out changeset 6ff8aaef2866 (bug 525063)
Backed out changeset bf13e4103150 (bug 525063)
Backed out changeset d7d2f08e051c (bug 525063)
2018-04-13 16:01:28 +03:00
Tristan Bourvon a3a77c0312 Bug 525063 - Initialize uninitialized class attributes in m-c. r=ehsan 2018-04-10 21:11:02 +02:00
Nathan Froyd 7bb7ffd8c9 Bug 1453134 - part 1 - add a string input stream constructor that accepts move references; r=baku
This method is more efficient when we know we're not going to need the
string afterwards, and should cut down on intermediate allocations.
2018-04-11 10:06:17 -04:00
Andrea Marchesini ff755dfc70 Bug 1451731 - Synchronize access to various stream classes' async wait callback reference - part 3 - SlicedInputStream, r=mayhemer 2018-04-10 17:33:08 +02:00
Nicholas Nethercote 9ea93c4f7b Bug 1449395 - Remove nsStaticAtomSetup. r=froydnj
Each nsStaticAtomSetup contains a pointer to a static atom, and also a pointer
to the canonical pointer to that static atom. Which is pretty weird! The
notable thing thing about it is that these structs are in an array, and that
gives us the only way to iterate over all static atoms in a single class, for
registration and lookups.

But thanks to various other recent changes to the implementation of static
atoms, we can now put the static atoms themselves into an array, which can be
iterated over. So this patch does that. With that done, nsStaticAtomSetup is no
longer necessary.

According to the `size` utility, on Linux64 this reduces the size of libxul.so
by the following amounts:

> text:  62008 bytes
> data:  20992 bytes
> bss:   21040 bytes
> total: 104040 bytes

- The bss reduction is one word per atom, because the canonical static atom
  pointers (e.g. nsGkAtoms::foo) have moved from .bss to .data, because they're
  now initialized at compile time instead of runtime.

- The data reduction is one word per atom, because we remove two words per atom
  for the nsStaticAtomSetup removal, but gain one word per atom from the
  previous bullet point.

- I'm not sure about the text reduction. It's three words per atom. Maybe
  because there is one less relocation per atom?

Other notable things in the patch:

- nsICSSAnonBoxPseudo and nsICSSPseudoElement now inherit from nsStaticAtom,
  not nsAtom, because that's more precise.

- Each static atoms array now has an enum associated with it, which is used in
  various ways.

- In the big comment about the macros at the top of nsStaticAtom.h, the pre-
  and post-expansion forms are now shown interleaved. The interleaving reduces
  duplication and makes the comment much easier to read and maintain. The
  comment also has an introduction that explains the constraints and goals of
  the implementation.

- The SUBCLASS macro variations are gone. There are few enough users of these
  macros now that always passing the atom type has become simpler.

MozReview-Commit-ID: 1GmfKidLjaU

--HG--
extra : rebase_source : 2352590101fc6693ba388f885ca4714a42963943
2018-03-29 11:48:18 +11:00
Nicholas Nethercote 4b941e22d0 Bug 1449395 - Remove unnecessary nsStaticAtom.h includes. r=froydnj
For nsCSSAnonBoxes.cpp, nsCSSPseudoElements.cpp, nsDirectoryService.cpp, the
corresponding .h file includes nsStaticAtom.h. For the other files in this
patch, nsStaticAtom.h is not needed at all.

MozReview-Commit-ID: IpMmbXwZHhu

--HG--
extra : rebase_source : 46d0a6b40a41ee233adad7c205cf907fa27de34a
2018-03-29 09:08:54 +11:00
Nicholas Nethercote 89d3ee0001 Bug 1449491 - Remove the "Strt" and "CmStrt" directories. r=froydnj
On Windows there are some duplicate keys in nsDirectoryService:

- NS_WIN_STARTUP_DIR is "Strt", and maps to Win_Startup.
- NS_WIN_STARTMENU_DIR is also "Strt", and is meant to map to Win_Startmenu,
  but actually maps to Win_Startup because of the key duplication.

- NS_WIN_COMMON_STARTMENU_DIR is "CmStrt", and maps to Win_Common_Startmenu.
- NS_WIN_COMMON_STARTUP_DIR is also "CmStrt", and is meant to map to
  Win_Common_Startup, but actually maps to Win_Common_Startmenu because of
  the key duplication.

Given the bugginess, it's unsurprising that they aren't used.

This patch removes them. This gets rid of two duplicate static atoms, helping
with bug 1445113.

MozReview-Commit-ID: 9Yx6M0VUaH4

--HG--
extra : rebase_source : 887cb2f2b907a6f3a7b796b6032b385291862323
2018-03-28 19:06:43 +11:00
Nicholas Nethercote c453ae7ce6 Bug 1449491 - Remove the unused HOME_DIR macro. r=froydnj
MozReview-Commit-ID: LSdJgmIWy4l

--HG--
extra : rebase_source : 85420290d283b62af5d8e7a0bb0500f68873ac4f
2018-03-28 19:06:16 +11:00
Nicholas Nethercote bac452f9ad Bug 1411469 - Statically allocate static atoms. r=froydnj
Currently static atoms are stored on the heap, but their char buffers are
stored in read-only static memory.

This patch changes the representation of nsStaticAtom (thus making it a
non-trivial subclass of nsAtom). Instead of a pointer to the string, it now has
an mStringOffset field which is a 32-bit offset to the string. (This requires
placement of the string and the atom within the same object so that the offset
is known to be small. The docs and macros in nsStaticAtom.h handle that.)

Static and dynamic atoms now store their chars in different ways: nsStaticAtom
stores them inline, nsDynamicAtom has a pointer to separate storage. So
`mString` and GetStringBuffer() move from nsAtom to nsDynamicAtom.

The change to static atoms means they can be made constexpr and stored in
read-only memory instead of on the heap. On 64-bit this reduces the per-process
overhead by 16 bytes; on 32-bit the saving is 12 bytes. (Further reductions
will be possible in follow-up patches.)

The increased use of constexpr required multiple workarounds for MSVC.
- Multiple uses of MOZ_{PUSH,POP}_DISABLE_INTEGRAL_CONSTANT_OVERFLOW_WARNING to
  disable warnings about (well-defined!) overflow of unsigned integer
  arithmetic.
- The use of -Zc:externConstexpr on all files defining static atoms, to make
  MSVC follow the C++ standard(!) and let constexpr variables have external
  linkage.
- The use of -constexpr:steps300000 to increase the number of operations
  allowed in a constexpr value, in order to handle gGkAtoms, which requires
  hashing ~2,500 atom strings.

The patch also changes how HTML5 atoms are handled. They are now treated as
dynamic atoms, i.e. we have "dynamic normal" atoms and "dynamic HTML5 atoms",
and "dynamic atoms" covers both cases, and both are represented via
nsDynamicAtom. The main difference between the two kinds is that dynamic HTML5
atoms still aren't allowed to be used in various operations, most notably
AddRef()/Release(). All this also required moving nsDynamicAtom into the header
file.

There is a slight performance cost to all these changes: now that nsStaticAtom
and nsDynamicAtom store their chars in different ways, a conditional branch is
required in the following functions: Equals(), GetUTF16String(),
WeakAtom::as_slice().

Finally, in about:memory the "explicit/atoms/static/atom-objects" value is no
longer needed, because that memory is static instead of heap-allocated.

MozReview-Commit-ID: 4AxPv05ngZy
2018-03-26 11:18:31 +02:00
Henri Sivonen 21af10d5f4 Bug 1445692 - Remove UTF8InputStream. r=froydnj
MozReview-Commit-ID: 1az5nkKTkru

--HG--
extra : rebase_source : 6a21b4dad71ea351a51c741977b36dfb562c608b
2018-03-14 20:53:18 +02:00
Nicholas Nethercote d81eb773d4 Bug 1445892 - Remove nsDirectoryService::sOS_HomeDirectory atom. r=froydnj
nsGkAtoms::Home and nsDirectoryAtoms::sOS_HomeDirectory are duplicate static
atoms. This patch comments out the latter to remove the duplication.

MozReview-Commit-ID: LGkjZn0zaoz
2018-03-22 19:07:40 +11:00
Andreea Pavel 7d4b5748e1 Backed out 2 changesets (bug 1435899) for failing android at modules/libpref/test/unit/test_defaultValues.js pn a CLOSED TREE
Backed out changeset 925adb267211 (bug 1435899)
Backed out changeset f22f1ab67c5a (bug 1435899)
2018-03-09 23:14:32 +02:00
Andrea Marchesini 3c1d84b33c Bug 1435899 - Close underlying stream in NonBlockingAsyncInputStream sooner. r=froydnj
--HG--
extra : rebase_source : 64473e8f71f826e7d6a3fd2324cbef98b60b133d
2018-02-27 02:03:00 -05:00
Kris Maglione afc3918d22 Bug 1443651: Don't return failure for access denied from createUnique() if file exists. r=Mossop
There are ways for Create() to return access denied for files which already
exist, particularly in the case of locked files. When it does, createUnique()
should check whether the file exists before considering the attempt a failure.

MozReview-Commit-ID: FyJTghk04jH

--HG--
extra : rebase_source : 10e6f2cb7da18e8e6d410b52a593b7455f0d76fa
2018-03-06 14:32:40 -08:00
Jeff Walden 8622941e2a Bug 375259 - The directory service shouldn't return an uninitialized (safely) nsILocalFile for the "Drivs" key. r=bsmedberg 11 years ago
--HG--
extra : rebase_source : efbcadc2e034bad91f1525d0c12ca9f81dedaf33
2018-03-05 13:02:25 -08:00
Masatoshi Kimura 5588ef80d1 Bug 1440630 - Reduce nsIFile::ResolveAndStat() calls. r=froydnj
--HG--
extra : source : 3dc9a957980918d125d7d3872c4f86bea31da437
extra : amend_source : 1dc4c1b50fe94370abab6d2ece930803fc02bcb5
2018-02-23 21:45:41 +09:00
Masatoshi Kimura dc4e17ea95 Bug 1428258 - Disallow nsIFile::GetNativePath on Windows. r=froydnj
MozReview-Commit-ID: JDryRqHcVw2

--HG--
extra : rebase_source : 228d0436c372d76d066affe9657a57bd4cda4dca
extra : source : 1dff63e6a2bb6b3190ded0c8fa748545f5d9f116
2018-01-11 22:38:33 +09:00
Nathan Froyd 65cbfc8247 Bug 1439355 - use static_assert instead of NS_ASSERTION in nsBinaryStream.cpp; r=mystor
The intention is a little more clear with static_assert, as well as
failing sooner.  (The code is probably the same, since the compiler will
optimize out the checks as dead code, but meh.)
2018-02-20 16:34:42 -05:00
Nathan Froyd af81af55cb Bug 1439593 - micro-optimize read/write of nsIID to binary streams; r=mystor
Reading nsIIDs to binary streams requires 1 + 1 + 1 + 8 calls to Read
for the underlying stream.  With the assumption that reading to the
underlying stream for a binary stream is relatively expensive, we should
be able to do better by reading the byte array in an nsIID in a single
Read() request.  The same logic applies to writing nsIIDs.  Performing a
single operation here should not change the actual bytes read or
written.  Performing a single operation also has the virtue of
performing fewer error checks and whatnot.
2018-02-20 16:34:42 -05:00
Nathan Froyd 29ed461192 Bug 1437932 - fix unused variable error in non-diagnostic assertion builds; r=baku 2018-02-14 12:01:57 -05:00
Masatoshi Kimura 4872102e9d Bug 1428557 - Stop using GetNativePath in xpcom/. r=froydnj
MozReview-Commit-ID: GnSFQ1wprzb

--HG--
extra : rebase_source : 7c25e0361d7f4e8aea730672a931cf78a581e062
extra : intermediate-source : e055aee7306b6636d27abe6fc0b02012b0075260
extra : source : d0831f473c8f85996c106693c9a4ce3783dd9447
2017-12-15 06:53:37 +09:00
Andrea Marchesini 1f4b9d7e56 Bug 1437011 - NonBlockingAsyncInputStream::Close() should return NS_OK if already closed, r=froydnj 2018-02-09 21:15:15 +01:00
Andrea Marchesini 6bfb120a59 Bug 1371699 - Correct canceling of the AsyncWait() callback in NonBlockingAsyncInputStream, r=froydnj 2018-01-31 16:45:21 +01:00
Andrea Marchesini 1126b00aed Bug 1405974 - NonBlockingAsyncInputStream must take the ownership of the underlying stream, r=qdot 2018-01-31 16:45:20 +01:00
Andrea Marchesini 5fb7a2ddb1 Bug 1371699 - NonBlockingAsyncInputStream::ReadSegments passes the correct stream to the writer callback, r=froydnj 2018-01-31 16:45:20 +01:00
Andrea Marchesini 67fac604a1 Bug 1371699 - Use of NonBlockingAsyncInputStream in our code base, r=froydnj 2018-01-31 16:45:20 +01:00
Andrea Marchesini 890628437c Bug 1371699 - Implement NonBlockingAsyncInputStream - nsIAsyncInputStream wrapper for non-blocking non-async streams, r=froydnj 2018-01-31 16:45:20 +01:00
Eric Rahm 465336e99f Bug 1333899 - Part 1: Add a fallible NS_UnescapeURL. r=froydnj
This adds a fallible version of |NS_UnescapeURL| that can be used to
gracefully handle allocation failures when the string needs to be unescaped.

--HG--
extra : rebase_source : 8d10ca98fb372afe8219d744b147703254e02830
2018-02-02 10:42:42 -08:00
Alex Gaynor 7d9591ccdc Bug 1434911 - when creating temporary files, don't set the executable bit; r=froydnj
MozReview-Commit-ID: HxD5z7hm3ra

--HG--
extra : rebase_source : 3bf62b3943e64dca33f79299dd79dbd63dcfdba3
2018-02-01 09:52:01 -05:00
Gian-Carlo Pascutto 6520179659 Bug 1386404 - Enable content-process specific tmpdir on Linux. r=jld
MozReview-Commit-ID: 6Hijq0to9MG

--HG--
extra : rebase_source : 8435b8e39d9723c52b0176a7686895185136aa6e
extra : histedit_source : 50c41172788fddead6357f1d566d0e48de8c90d6
2018-01-09 16:29:40 +01:00
Masatoshi Kimura a321c5d13e Bug 1433265 - Remove ShortcutResolver from nsLocalFileWin.cpp. r=froydnj
MozReview-Commit-ID: GeFCZI3OkuQ

--HG--
extra : rebase_source : 4a9868f82ae1143e7a31853641f5b5625ac21327
2018-01-31 20:56:17 +09:00
Masatoshi Kimura 410788f63d Bug 1428543 - Add nsIFile::HumanReadablePath. r=froydnj
This method is used to replace some GetNativePath usage for logging.

MozReview-Commit-ID: 9nWf2r4oviA

--HG--
extra : rebase_source : b58e45ab38621179cd802979131fdddbfe65079e
extra : intermediate-source : b4ded2247082f98fe18eb640c5fafeb9bc107ac0
extra : source : 21a82c1faeffc7c0d7b3a5ef0ae4c5243c81a586
2017-12-30 23:32:27 +09:00
Masatoshi Kimura 51d70c873f Bug 1428543 - Implement FileDescriptorFile::GetPersistentDescriptor. r=froydnj
This method is used by some subsequent patches when unique opaque identifiers are necessary.

MozReview-Commit-ID: AreqK4MHdJP

--HG--
extra : rebase_source : d5b85c2c9212618f54a6ac2f5199651b01c99510
extra : intermediate-source : 67c3c7a1012b9fdd628928bec61472c6ce580616
extra : source : c9a67330c600dbe454fd2ce5025247171e0c0e22
2017-12-17 13:37:03 +09:00
Masatoshi Kimura 17fb30182d Bug 1428543 - Add mozilla::filesystem::Path and use it in nsIFile. r=froydnj
Currently only |value_type| is implemented.

MozReview-Commit-ID: 1mejzvkuako

--HG--
extra : rebase_source : 69e08073adbb9a866db26e515702a0659ece0a70
extra : intermediate-source : 3696381ddfdc19ab2f901ca4247e1cb4efb27731
extra : source : 35d760da1d73dd51614f434c26e5ce80ff690829
2017-12-28 03:03:35 +09: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
Masatoshi Kimura 8b05ff3704 Bug 1427023 - Remove nsCRT::strncmp. r=erahm 2018-01-09 23:49:37 +09:00
Swapnil f42233b3e8 Bug 1396601 - Removed all instances of MOZ_ENABLE_CONTENTACTION from .cpp files and moz.build file. r=paolo
MozReview-Commit-ID: 467SgoTlsFJ

--HG--
extra : rebase_source : dadd8c2a2cad6f96605390d7aac2512714bf58c1
2018-01-08 23:48:56 +05:30
Andrea Marchesini 79f7b767db Bug 1426888 - Get rid of nsIMultiplexInputStream::RemoveStream, r=smaug 2017-12-30 12:47:12 +01:00
Valentin Gosu d1cae23d3b Bug 1426996 - Use fallible assign in NS_EscapeAndFilterURL r=kershaw
MozReview-Commit-ID: EKVeQb3cboU

--HG--
extra : rebase_source : f06b3c6f4e8e68a2a56ac39ef4261a669d99adaa
2017-12-26 21:47:22 +01:00
Andrea Marchesini f6f7ecd4e3 Bug 1426684 - Get rid of nsIMultiplexInputStream::InsertStream, r=smaug 2017-12-21 17:21:14 +01:00
Philippe Normand 110d9af7af Bug 1425877 - Non-unified build fixes for xpcom/io/nsLocalFileCommon.cpp r=cpearce
nsArray was used within the compilation unit without prior include.
2017-12-18 09:08:00 +02:00
Andrea Marchesini fbb63ae853 Bug 1424183 - nsMultiplexInputStream must call OnInputStreamReady only when there is data available, r=smaug 2017-12-13 05:11:12 -06:00
Andrea Marchesini de5ec36de8 Bug 1424183 - nsMultiplexInputStream must move to the following stream if the current one doesn't have data to read, r=smaug 2017-12-13 05:11:12 -06:00
Andrea Marchesini 11fc30c324 Bug 1424183 - nsMultiplexInputStream must call OnInputStreamReady when closed, r=smaug 2017-12-13 05:11:11 -06:00
Andrea Marchesini ef2a2db56a Bug 1424183 - nsMultiplexInputStream must not call AsyncOpen on more than the current stream, r=smaug 2017-12-13 05:11:11 -06:00
Andrea Marchesini badd489870 Bug 1424808 - Get rid of isFileStream in nsHttpChannel.cpp, r=valentin 2017-12-12 06:01:18 -06:00
Sylvestre Ledru 5de63ef061 Bug 1394734 - Replace CONFIG['MSVC'] by CONFIG['CC_TYPE'] r=glandium
MozReview-Commit-ID: 5orfnoude7h

--HG--
extra : rebase_source : 1ed9a6b56e1d27221a07624767a7fb0e6147117f
2017-12-08 13:46:13 +01:00
Cosmin Sabou c191e25cf5 Merge mozilla-inbound to mozilla-central r=merge a=merge 2017-12-08 11:56:44 +02:00
Eric Rahm 07c97a5afe Bug 1423773 - Part 1: Remove usage of nsStringGlue.h. r=glandium
This removes an unnecessary level of indirection by replacing all
nsStringGlue.h instances with just nsString.h.

--HG--
extra : rebase_source : 340989240af4018f3ebfd92826ae11b0cb46d019
2017-12-06 16:52:51 -08:00
Henri Sivonen 089449f86b Bug 960957 - Drop nsIFile support for non-UTF-8 file path encodings on non-Windows platforms. r=emk,m_kato
OS.File already only supports UTF-8 paths on non-Windows systems, so this
change makes our different ways of accessing file paths consistent with each
other.

MozReview-Commit-ID: 8HiC5xC8tJN

--HG--
extra : rebase_source : 24c77a2e9b4003694e8e96cffab301e7adc0b4e6
2017-12-05 13:33:52 +02:00
Andrea Marchesini 88be477d67 Bug 1421176 - nsMultiplexInputStream::Available() sanitize - r=smaug
1. nsMultiplexInputStream::Available() should not return CLOSED if one of the
   streams returns this error value. Instead it must check the following
   streams.
2. If a substream is async, available() should not check following streams
   until that is closed.
2017-11-30 20:00:23 +01:00
Cosmin Sabou 4fdf797aca Backed out 3 changesets (bug 1421176) for build bustages on xpcom/tests/gtest/TestMultiplexInputStream.cpp:266:3 r=backout on a CLOSED TREE
Backed out changeset e5dd080198e6 (bug 1421176)
Backed out changeset 83964057e1b2 (bug 1421176)
Backed out changeset 3ef41e230c5e (bug 1421176)
2017-11-30 21:31:55 +02:00
Andrea Marchesini a0251157e0 Bug 1421176 - nsMultiplexInputStream::Available() sanitize - r=smaug
1. nsMultiplexInputStream::Available() should not return CLOSED if one of the
   streams returns this error value. Instead it must check the following
   streams.
2. If a substream is async, available() should not check following streams
   until that is closed.
2017-11-30 20:00:23 +01:00
Noemi Erli d96f41a437 Merge inbound to mozilla-central r=merge a=merge 2017-11-18 00:01:46 +02:00
Florian Quèze b44b6a963a Bug 1405670 - remove support for NS_APP_SEARCH_DIR_LIST and NS_APP_SEARCH_DIR from the directory service, r=adw. 2017-11-17 12:05:20 +01:00
Blake Kaplan a2fcbfaaa8 Bug 1418164 - Don't leave uninitialized values lying around. r=froydnj
The users of WriteSegmentFun and ReadSegmentFun read the final out parameter
whether or not the function returns an error. We should make sure to fill it
in with a sane value.

MozReview-Commit-ID: GWDS8gENUMB

--HG--
extra : rebase_source : 0af21f525afd1f036baa15dedb7ac520e646b31e
2017-11-16 17:54:57 -08:00
Chris Peterson edb82b8131 Bug 1416164 - Replace NS_POSTCONDITION with MOZ_ASSERT. r=froydnj
MozReview-Commit-ID: 9K3Ksf36uxr

--HG--
extra : rebase_source : c5574794ae0e0ce5e756bdbcc2601896d6916002
2017-11-04 22:48:48 -07:00
Andrea Marchesini a4d8f81bac Bug 1414767 - Moving SlicedInputStream under mozilla namespace, r=froydnj 2017-11-07 01:04:06 +01:00
Sebastian Hengst e50208ab81 Backed out changeset 66d49b9e8217 (bug 1414767) for build bustage on OS X: CoreServices.framework/Frameworks/AE.framework/Headers/AERegistry.h:693: reference to 'TextRange' is ambiguous. r=backout on a CLOSED TREE 2017-11-06 17:51:56 +01:00
Andrea Marchesini 096614f974 Bug 1414767 - Moving SlicedInputStream under mozilla namespace, r=froydnj 2017-11-06 16:21:01 +01:00
Andrea Marchesini 133b6f41b7 Bug 1414068 - SlicedInputStream should be marked as closed when the underyling stream returns NS_BASE_STREAM_CLOSED, r=smaug 2017-11-06 14:22:47 +01:00
Andrea Marchesini cc7b359311 Bug 1413920 - nsMultiplexInputStream should call OnInputStreamReady on close, r=smaug 2017-11-06 14:20:15 +01:00
Nicholas Nethercote b9c6a1d730 Bug 1413413 (part 2) - Remove support for extensions having their own prefs file. r=glandium,kmag.
It's no longer needed, now that legacy extensions aren't supported.

Pieces removed include the following.

- The "load-extension-default" observer notification.

- The code for reading defaults/preferences/*.js from extensions.

- The unit test for this stuff.

- A crash reporter annotation relating to very long prefs set by add-ons.

- All references to "ExtPrefDL".

MozReview-Commit-ID: KMBoYn3uZ3x

--HG--
extra : rebase_source : 4dc8ffd425c6cdf06806409090c4f9d04a64930b
2017-10-31 16:34:57 +11:00
Sylvestre Ledru 916f2bbd02 Bug 1413490 - Base64.cpp: disable the formatting of kBase64DecodeTable & kBase64URLDecodeTable r=erahm
MozReview-Commit-ID: GvvwGp8vlxC

--HG--
extra : rebase_source : 1d20be5438feb345265be5398bd30aca1e932b70
2017-11-01 11:24:37 +01:00
Sylvestre Ledru b48518e115 Bug 1413103 - nsEscape.cpp: disable the formatting of netCharType & EscapeChars r=erahm
MozReview-Commit-ID: GHM6EnO9S5h

--HG--
extra : rebase_source : 932bc33cdc5720f65043f7e3566d36078894c318
2017-10-31 08:36:02 +01:00
Sebastian Hengst d67d120cc4 Backed out 4 changesets (bug 1386404) for mass failures, e.g. in browser-chrome's dom/tests/browser/browser_xhr_sandbox.js. r=backout on a CLOSED TREE
Backed out changeset 36556e1a5ac7 (bug 1386404)
Backed out changeset b136f90dc49f (bug 1386404)
Backed out changeset 4600c2d575f9 (bug 1386404)
Backed out changeset c2c40e4d9815 (bug 1386404)
2017-10-30 19:10:01 +01:00
Gian-Carlo Pascutto 802f1b9395 Bug 1386404 - Enable content-process specific tmpdir on Linux. r=haik
MozReview-Commit-ID: 6Hijq0to9MG

--HG--
extra : rebase_source : c7a3559e4cbdfd1885d13a489c4eeb311ca973fa
2017-10-12 11:18:25 +02:00
Andrew McCreight 989d6728ca Bug 1412119 - Re-fix mode lines in xpcom. r=erahm 2017-10-26 14:39:00 -04:00
Andrea Marchesini acd3aaaa13 Bug 1411520 - nsMultiplexInputStream must use CancelableRunnable because it can be used in workers, r=bkelly 2017-10-25 20:18:58 +02:00
Sylvestre Ledru d60d69e2cb Bug 1411001 - Remove the +x permissions on cpp & h files r=froydnj
MozReview-Commit-ID: DjDkL20wRg0

--HG--
extra : rebase_source : a343d83d1f4e97e4ba56d0f57fec93079df0b5ea
2017-10-23 20:59:55 +02:00
Nicholas Nethercote 21e7dce1a2 Bug 1410294 (part 3) - Overhaul static atom macros. r=froydnj.
There are four things that must be provided for every static atom, two of which
have a macro:
- the atom pointer declaration (no macro);
- the atom pointer definition (no macro);
- the atom char buffer (NS_STATIC_ATOM_BUFFER);
- the StaticAtomSetup struct (NS_STATIC_ATOM_SETUP).

This patch introduces new macros for the first two things: NS_STATIC_ATOM_DECL
and NS_STATIC_ATOM_DEFN, and changes the arguments of the existing two macros
to make them easier to use (e.g. all the '##' concatenation now happens within
the macros).

One consequence of the change is that all static atoms must be within a class,
so the patch adds a couple of classes where necessary (DefaultAtoms, TSAtoms).

The patch also adds a big comment explaining how the macros are used, and what
their expansion looks like. This makes it a lot easier to understand how static
atoms work. Correspondingly, the patch removes some small comments scattered
around the macro use points.

MozReview-Commit-ID: wpRyrEOTHE

--HG--
extra : rebase_source : 9f85d477b4d06c9a9e710c757de1f1476edb6efe
2017-10-22 08:50:25 +11:00
Nicholas Nethercote 074a872086 Bug 1410294 (part 1) - Rename nsStaticAtom as nsStaticAtomSetup. r=froydnj.
Because it's the type we use to set up static atoms at startup, not the static
atom itself.

The patch accordingly renames some parameters, variables, and NS_STATIC_ATOM,
for consistency.

MozReview-Commit-ID: 1a0KvhYNNw2

--HG--
extra : rebase_source : 5c66e5b2dfe053a368bf3584d957198aec4cce91
2017-10-20 14:04:47 +11:00
Kris Maglione f6ba082a01 Bug 1404198: Part 2b - Switch to NS_NewTimer* in xpcom. r=njn
MozReview-Commit-ID: BEtHEpOmT1E

--HG--
extra : rebase_source : dac8a182f1ad76df6715146e1da1279c02c0406f
2017-10-15 23:11:22 -07:00
Kris Maglione 3876d40960 Bug 1404198: Part 1 - Add non-virtual constructor for nsIObject(Input|Output)Stream and update existing callers. r=njn
MozReview-Commit-ID: 3eoh6AwDJyz

--HG--
extra : rebase_source : 92b18b6ef07d276cac79ce735ca0b592cffbf87e
2017-10-04 20:06:28 -07:00
Chris Pearce 04945c8950 Bug 1407624 - Make nsEscape.cpp build in non-unified mode. r=froydnj
nsEscape.cpp doesn't build in non-unified mode, as it uses mozilla::fallible,
mozilla::CheckedInt and mozilla::ASCIIMask::IsMasked without prefixing them
with the mozilla namespace. I suspect this file is usually included in
unified_cpp file which includes a "using namespace mozilla" directive.

MozReview-Commit-ID: GwlsK8kytLj

--HG--
extra : rebase_source : c3063aff7cdf10c416b8ee782c9bee745e643842
2017-10-11 16:32:23 +02: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
Sebastian Hengst b86bd8d413 Backed out changeset 2e253e370b8d (bug 1371699) for frequently assertin in browser-chrome at SourceBuffer.cpp:473. r=backout on a CLOSED TREE 2017-10-05 13:12:36 +02:00
Sebastian Hengst 15b8e9a53b Backed out changeset 097c44e15165 (bug 1371699) 2017-10-05 13:10:55 +02:00
Sebastian Hengst 449b6fdffb Backed out changeset 950c069a0192 (bug 1371699) 2017-10-05 13:10:44 +02:00
Sebastian Hengst fd1c572923 merge mozilla-central to mozilla-inbound. r=merge a=merge on a CLOSED TREE 2017-10-05 11:47:25 +02:00
Andrea Marchesini d1f7ca1095 Bug 1403706 - Remove race conditions in temporary blob - part 3 - NS_OpenAnonymousTemporaryNsIFile, r=smaug 2017-10-05 07:41:41 +02:00
Andrea Marchesini cccac16f60 Bug 1403771 - SlicedInputStream takes ownership of the underlying stream and it propagates the Close() call, r=smaug 2017-10-05 07:38:48 +02:00
Andrea Marchesini 00a01b8402 Bug 1371699 - NonBlockingAsyncInputStream::ReadSegments passes the correct stream to the writer callback, r=froydnj 2017-10-04 11:46:34 +02:00
Andrea Marchesini 1867437172 Bug 1371699 - Use of NonBlockingAsyncInputStream in our code base, r=froydnj 2017-10-03 07:20:18 +02:00
Andrea Marchesini 952e5f8ead Bug 1371699 - Implement NonBlockingAsyncInputStream - nsIAsyncInputStream wrapper for non-blocking non-async streams, r=froydnj 2017-10-03 07:20:17 +02:00
Sebastian Hengst d4232ad6f1 Backed out changeset c68498143c13 (bug 1403771) for bustage at dom/file/StreamBlobImpl.cpp:108: 'GetInternalStream' was not declared in this scope. r=backout on a CLOSED TREE 2017-10-04 19:11:13 +02:00
Andrea Marchesini 96a79ce7c9 Bug 1403771 - SlicedInputStream takes ownership of the underlying stream and it propagates the Close() call, r=smaug 2017-10-04 18:51:10 +02:00
Andrea Marchesini fb5c48f638 Bug 1403771 - SlicedInputStream::Read should not call ::Read() of the underlying stream when there is nothing else to read, r=smaug 2017-10-04 13:10:10 +02:00
Sebastian Hengst 9d84c676a9 Backed out changeset 919a4eb29621 (bug 1371699) for frequently asserting at image/SourceBuffer.cpp:473, e.g. in browser-chrome's browser_testOpenNewRemoteTabsFromNonRemoteBrowsers.js on OS X and Windows. r=backout 2017-10-03 16:57:29 +02:00
Sebastian Hengst e8e914baa7 Backed out changeset c033bdb24e14 (bug 1371699) 2017-10-03 16:55:02 +02:00
Andrea Marchesini ff3b280260 Bug 1371699 - Use of NonBlockingAsyncInputStream in our code base, r=froydnj 2017-10-03 07:20:18 +02:00
Andrea Marchesini 1297664f63 Bug 1371699 - Implement NonBlockingAsyncInputStream - nsIAsyncInputStream wrapper for non-blocking non-async streams, r=froydnj 2017-10-03 07:20:17 +02:00
Mike Hommey e2e258506d Bug 1403366 - Remove outdated comment. r=froydnj
--HG--
extra : rebase_source : 810e0c072c2effb6eb1f3e3c3baef5dde69eee86
2017-09-28 11:01:15 +09:00
Mike Hommey 3af63f59c0 Bug 1403366 - When NS_XPCOM_INIT_CURRENT_PROCESS_DIR is not already set, fallback to BinaryPath's parent. r=froydnj
The Windows and OSX code paths were essentially doing the same thing,
and the Unix fallback was using an old convention that is pretty much
outdated.

Under normal conditions (XPCOM initialized by Firefox),
NS_XPCOM_INIT_CURRENT_PROCESS_DIR is set from BinaryPath anyways, so
this only really affects adhoc XPCOM initialization from e.g. C++ unit
tests.

--HG--
extra : rebase_source : b3151fffd4c82159b633a48dead86f2c3b0a03d6
2017-09-28 10:49:48 +09:00
Mike Hommey e68b54aab1 Bug 1403366 - Don't use nsDirectoryService::Create in nsDirectoryService::GetCurrentProcessDirectory. r=froydnj
Back in the day, there was no global with an already initialized
DirectoryService. But now there is, and, in fact,
GetCurrentProcessDirectory already errors out if that global is not set
by the time it's called. All calling nsDirectoryService::Create achieves
is doing the check again and calling QueryInterface, which we don't need
to do anyways.

--HG--
extra : rebase_source : 32f5080ecb8165cffd601799e72d278b482b0871
2017-09-28 08:46:43 +09:00
Sebastian Hengst 481a987cf9 Backed out changeset 3ac2c898f94f (bug 1403366) for failing xpcshell tests netwerk/test/httpserver/test/test_basic_functionality.js and test_bug337744.js. r=backout 2017-09-29 17:21:29 +02:00
Sebastian Hengst a4c17f327a Backed out changeset 7e08706f9f34 (bug 1403366) 2017-09-29 17:19:40 +02:00
Sebastian Hengst a4c329d535 Backed out changeset f9db424c4c6a (bug 1403366) 2017-09-29 17:19:29 +02:00
Mike Hommey 87d3bf1331 Bug 1403366 - Remove outdated comment. r=froydnj
--HG--
extra : rebase_source : 5c97f2d6b3a3157de127553bb39fe37f4af2cba8
2017-09-28 11:01:15 +09:00
Mike Hommey feab23649a Bug 1403366 - When NS_XPCOM_INIT_CURRENT_PROCESS_DIR is not already set, fallback to BinaryPath's parent. r=froydnj
The Windows and OSX code paths were essentially doing the same thing,
and the Unix fallback was using an old convention that is pretty much
outdated.

Under normal conditions (XPCOM initialized by Firefox),
NS_XPCOM_INIT_CURRENT_PROCESS_DIR is set from BinaryPath anyways, so
this only really affects adhoc XPCOM initialization from e.g. C++ unit
tests.

--HG--
extra : rebase_source : f7faa6f22ffc56fb4da7ae96eb571a35fa6f615d
2017-09-28 10:49:48 +09:00
Mike Hommey a8c37d0520 Bug 1403366 - Don't use nsDirectoryService::Create in nsDirectoryService::GetCurrentProcessDirectory. r=froydnj
Back in the day, there was no global with an already initialized
DirectoryService. But now there is, and, in fact,
GetCurrentProcessDirectory already errors out if that global is not set
by the time it's called. All calling nsDirectoryService::Create achieves
is doing the check again and calling QueryInterface, which we don't need
to do anyways.

--HG--
extra : rebase_source : 519980829be4ff4a0941c0e8d18be5761ece6552
2017-09-28 08:46:43 +09: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
Jean-Yves Avenard 918e171099 Bug 1403100 - Fix compilation on High Sierra (10.13). r=froydnj
MozReview-Commit-ID: B3B2YeUTlAz

--HG--
extra : rebase_source : e58b694bb7c5b0e3c9ae73f0d3f0b2d16f91019d
2017-09-26 11:52:29 +02:00
Boris Zbarsky 203072cfe1 Bug 1401171 - Make nsIMultiplexInputStream not inherit from nsIInputStream. r=bkelly
This is a preexisting issue that makes nsMultiplexInputStream multiple-inherit
from nsIInputStream: once via nsIMultipartInputStream and once via
nsIAsyncInputStream.  This causes problems once we end up with more multiplex
streams that are async streams, because then some assingments to
nsCOMPtr<nsIInputStream> start asserting.  This patch just removes the footgun
by getting rid of the multiple inheritance.
2017-09-19 16:26:21 +02:00
Sebastian Hengst 7973633f84 Backed out changeset 3c9e25405f59 (bug 1401204) an request from baku for landing with wrong bug number. r=backout 2017-09-19 16:25:20 +02:00
Boris Zbarsky 5c70c28414 Bug 1401204 - Make nsIMultiplexInputStream not inherit from nsIInputStream. r=bkelly
This is a preexisting issue that makes nsMultiplexInputStream multiple-inherit
from nsIInputStream: once via nsIMultipartInputStream and once via
nsIAsyncInputStream.  This causes problems once we end up with more multiplex
streams that are async streams, because then some assingments to
nsCOMPtr<nsIInputStream> start asserting.  This patch just removes the footgun
by getting rid of the multiple inheritance.
2017-06-11 00:07:23 -04:00
Nomis101 f73dafa53a Bug 1398291 - Remove remaining IsOSXLeopard leftover. r=mstange
--HG--
extra : rebase_source : 1b3cf1183d11c85d34a6dd713f71b7f4cbd002f3
2017-09-08 21:15:00 +02:00
Ben Kelly 10e7aa67d1 Bug 1398942 P2 Convert nsPipe3.cpp NS_ASSERTION() calls to hard assertions. r=froydnj 2017-09-13 10:36:18 -07:00
Ben Kelly db6fe1b9f4 Bug 1398942 P1 Convert existing nsPipe3.cpp MOZ_ASSERT's to use MOZ_DIAGNOSTIC_ASSERT. r=froydnj 2017-09-13 10:36:15 -07:00
Ben Kelly a8bc15e6c1 Bug 1397595 P2 Delay removing nsPipeInputStream from nsPipe list until DrainInputStream() actually runs. r=froydnj 2017-09-12 06:28:58 -07:00
Ben Kelly 244a6712f0 Bug 1397595 P1 Clear nsPipeInputStream mReadCursoe and mReadLimit in DrainInputStream() to keep state consistent with mAvailable. r=froydnj 2017-09-12 06:28:55 -07:00
Andrea Marchesini 7779bd9850 Bug 1397645 - Optimize IPCBlobInputStream slicing with the introduction of nsICloneableInputStreamWithRange, r=asuth 2017-09-11 17:29:15 +02:00
Sebastian Hengst 71854680c0 merge mozilla-central to mozilla-inbound. r=merge a=merge 2017-09-08 00:07:48 +02:00
Andrea Marchesini 536def110e Bug 1397331 - Reduce the number of QI done in nsMultiplexInputStream using counters, r=smaug 2017-09-07 18:39:10 +02:00
Eric Rahm 0617c21c24 Bug 1393230 - Part 2: Fix more improper string usages. r=njn
This fixes improper usages of Find where an offset was actually being use for
the boolean ignore case flag. It also fixes a few instances of passing in a
literal wchar_t to our functions where a NS_LITERAL_STRING or char16_t should
be used instead.

--HG--
extra : rebase_source : 5de1e9335895d65e6db06c510e8887d27be3390f
extra : source : f762f605dd83fc6331161a33e1ef5d54cafbd08d
2017-08-31 15:52:30 -07:00
Tom Ritter 6fd392825a Bug 1394013 Fix forbidden string constant assignment r=froydnj
ISO C++ forbids converting a string constant to 'wchar_t*' [-Werror=write-strings]

Either change it to a nullptr (which has same intent) or pass through a static


MozReview-Commit-ID: CSunOCyO9PN

--HG--
extra : rebase_source : bfdabc1f463eca75987c6561f7c3ea60acf0340f
2017-08-22 16:58:06 -05:00
Ryan VanderMeulen 4d504e0608 Backed out 3 changesets (bug 1393230) because it touches the servo directory.
Backed out changeset 9115364cd4aa (bug 1393230)
Backed out changeset f762f605dd83 (bug 1393230)
Backed out changeset c366bfc13e86 (bug 1393230)
2017-09-07 09:33:53 -04:00
Eric Rahm 70ece631cb Bug 1393230 - Part 2: Fix more improper string usages. r=njn
This fixes improper usages of Find where an offset was actually being use for
the boolean ignore case flag. It also fixes a few instances of passing in a
literal wchar_t to our functions where a NS_LITERAL_STRING or char16_t should
be used instead.
2017-08-31 15:52:30 -07:00
Nathan Froyd 3ac61243c3 Bug 1362449 - part 12 - avoid conversions in nsString Base64 decoding; r=erahm
After all the previous work, we can now base64 decode nsString types
without intermediate conversion steps to nsCString, which is faster and
more memory-efficient.
2017-09-06 16:58:36 -04:00
Nathan Froyd 1506c036e9 Bug 1362449 - part 11 - fix decoding subroutines to cope with wide output types; r=erahm
The result of decoding needs to be an explicit 8-bit type before being
widened to the output type to avoid undesirable effects like sign
extension.
2017-09-06 16:58:36 -04:00
Nathan Froyd bd7f988c20 Bug 1362449 - part 10 - templatify CString base64 decode routine; r=erahm
The current nsString decoding routine indirectly relies on the various
checks this routine performs; making it generic over string types
ensures that we can eventually call it directly from the nsString
decoding routine.
2017-09-06 16:58:36 -04:00
Nathan Froyd d44ccf35ff Bug 1362449 - part 9 - templatify core base64 decode routine; r=erahm
Similar to the work we did for encoding, we're going to want this to be
type-generic.
2017-09-06 16:58:36 -04:00
Nathan Froyd 9cab40ef08 Bug 1362449 - part 8 - use our base64 decoding routines instead of NSPR's; r=erahm
Our base64 decoding routines are a little nicer, and using them is a
necessary step to templating all the necessary routines.
2017-09-06 16:58:36 -04:00
Nathan Froyd 602ae06673 Bug 1362449 - part 7 - make decode routines type-generic; r=erahm
The existing Base64URL code converts from `const char` to `uint8_t`.
We're going to want versions that convert from character types to
character types, so make the decode routines accept generic input and
output types.
2017-09-06 16:58:36 -04:00
Nathan Froyd 84d527a6e0 Bug 1362449 - part 6 - factor out base64url decoding routines; r=erahm
The decoding logic is the same for Base64 and Base64URL; we might as
well reuse the routines that we already have for Base64URL decoding so
we don't make mistakes in the logic.
2017-09-06 16:58:37 -04:00
Nathan Froyd 844466bd3f Bug 1362449 - part 5 - add tables for normal base64 decoding; r=erahm
These tables are nearly identical to the ones for base64url decoding,
but ideally will be slightly more readable, since things are broken up
into sets of eight entries at a time.
2017-09-06 16:58:37 -04:00
Nathan Froyd 7e9f8459e0 Bug 1362449 - part 4 - avoid conversions in nsString Base64 encoding; r=erahm
After all the previous work, we can base64 encoding nsString values
directly into nsString values, without having to go through intermediate
nsCString values.  Since this routine backs base64 routines exposed to
the web, this change should help with OOMs that we see associated with
base64 encoding.
2017-09-06 16:58:37 -04:00
Nathan Froyd d68341d832 Bug 1362449 - part 3 - templatify core nsCString base64 encode routine; r=erahm
The nsACString -> nsACString encode routine has several checks in it for
correct operation, and the nsAString -> nsAString encode routine relies
on those checks happening via the nsACString -> nsACString routine.
Once we start encoding nsAStrings directly, we'll still need those
checks, and the easiest way to ensure they happen is to move the core
base64 encode logic for strings into a templated helper.
2017-09-06 16:58:37 -04:00
Nathan Froyd fe35e37738 Bug 1362449 - part 2 - use our Base64 encode implementation rather than NSPR's; r=erahm
One less use of NSPR is a good thing.  The failure cases that
PL_Base64Encode would have caught for us are:

1. "Truncation".
2. Integer overflow when computing destination string length.
3. Malloc failures.

The first one only gets checked if we pass in zero for the source
length, which we never do.  The latter two only get checked if we pass
in a null pointer for the destination, which we never do.  So removing
the error handling PL_Base64Encode implies here is a good thing.
2017-09-06 16:58:37 -04:00
Nathan Froyd 329a43dc67 Bug 1362449 - part 1a - fix Encode*to* for non-8-bit character types; r=erahm
We need to explicitly reduce the incoming character to 8 bits, rather
than assuming that a conversion to uint32_t will do the right thing.
2017-09-06 16:58:37 -04:00
Nathan Froyd 261bd97797 Bug 1362449 - part 1 - make Base64 encode generic over source character types; r=erahm
We'll need this to implement direct encoding from nsString, and the
changes are trivial.
2017-09-06 16:58:37 -04:00
Andrea Marchesini 2e5b11551a Bug 1396290 - nsStringStream should propagate the OOM error of SetData() when cloned, r=froydnj 2017-09-06 18:11:44 +02:00
Andrea Marchesini 570f15da30 Bug 1393360 - nsMultiplexInputStream should not QI each stream when checking if seekable, cloneable or IPC serializable, r=smaug 2017-08-25 15:32:13 +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
Sebastian Hengst 99e5cb9c14 merge mozilla-inbound to mozilla-central. r=merge a=merge
MozReview-Commit-ID: GSKVB94r7Kk
2017-08-23 16:29:51 +02:00
Nicholas Nethercote 780a2e4aec Bug 1390428 (part 4) - Remove still more nsXPIDLCString local variables. r=erahm.
These are all easy cases where an nsXPIDLCString local variable is set via
getter_Copies() and then is null checked. The patch uses IsVoid() to replace
the null checks (and get() and EqualsLiteral() calls to replace any implicit
conversions).

--HG--
extra : rebase_source : 484ad42a7816b34b86afbe072e04ba131c1619c6
2017-08-16 13:58:55 +10:00
Tom Ritter c3169de381 Bug 1392630 Remove unused variables r=froydnj
MozReview-Commit-ID: eSbnMzdWZm

--HG--
extra : rebase_source : c432a7d08b845fc102251faadeb7200a4991294a
2017-08-22 09:16:31 -05:00
Tom Ritter 8760e71649 Bug 1392609 Find returns an int32_t not a uint32_t r=froydnj
MozReview-Commit-ID: 8jBe7CGbAvM

--HG--
extra : rebase_source : f8f9963118658174e11364f2aed958dfe3a0cea7
2017-08-22 06:21:09 -05:00
Nicholas Nethercote 4e54a99900 Bug 1385172 - Move some comments in nsEscape.h. r=erahm.
Comments about functions should go before the declaration, not after!

--HG--
extra : rebase_source : 7cfdb2cc7fd926bec36673d8ca334920c07d0a43
2017-08-21 08:58:28 +10:00
Nicholas Nethercote 4a623e6df4 Bug 1385172 - Replace nsEscapeHTML{,2}() with new nsAppendEscapedHTML() function. r=erahm.
The existing functions work with C strings but almost all the call sites use
Mozilla strings.

The replacement function has the following properties.

- It works with Mozilla strings, which makes it much simpler and also improves
  the call sites.

- It appends to the destination string because that's what a lot of the call
  sites need. For those that don't, we can just append to an empty string.

- It is declared outside the |extern "C"| section because there is no need for
  it to be in that section.

Note: there is no 16-bit variant of nsAppendEscapedHTML(). This is because
there are only two places that need 16-bit variants, both rarely executed,
and so converting to and from 8-bit is good enough.

The patch also adds some testing of the new function, renaming
TestEscapeURL.cpp as TestEscape.cpp in the process, because that file is now
testing other kinds of escaping.

--HG--
rename : xpcom/tests/gtest/TestEscapeURL.cpp => xpcom/tests/gtest/TestEscape.cpp
extra : rebase_source : 51145ae2c9b0b4573c7ea0c342dcb246f9f14fb9
2017-08-18 12:00:59 +10:00
Michael Kaply 73bafcec5e Bug 1389168 - Remove unnecessary IBM license text. r=gerv
MozReview-Commit-ID: 8HdaBppsJsc

--HG--
extra : rebase_source : 617c17b1162265e44810597fa69d533316da1a6b
2017-08-16 16:10:56 -05:00
Valentin Gosu 97a44a506c Bug 1369317 - Filter and escape URI string in only one pass r=mcmanus
MozReview-Commit-ID: KU4C4cS3jZC

--HG--
extra : rebase_source : 4995b4d8a133b8568af5b130be2077ee90f8b4e4
2017-08-13 10:03:34 +02:00
Valentin Gosu b3e75dbf06 Bug 1386683 - Do not escape the `'` character in the URL hash r=junior
MozReview-Commit-ID: DkoDvWGbWfu

--HG--
extra : rebase_source : 22de804e82136114a0688ce271cac8c49f8c4f23
2017-08-06 11:13:04 +02:00
Masatoshi Kimura 06311d2e3a Bug 1375125 - Remove nsILocalFile. r=froydnj
MozReview-Commit-ID: 6oU6Ya5UXtC

--HG--
extra : rebase_source : 55b6e30aa348c1b939326698b0da7d72c26b479c
2017-08-05 09:43:49 +09:00
Haik Aftandilian 546c76f86e Bug 1376496 - Part 4 - FileDescriptorFile.cpp coding style fixes. r=jimm
MozReview-Commit-ID: LN5o3WIW8ug

--HG--
extra : rebase_source : 225bfafa51c2626b98bc540cd907f7ce408f78bd
2017-07-17 23:48:42 -07:00
Brad Werth 291faedb49 Bug 1380165 Part 1: Remove no-longer-used NS_MACOSX_JAVA2_PLUGIN_DIR variable and a comment that referenced a closed bug that conditionally used it. r=mstange
MozReview-Commit-ID: 7Qbel0gmEAI

--HG--
extra : rebase_source : 68801d890663572d0232b99082b49241cb3f8a02
2017-07-12 14:01:12 -07:00
Brad Werth 8e8714cad4 Bug 1059424 Part 2: Simplify nsAppFileLocationProvider Java plugin detection now that we are minimum macOS 10.9. r=mstange
MozReview-Commit-ID: CkmH2ngEDKT

--HG--
extra : rebase_source : 8a24d9b9f012a28c171cb6d2024e9f5a83ba9080
2017-07-10 15:37:46 -07:00
Sylvestre Ledru 4e9cf83ee8 Bug 1378712 - Remove all trailing whitespaces r=Ehsan
MozReview-Commit-ID: Kdz2xtTF9EG

--HG--
extra : rebase_source : 7235b3802f25bab29a8c6ba40a181a722f3df0ce
2017-07-06 14:00:35 +02:00
Mats Palmgren 9542d00e58 Bug 1376498 part 2 - Use plain Remove(key) in some places instead of Lookup(key).Remove() for simplicity. r=froydnj
MozReview-Commit-ID: 7GlCL1jyGAz
2017-07-05 02:01:44 +02:00
Nicholas Nethercote 3e439bb4f8 Bug 1376638 - Minimize uses of prmem.h. r=glandium.
It's silly to use prmem.h within Firefox code given that in our configuration
its functions are just wrappers for malloc() et al. (Indeed, in some places we
mix PR_Malloc() with free(), or malloc() with PR_Free().)

This patch removes all uses, except for the places where we need to use
PR_Free() to free something allocated by another NSPR function; in those cases
I've added a comment explaining which function did the allocation.

--HG--
extra : rebase_source : 0f781bca68b5bf3c4c191e09e277dfc8becffa09
2017-06-30 19:05:41 -07:00
Carsten "Tomcat" Book 7918eeee02 merge mozilla-inbound to mozilla-central a=merge 2017-06-28 13:23:29 +02:00
Mats Palmgren e0fc464fa9 Bug 1376476 - Use Lookup instead of Get+Remove, and LookupForAdd instead of Get+Put, to avoid unnecessary hashtable lookups. r=froydnj
MozReview-Commit-ID: FpFNg0vJXc5
2017-06-28 01:03:17 +02:00
Carsten "Tomcat" Book 9c5ccdbab2 Merge mozilla-central to autoland 2017-06-27 15:15:58 +02:00
Haik Aftandilian c3cf53a7ef Bug 1334550 - Part 1 - Proxy moz-extension protocol requests to the parent process; r=jimm,mayhemer
Changes ExtensionProtocolHandler to use remote streams for
moz-extension loads of file and JAR URI's to allow for
filesystem read-access sandboxing.

Adds messaging to PNecko to allow child processes to
request an input stream or file descriptor for moz-extension
URI's.

Add ExtensionProtocolHandler singleton so that NeckoParent can
call methods directly and ExtensionProtocolHandler::NewFD
can use a new member variable |mFileOpenerThread| to open files.

Adds FileDescriptorFile, a limited implementation of nsIFile
that wraps a file descriptor, to be sideloaded into
nsJARChannels so that extension JAR files can be read
using a file descriptor without accessing the filesystem
directly.

MozReview-Commit-ID: 1pcnIpjz2yR

--HG--
extra : rebase_source : 9d7334778fc81837b11b98d4e32603f7e5eb3a27
2017-06-23 17:10:54 -07:00
Bill McCloskey f115503a0b Bug 1372405 - Provide names for all runnables in the tree (r=froydnj)
MozReview-Commit-ID: DKR6ROiHRS7
2017-06-26 14:19:58 -07:00
Nicholas Nethercote 58786e1ea7 Bug 1375392 - Tweak the PROFILER_LABEL* macros. r=mstange.
This patch makes the following changes to the macros.

- Removes PROFILER_LABEL_FUNC. It's only suitable for use in functions outside
  classes, due to PROFILER_FUNCTION_NAME not getting class names, and it was
  mostly misused.

- Removes PROFILER_FUNCTION_NAME. It's no longer used, and __func__ is
  universally available now anyway.

- Combines the first two string literal arguments of PROFILER_LABEL and
  PROFILER_LABEL_DYNAMIC into a single argument. There was no good reason for
  them to be separate, and it forced a '::' in the label, which isn't always
  appropriate. Also, the meaning of the "name_space" argument was interpreted
  in an interesting variety of ways.

- Adds an "AUTO_" prefix to PROFILER_LABEL and PROFILER_LABEL_DYNAMIC, to make
  it clearer they construct RAII objects rather than just being function calls.
  (I myself have screwed up the scoping because of this in the past.)

- Fills in the 'js::ProfileEntry::Category::' qualifier within the macro, so
  the caller doesn't need to. This makes a *lot* more of the uses fit onto a
  single line.

The patch also makes the following changes to the macro uses (beyond those
required by the changes described above).

- Fixes a bunch of labels that had gotten out of sync with the name of the
  class and/or function that encloses them.

- Removes a useless PROFILER_LABEL use within a trivial scope in
  EventStateManager::DispatchMouseOrPointerEvent(). It clearly wasn't serving
  any useful purpose. It also serves as extra evidence that the AUTO_ prefix is
  a good idea.

- Tweaks DecodePool::SyncRunIf{Preferred,Possible} so that the labelling is
  done within them, instead of at their callsites, because that's a more
  standard way of doing things.

--HG--
extra : rebase_source : 318d1bc6fc1425a94aacbf489dd46e4f83211de4
2017-06-22 17:08:53 +10:00
Nicholas Nethercote f1364a75ea Bug 1374580 (part 3) - Remove ns{,C}Substring typedefs. r=froydnj.
All the instances are converted as follows.

- nsSubstring  --> nsAString
- nsCSubstring --> nsACString

--HG--
extra : rebase_source : cfd2238c52e3cb4d13e3bd5ddb80ba6584ab6d91
2017-06-20 19:19:52 +10:00
Nicholas Nethercote fe9268c4cd Bug 1374580 (part 2) - Remove nsAFlat{,C}String typedefs. r=froydnj.
All the instances are converted as follows.

- nsAFlatString  --> nsString
- nsAFlatCString --> nsCString

--HG--
extra : rebase_source : b37350642c58a85a08363df2e7c610873faa6e41
2017-06-20 19:19:05 +10:00
Nicholas Nethercote 1572f96f5d Bug 1374580 (part 1) - Remove nsASingleFragment{,C}String typedefs. r=froydnj.
All the instances are converted as follows.

- nsASingleFragmentString  --> nsAString
- nsASingleFragmentCString --> nsACString

--HG--
extra : rebase_source : e6a1ddc8938fecd9a735b15e872c054edf4c7910
2017-06-20 19:18:17 +10:00
Carsten "Tomcat" Book 8a1350b5a6 Backed out changeset 4f6302a98ae4 (bug 1372405)
--HG--
extra : rebase_source : 41632f3158e88e692809731394a683d065a73dfb
2017-06-21 13:59:26 +02:00
Bill McCloskey 6b3e84ed5f Bug 1372405 - Provide names for all runnables in the tree (r=froydnj)
MozReview-Commit-ID: DKR6ROiHRS7
2017-06-20 21:44:11 -07:00
Carsten "Tomcat" Book ea1b86680c Backed out changeset 9846de3bd954 (bug 1372405)
--HG--
extra : rebase_source : 5d4a48e8ec394c329994689d938d2a6e9b2752b0
2017-06-20 08:27:02 +02:00
Bill McCloskey 4592152411 Bug 1372405 - Provide names for all runnables in the tree (r=froydnj)
MozReview-Commit-ID: DKR6ROiHRS7
2017-06-19 22:25:47 -07:00
Masatoshi Kimura 3231cb3535 Bug 1372886 - Remove dead parameters from nsIConverterInputStream.init(). r=hsivonen
MozReview-Commit-ID: GliLHLsUWjt

--HG--
extra : rebase_source : 50d3f4680a498125ddf600b0d64f6740b0229f80
2017-06-17 19:30:09 +09:00
Bill McCloskey d7df561295 Bug 1372426 - More detailed names for nsInputStreamReadyEvent (r=erahm)
MozReview-Commit-ID: 6beE0eMCxg7
2017-06-14 14:44:04 -07:00
Wes Kocher 6c1a0ae549 Backed out 6 changesets (bug 1371699) for various failures including frequent img-blobURI-2.html failures and leaks a=backout
Backed out changeset 67a27cf0ab80 (bug 1371699)
Backed out changeset 7e494fa90087 (bug 1371699)
Backed out changeset 30405ec37e1e (bug 1371699)
Backed out changeset 2d67624a01dc (bug 1371699)
Backed out changeset 503c9d22e6bb (bug 1371699)
Backed out changeset eedcb67a9fb6 (bug 1371699)

MozReview-Commit-ID: 4HydLjK7Ond
2017-06-13 17:50:11 -07:00
Wes Kocher e883883e7c Backed out changeset 45b5cadadc22 (bug 1372426) because it's blocking a backout a=backout
MozReview-Commit-ID: Jl0zxef8R9k
2017-06-13 17:48:38 -07:00
Bill McCloskey 1b366c9ec9 Bug 1372426 - More detailed names for nsInputStreamReadyEvent (r=erahm)
MozReview-Commit-ID: 6beE0eMCxg7
2017-06-13 15:24:08 -07:00
Wes Kocher fdca69feeb Backed out changeset e8a63038d787 (bug 1372426) for build failures in nsStringStream.cpp a=backout
MozReview-Commit-ID: 8ci8nKoiLhz
2017-06-13 15:20:12 -07:00
Bill McCloskey 7efe80ba16 Bug 1372426 - More detailed names for nsInputStreamReadyEvent (r=erahm)
MozReview-Commit-ID: 6beE0eMCxg7
2017-06-13 14:53:26 -07:00
Eric Rahm ab9516d40d Bug 1353593 - Part 2: Remove wwc functions. r=froydnj
This removes the use of |wwc| functions in favor of char16ptr_t's implicit
conversion operators.

MozReview-Commit-ID: GHONYieMPla
2017-06-12 16:20:49 -07:00
Boris Zbarsky 319fd7b3aa Bug 1371699 part 6. Implement nsIAsyncInputStream for nsStringInputStream. r=bkelly 2017-06-13 16:16:58 -04:00
Boris Zbarsky 5193353a61 Bug 1371699 part 4. Make nsIMultiplexInputStream not inherit from nsIInputStream. r=bkelly
This is a preexisting issue that makes nsMultiplexInputStream multiple-inherit
from nsIInputStream: once via nsIMultipartInputStream and once via
nsIAsyncInputStream.  This causes problems once we end up with more multiplex
streams that are async streams, because then some assingments to
nsCOMPtr<nsIInputStream> start asserting.  This patch just removes the footgun
by getting rid of the multiple inheritance.
2017-06-13 16:16:39 -04:00
Boris Zbarsky 3d884086c3 Bug 1371699 part 3. Make nsIStringInputStream not inherit from nsIInputStream anymore. r=bkelly
This will prevent ambiguous nsIInputStream inheritance once we also inherit from nsIAsyncInputStream.
2017-06-13 16:16:23 -04:00
Boris Zbarsky 4c7424ec25 Bug 1371699 part 2. Implement nsICancelableRunnable on AsyncWaitRunnable. r=bkelly
It's just luck that we haven't ended up with a multiplex stream on workers that contains at least one async stream.
2017-06-13 16:16:07 -04:00
Boris Zbarsky d071e405b2 Bug 1371699 part 1. Give nsStringInputStream an mStatus variable. r=bkelly
This will make it simple to implement CloseWithStatus.
2017-06-13 16:16:04 -04:00
Henri Sivonen 432653453a Bug 1261841 part 2 - Use encoding_rs instead of uconv. r=emk,mystor.
MozReview-Commit-ID: 15Y5GTX98bv
2017-06-13 13:23:23 +03:00
Andrea Marchesini a698cd8d63 Bug 1372272 - AsyncStreamHelper::OnInputStreamReady() should be NOP if calling AsyncWait() in one of the substreams fails in ::Run(), r=bz 2017-06-12 19:45:05 +02:00
Ehsan Akhgari cb3e227493 Bug 1371279 - Try to use reserved stack space instead of heap allocation in nsLocalFile::GetNativeTarget(); r=froydnj 2017-06-09 01:14:16 -04:00
Colin Dean 0f028d9bc9 Bug 1364984 - use non-deprecated API for finding the temporary directory on OS X; r=mstange
FSFindFolder is deprecated as of 10.9 and apparently continues to
work...except for the case of finding the temporary directory when the
user's home directory lives on an NFS mount (!).  Using
NSTemporaryDirectory does The Right Thing here, so let's use that instead.
2017-06-07 20:40:50 -04:00
Bryce Van Dyk 99d1ede409 Bug 1272371 - Update multiplexed input stream seek behaviour. r=froydnj
This patch is originally from :baku and updates the seek behaviour of
nsMulitplexInputStream. This fixes an issue with absolute seeking where if a
seek is performed and the correct offset reached, the members of the multiplex
stream were not updated to reflect this.

MozReview-Commit-ID: 7lEvuXxzYkI

--HG--
extra : rebase_source : d86a7ce0fc26abd3c9a60810bd7f7f6346e7a5b0
2017-05-25 13:38:01 +12:00
Paolo Amadini f3d8ecd611 Bug 1364050 - Part 4 - Remove references to "downloads.rdf". r=mak
MozReview-Commit-ID: y3BfYQYkF2

--HG--
extra : rebase_source : 0f09e7961aa0f226ba4cc1616172ee4856a50ee8
2017-05-11 09:37:10 +01:00
Patrick McManus eab0a004e6 Bug 1362388 - dont let File backed http requests find size on main thread r=nwgh
MozReview-Commit-ID: AFM4R0M7dmj

--HG--
extra : rebase_source : 01d3020eb952ec286be30b937476161a403215ff
2017-05-05 17:51:13 -04:00
Wes Kocher 8eaf64f920 Backed out 2 changesets (bug 1362388) for android build bustage in nsHttpChannel.cpp a=backout
Backed out changeset f5b4fbe31c01 (bug 1362388)
Backed out changeset 446ecc3f5715 (bug 1362388)

MozReview-Commit-ID: DI01cDPrgM7
2017-05-12 13:58:28 -07:00
Patrick McManus 3db60df302 Bug 1362388 - dont let File backed http requests find size on main thread r=nwgh
MozReview-Commit-ID: AFM4R0M7dmj

--HG--
extra : rebase_source : ad15d3aad5d0d271acd5cd35dbfbf72e432bcdd7
2017-05-05 17:51:13 -04:00
Sebastian Hengst a477978a5d Backed out changeset a418e4a81c02 (bug 1362388) for build bustage from netwerk/protocol/http/nsHttpChannel.cpp:597 not being declared. r=backout 2017-05-11 18:01:01 +02:00
Patrick McManus 20a6e4849c Bug 1362388 - dont let File backed http requests find size on main thread r=nwgh
MozReview-Commit-ID: AFM4R0M7dmj

--HG--
extra : rebase_source : 3cd535eb604a78551f6a6043088701e1d1fc40ce
2017-05-05 17:51:13 -04:00
Andrea Marchesini c41696993b Bug 1361654 - Initializing all the member variables in SlicedInputStream, r=qdot 2017-05-04 08:36:35 +02:00
Phil Ringnalda e099f834fe Backed out 2 changesets (bug 1360992, bug 1361654) for a 70% failure rate in test_fileReader.html on ASan e10s
Backed out changeset ab9fdee3a6a4 (bug 1360992)
Backed out changeset 141c2dfd49ff (bug 1361654)

MozReview-Commit-ID: 3rSzvmc5FPx
2017-05-05 12:35:57 -07:00
Nathan Froyd 844bb853dd Bug 1362390 - make Base64Encode tolerant of allocation failures; r=mccr8 2017-05-05 11:33:36 -04:00
Nathan Froyd 880d162a51 Bug 1362194 - part 3 - make Base64Decode even more tolerant of allocation failures; r=mccr8
The lossy conversion to ASCII here can also fail; we should handle that
as well.  Rewriting the code to use MakeScopeExit also avoids tangled
logic and/or duplicating calls to ensure the destination string is
truncated on failure.
2017-05-05 11:33:36 -04:00
Nathan Froyd 8b000da91e Bug 1362194 - part 2 - make Base64Decode tolerant of allocation failures; r=mccr8
We need to use a fallible CopyASCIItoUTF16 function, since we might not
have enough memory to perform the copy.
2017-05-05 11:33:36 -04:00
Andrea Marchesini f62189c258 Bug 1361443 - nsMultiplexInputStream should implement nsIAsyncInputStream, r=smaug 2017-05-04 14:44:35 +02:00
Carsten "Tomcat" Book eb1fd0ed7f Backed out changeset c0e3f3edf36a (bug 1361443) for crashes in [@ mozilla::Base64EncodeInputStream] and test failures in test_fileReaderSync.xul 2017-05-04 16:40:14 +02:00
Andrea Marchesini a9df58d062 Bug 1361443 - nsMultiplexInputStream should implement nsIAsyncInputStream, r=smaug 2017-05-04 14:44:35 +02:00
Andrea Marchesini 4d39fea437 Bug 1361654 - Initializing all the member variables in SlicedInputStream, r=qdot 2017-05-04 08:36:35 +02:00
Chris Peterson 30c0c4add0 Bug 1356843 - Fix -Wcomma warnings in xpcom/io/nsLocalFileUnix.cpp. r=froydnj
clang's -Wcomma warning warns about suspicious use of the comma operator such as calling a function for side effects within an expression. Check NS_SUCCEEDED() to use HasMoreElement() in an expression and confirm that it actually returned a legitimate out parameter.

xpcom/io/nsLocalFileUnix.cpp:725:48 [-Wcomma] possible misuse of comma operator here
xpcom/io/nsLocalFileUnix.cpp:1053:39 [-Wcomma] possible misuse of comma operator here

MozReview-Commit-ID: aebrgc5Wqk

--HG--
extra : rebase_source : 18a2bbeb55ff106cdcb88e4889c7fd2745952a31
extra : source : e62ac5b8744d342948ab12f21f369d21f857a706
2017-04-03 11:05:57 -07:00
Andrea Marchesini 8b8935bd3b Bug 1355369 - SlicedInputStream must implement AsyncWait correctly, r=smaug 2017-04-12 13:49:08 +02:00
Andrea Marchesini 0cd2885406 Bug 1355369 - SlicedInputStream should expose nsIAsyncInputStream interface only when needed, r=smaug 2017-04-12 13:49:08 +02:00
Eric Rahm 807d2c062b Bug 1353544 - Replace usage of PR_BEGIN_MACRO in xpcom. r=froydnj 2017-04-05 18:06:44 -07:00
Paolo Amadini bc9668cdff Bug 1346716 - Remove the entry for "mimeTypes.rdf" in the directory service. r=mak
This improves performance because we won't try to fix the permissions of the file every time the nsIHandlerService implementation wants to open it, and makes it easier to access the file path from xpcshell tests.

MozReview-Commit-ID: DZmLa92qUnZ

--HG--
extra : source : bd0fdce03cc7442079e96318d3a9b519a4d403a9
2017-03-30 15:51:18 +01:00
Andrea Marchesini 5b7d646332 Bug 1350239 - SlicedInputStream::Seek must set correct position in the source stream, r=smaug 2017-03-27 11:48:06 +02:00
Ehsan Akhgari 566751834a Bug 1346583 - Remove the PContent::Msg_OpenAnonymousTemporaryFile sync IPC; r=billm 2017-03-21 09:27:48 -04:00
Andrea Marchesini 2e9d67bae0 Bug 1347557 - Move 2 static methods about the IPC serialization of streams into an helper class, r=qdot 2017-03-21 07:47:25 +01:00
David Major dc67bfc9a3 Bug 1344629 - Part 6: Rewrite unnecessary uses of nsLiteralString. r=dbaron
There's an antipattern where nsLiteralString is used as an unnecessary intermediary in converting from CharT* to CharT*,
e.g. CallAFunctionThatTakesACharPointer(NS_LITERAL_CSTRING("foo").get());
or
NS_NAMED_LITERAL_STRING(foo, "abc");
CallAFunctionThatTakesACharPointer(foo.get());

This patch rewrites the callsites that can be trivially changed to use char*/char16_t*.

I'd somewhat like to remove nsTLiteralString::get() altogether, but in code that's less straightforward than these examples, get() is useful enough to keep.

MozReview-Commit-ID: Kh1rUziVllo

--HG--
extra : rebase_source : c21a65694d6e1c42fd88f73632f7ac8f38d005ae
2017-03-14 15:26:27 +13:00
Iris Hsiao 5cece96e1c Backed out 12 changesets (bug 1344629) for stylo build bustage
Backed out changeset cf4273d3ac30 (bug 1344629)
Backed out changeset a96390e044e0 (bug 1344629)
Backed out changeset d9b330f9bc24 (bug 1344629)
Backed out changeset 2b460fe020af (bug 1344629)
Backed out changeset 0ada91b0452e (bug 1344629)
Backed out changeset 083304fcd6bd (bug 1344629)
Backed out changeset 53d7d1ce2c97 (bug 1344629)
Backed out changeset 55eee7078ae4 (bug 1344629)
Backed out changeset 7d3c06b3eca9 (bug 1344629)
Backed out changeset e5df14c3db61 (bug 1344629)
Backed out changeset 636095ff2815 (bug 1344629)
Backed out changeset 0be052ad24c1 (bug 1344629)
2017-03-14 11:52:24 +08:00
David Major 40f4821701 Bug 1344629 - Part 6: Rewrite unnecessary uses of nsLiteralString. r=dbaron
There's an antipattern where nsLiteralString is used as an unnecessary intermediary in converting from CharT* to CharT*,
e.g. CallAFunctionThatTakesACharPointer(NS_LITERAL_CSTRING("foo").get());
or
NS_NAMED_LITERAL_STRING(foo, "abc");
CallAFunctionThatTakesACharPointer(foo.get());

This patch rewrites the callsites that can be trivially changed to use char*/char16_t*.

I'd somewhat like to remove nsTLiteralString::get() altogether, but in code that's less straightforward than these examples, get() is useful enough to keep.

MozReview-Commit-ID: Kh1rUziVllo

--HG--
extra : rebase_source : c21a65694d6e1c42fd88f73632f7ac8f38d005ae
2017-03-14 15:26:27 +13:00
Andrea Marchesini 2d8722e0b8 Bug 1344204 - nsMultiplexInputStream should be serializable/cloneable following the internal sub streams, r=smaug 2017-03-08 07:48:16 +01:00
Sebastian Hengst 4ad1529674 Backed out changeset 5739a7f790f2 (bug 1333899) for failing reftest svg-image-datauri-1.html on Linux opt and pgo. r=backout 2017-02-22 10:00:50 +01:00
Andrea Marchesini 9f369c0e29 Bug 1339710 - Remove the implementation of SlicedInputStream::ReadSegments, r=smaug 2017-02-22 09:42:27 +01:00
Andrea Marchesini 930614ab07 Bug 1339710 - SlicedInputStream should be nsISeekableStream, r=smaug 2017-02-22 09:41:59 +01:00
Andrea Marchesini 0500e8f2e7 Bug 1339710 - SlicedInputStream should be an nsIIPCSerializableInputStream, r=smaug 2017-02-22 09:41:05 +01:00
Andrea Marchesini 5dfc951f15 Bug 1339710 - SlicedInputStream should not be nsICloneableInputStream if the source stream is not, r=smaug 2017-02-22 09:40:46 +01:00
Iris Hsiao f9bdfe10bb Backed out 5 changesets (bug 1339710) for GTest failures in TestSlicedInputStream.StartBiggerThan
Backed out changeset 7c0ec55b44dc (bug 1339710)
Backed out changeset cbb4e1c2aada (bug 1339710)
Backed out changeset c685dca493f5 (bug 1339710)
Backed out changeset 4761a15d45fd (bug 1339710)
Backed out changeset 7561692c1bc7 (bug 1339710)
2017-02-22 16:19:50 +08:00
Andrea Marchesini 2431d460d2 Bug 1339710 - Remove the implementation of SlicedInputStream::ReadSegmenets, r=smaug 2017-02-22 07:57:54 +01:00
Andrea Marchesini 76b13c0185 Bug 1339710 - SlicedInputStream should be nsISeekableStream, r=smaug 2017-02-22 07:57:14 +01:00
Andrea Marchesini a75afeb38f Bug 1339710 - SlicedInputStream should be an nsIIPCSerializableInputStream, r=smaug 2017-02-22 07:55:50 +01:00
Andrea Marchesini f981e3155b Bug 1339710 - SlicedInputStream should not be nsICloneableInputStream if the source stream is not, r=smaug 2017-02-22 07:54:46 +01:00
Eric Rahm 9279ddcaa9 Bug 1333899 - Part 1: Add a fallible NS_UnescapeURL. r=froydnj
This adds a fallible version of |NS_UnescapeURL| that can be used to
gracefully handle allocation failures when the string needs to be unescaped.

MozReview-Commit-ID: 1eXPzeB2yrI
2017-02-21 17:56:34 -08:00
Tom Tromey 5f8f360823 Bug 1060419 - make log_print use Printf.h, r=froydnj
MozReview-Commit-ID: BIZ1GQEZ1vs

--HG--
extra : rebase_source : 2f1f0aa12493c44f352d9a7e8683e7bb72d2d75b
2016-12-15 20:16:31 -07:00