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

437 Коммитов

Автор SHA1 Сообщение Дата
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
Andrew Osmond 9fdad4e863 Bug 1433351 - Add nsBaseHashtable::EntryPtr::OrRemove method to abort nsBaseHashtable::LookupForAdd on miss. r=froydnj
In SourceSurfaceImage::GetTextureClient, we use LookupForAdd. This is
because we typically will create a new TextureClient if there isn't
already one created. This creation can fail because the size is too big,
or we don't have the memory available for it. Unfortunately LookupForAdd
is an infallible operation; it is expected we will always add something
to the hashtable if we don't find an entry. This patch adds an OrRemove
method to cover the corner case where we are unable to complete the
insertion.
2018-03-28 12:58:49 -04:00
Henri Sivonen 0b42c77c1b Bug 1449148 - Move the test data of TestStrings.cpp into a fixture. r=froydnj
MozReview-Commit-ID: K9edrOZKaTY

--HG--
extra : rebase_source : cad2f7ed2737c764e6aeef12290a8ad28d37aedb
2018-03-27 14:22:43 +03:00
L. David Baron 1da1c4f2be Bug 1448138 - Rename string DataFlags::SHARED to REFCOUNTED to make it clearer to those reading the code. r=erahm
MozReview-Commit-ID: 1mJuwY5dQkj

--HG--
extra : transplant_source : %B8%97%C2%AAa%A6%3D%E3%AC%9C%C1%15%99%FE%94%1A%E2K%81%F1
2018-03-23 17:31:37 -07:00
Nathan Froyd efd709bd4f Bug 1447744 - don't implement nsINamed for mozilla::Runnable when it's unused; r=erahm
We only use nsINamed on runnables for certain kinds of telemetry, and
those kinds of telemetry aren't being gathered on RELEASE_OR_BETA
builds.  We effectively make nsINamed::GetName a no-op when we're not
collecting said telemetry.  But implementing nsINamed does have a cost:
the vtable of every runnable (and we have hundreds of subclasses of
mozilla::Runnable) will contain pointers for GetName (and extra pointers
for QueryInterface/AddRef/Release), and all those pointers times all
those subclasses adds up quickly.  Let's not implement nsINamed when
nsINamed isn't going to be used.

This change saves ~100K of binary size on x86-64 Linux; the savings
should be similar on other 64-bit systems, and ~50K on 32-bit systems.
2018-03-23 14:53:55 -04:00
Sebastian Hengst 1e30b1a1f4 Bug 1445926 - Only run GTest TestThreadMetrics if RELEASE or BETA are not set. r=tarek
MozReview-Commit-ID: I04MxVtBqa1

--HG--
extra : rebase_source : d8971343d76448341e9ca6de80de18eee79d95f0
2018-03-15 13:54:13 +01:00
Tarek Ziadé 86edd52973 Bug 1437438 - Add a performance counter to track scheduler activity - r=farre,froydnj
Adds a PeformanceCounter class that is used in DocGroup and WorkerPrivate
to track runnables execution and dispatch counts.

MozReview-Commit-ID: 51DLj6ORD2O

--HG--
extra : rebase_source : b481c9aa3b735569722bb7472872ec2d22adcb89
2018-03-06 10:19:19 +01:00
Miko Mynttinen 7ca020bee6 Bug 1441779 - Part 2: Add nsTArray::RemoveLastElement() and nsTArray::PopLastElement() r=froydnj
MozReview-Commit-ID: ENgK1CTS6Fq

--HG--
extra : rebase_source : 3468ba67dd8b45119f37a8c96cc34964f9155a40
2018-02-28 10:32:10 +01:00
Tim Taubert ea6e54236f Bug 1433015 - Turn AllocReplacement gtests into death tests r=froydnj 2018-02-22 10:27:42 +01:00
Chris Peterson d09123f248 Bug 1436263 - Part 1: Replace `final override` virtual function specifiers with just `final`. r=froydnj
MozReview-Commit-ID: DE5HkIhsZ6D

--HG--
extra : rebase_source : 94831c1e13a840dd2ea0600f64bcf70c2bf938d9
extra : source : cf9283bf1b0bca3a6311c98e227329d451f80ecb
2018-02-05 22:46:57 -08:00
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 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 ea1acf8681 Bug 1371699 - gtest for NonBlockingAsyncInputStream, r=froydnj 2018-01-31 16:45:20 +01:00
Henri Sivonen 835a606d01 Bug 1432728 - Add a microbenchmark for HasRTLChars(). r=gerv,jfkthame
MozReview-Commit-ID: I0sAeNMtR0c

--HG--
extra : rebase_source : f924e604ac2e1398bfdcdf8e306243015833421b
2018-01-23 17:50:50 +02:00
Nika Layzell 2fa989d926 Bug 1431122 - Part 2: Add tests for UnorderedRemoveElement[s]At, r=froydnj
MozReview-Commit-ID: DuB2oiT8l49
2018-01-23 17:27:37 -05:00
Eric Rahm 5497e40f06 Bug 1431261 - Add nsTDependentString copy constructor. r=dbaron
This adds a copy constructor that uses Rebind to preserve the reference to
static data rather allocate a new shared buffer.

--HG--
extra : rebase_source : db04def1137a9be646b8e09dfee780c9163a585c
2018-01-18 14:16:19 -08:00
Honza Bambas d1d494ea54 Bug 1295941 - Let mozilla::Tokenizer read signed integers from the input, r=erahm 2018-01-17 06:23:00 +02: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
Masatoshi Kimura efc13822e0 Bug 1426989 - Fix NS_strncmp. r=erahm
--HG--
extra : rebase_source : 0dc3bc4f32a7564dadbdb5e5930679f83b9cdc1d
extra : intermediate-source : 454bde0083c54e8a01c50dc2e7a03b74349a537e
extra : source : 6fa2311f5909e1577d8d515c62d2106b76d1f469
2017-12-24 16:39:24 +09: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 da0a8f053e Bug 1421094 - Make nsBufferedStream cloneable, r=smaug 2017-12-12 18:38:19 -06:00
Sylvestre Ledru 4591d82b23 Bug 1394734 - Replace CONFIG['CLANG*'] by CONFIG['CC_TYPE'] r=glandium
MozReview-Commit-ID: HbF5oT5HW6f

--HG--
extra : rebase_source : eca479b6ae4bff7f600d1cdb39e11ac2057e4e79
2017-12-07 22:09:38 +01:00
Andrea Marchesini 10c57af6af Bug 1421176 - nsMultiplexInputStream::Available() sanitize - gtests - r=smaug 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 8fd5768278 Bug 1421176 - nsMultiplexInputStream::Available() sanitize - gtests - r=smaug 2017-11-30 20:00:23 +01:00
Gabriele Svelto 3e3a359edc Bug 1402519 - Remove MOZ_CRASHREPORTER directives from xpcom; r=froydnj
MozReview-Commit-ID: HS3M0DJQ3qc

--HG--
extra : rebase_source : c535b0760480deea1c9889c629c52857bf52ea64
2017-10-10 11:59:39 +02:00
shindli fb855aa7ba Backed out 16 changesets (bug 1402519) for conflicts during merge r=backout on a CLOSED TREE
Backed out changeset 07fcf163241a (bug 1402519)
Backed out changeset c6d2ad45d8e2 (bug 1402519)
Backed out changeset 8a3caca61294 (bug 1402519)
Backed out changeset 01425eae2c48 (bug 1402519)
Backed out changeset cf298d3815de (bug 1402519)
Backed out changeset e1964f4389cd (bug 1402519)
Backed out changeset f405337f3569 (bug 1402519)
Backed out changeset a76356fd3359 (bug 1402519)
Backed out changeset d3bb350d1c34 (bug 1402519)
Backed out changeset 9d3bfd9f932c (bug 1402519)
Backed out changeset e3dd6e5b073f (bug 1402519)
Backed out changeset e801b0c00134 (bug 1402519)
Backed out changeset 8a4139fa5dca (bug 1402519)
Backed out changeset 8d01c14ac1ca (bug 1402519)
Backed out changeset 24e0dcd01898 (bug 1402519)
Backed out changeset f8fdf450613f (bug 1402519)
2017-11-23 00:11:44 +02:00
Gabriele Svelto 13364cc36b Bug 1402519 - Remove MOZ_CRASHREPORTER directives from xpcom; r=froydnj
MozReview-Commit-ID: HS3M0DJQ3qc

--HG--
extra : rebase_source : bb09e9e3b01d39e91a1377117fa127a09c29cccd
2017-10-10 11:59:39 +02:00
Jan de Mooij 7f30bf48a7 Bug 1417844 part 2 - Remove JSVersion from CompileOptions, CompartmentBehaviors, scripts. r=evilpie 2017-11-17 12:12:39 +01:00
Matt Woodrow aab0cbe92c Bug 1406727. r=froydnj 2017-11-16 16:09:28 +13:00
Andrea Marchesini eedd5e2174 Bug 1416724 - part 1 - AbstractThread::Dispatch should propage errors if failing the dispatching of Runnables, r=jwwang 2017-11-15 07:58:02 +01:00
shindli 385fb3428c Backed out 4 changesets (bug 1416724) for failing /builds/worker/workspace/build/src/dom/media/hls/HLSDemuxer.cpp:89:5 r=backout on a CLOSED TREE
Backed out changeset 45352aa4319d (bug 1416724)
Backed out changeset 01d1e5263bcd (bug 1416724)
Backed out changeset bc854c315ec8 (bug 1416724)
Backed out changeset 35a50167485d (bug 1416724)
2017-11-15 09:49:04 +02:00
Andrea Marchesini e521e16895 Bug 1416724 - part 1 - AbstractThread::Dispatch should propage errors if failing the dispatching of Runnables, r=jwwang 2017-11-15 07:58:02 +01:00
James Cheng 3f519daa88 Bug 1415083 - Rearrange the declaration of objects to avoid stack-use-after-scope. r=froydnj
MozReview-Commit-ID: 7nMw1i10b7e

--HG--
extra : rebase_source : ab23ef60ff800f522357037cacd02bf87d2960ee
2017-11-07 17:02:54 +08:00
Henri Sivonen 9a34044063 Bug 1396208 - For benchmarking, add a black box function that is opaque to the optimizer. r=froydnj
MozReview-Commit-ID: 82jn6u6WRf0

--HG--
extra : rebase_source : 76e173841ed555b7e3741bf3d004de5aa071f3b0
2017-10-10 09:48:26 +03: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 cc7b359311 Bug 1413920 - nsMultiplexInputStream should call OnInputStreamReady on close, r=smaug 2017-11-06 14:20:15 +01:00
Chris Peterson 1df202b177 Bug 1412048 - Replace NS_RUNTIMEABORT("...") with MOZ_CRASH("..."). r=froydnj
And remove unreachable code after MOZ_CRASH().

MozReview-Commit-ID: 6ShBtPRKYlF

--HG--
extra : rebase_source : 0fe45a59411bda663828336e2686707b550144ae
extra : source : 8473fd7333d2abe1ea1cc176510c292a5b34df45
2017-10-24 23:30:31 -07:00
Eric Rahm b8c8c56e46 Bug 1412416 - Part 2: Simplify ArenaStrdup for xpcom strings. r=froydnj
Now that xpcom strings use templates we can combine their `ArenaStrdup`
implementations. `nsTStringRepr` is used so as to allow handling of both
`nsTLiteralString` and `nsTSubstring` types.

--HG--
extra : rebase_source : e77891da589f320507b45f524a3203b3dc9f38e6
extra : histedit_source : 79d3b9a1add191563e0985f0c0e416bd29f24351
2017-10-27 13:26:47 -07:00
Eric Rahm 1a39968857 Bug 1412416 - Part 1: Support arena duplication of wide strings. r=froydnj
This adds support for duplicating both raw `char*` strings and raw `char16_t*`
strings by making the character type generic.

--HG--
extra : rebase_source : bb5245ed71161c8c785684e5a56ac894f03874ea
extra : histedit_source : e94eb738a3982f0cb63a894a0cdfbdf0be2b9cad
2017-10-27 13:23:48 -07:00
Eric Rahm 4df63b1809 Bug 1403083 - Part 2: Test conditionaly enabling string functions. r=froydnj
--HG--
extra : rebase_source : 01e852a2cf86a71fd1842fc852f1c2cdecb67b7b
2017-10-09 13:33:16 -07:00
Andrea Marchesini 6626e900f9 Bug 1409327 - NS_NewBufferedInputStream should take the ownership of the inputStream, r=smaug 2017-10-19 11:39:30 +02:00
Nika Layzell c234875cd6 Bug 1377351 - Part 4: Add tests for nsA[C]String::Assign move overload, r=froydnj
MozReview-Commit-ID: KJ41seMmUXt
2017-10-18 13:00:18 -04:00
Sebastian Hengst 66e04dcde6 Backed out changeset 4666cde20909 (bug 1409327) 2017-10-17 22:03:33 +02:00
Andrea Marchesini d526801916 Bug 1409327 - NS_NewBufferedInputStream should take the ownership of the inputStream, r=smaug 2017-10-17 20:38:05 +02: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
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 93494fca0a Backed out changeset b88b3fbd7deb (bug 1371699) 2017-10-05 13:10:49 +02:00
Sebastian Hengst 449b6fdffb Backed out changeset 950c069a0192 (bug 1371699) 2017-10-05 13:10:44 +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 3d4ceae380 Bug 1371699 - Tests for NonBlockingAsyncInputStream, r=froydnj 2017-10-03 07:20:18 +02:00
Nicholas Nethercote 9e0714dd26 Bug 1403506 - Remove nsTFixedString<T>. r=erahm.
(patch is actually r=erahm,mystor)

nsTFixedString<T> is only used as a base class for nsTAutoStringN<T, N>, so
this patch merges the former into the latter, cutting some code and simplifying
the string class hierarchy.

Because the "Fixed" name is now gone, the patch also renames
StringDataFlags::FIXED as INLINE and ClassDataFlags::FIXED as INLINE.

The patch also removes nsFixed[C]String and ns_auto_[c]string! from Rust code
because nsAutoString can't be implemented directly in Rust due to its move
semantics. There were only two uses of ns_auto_string! outside of tests so this
seems like a minor loss.

MozReview-Commit-ID: 8ntximghiut

--HG--
extra : rebase_source : f36edbae0553adcfee356fb8b311097ff7424786
2017-09-27 20:19:33 +10: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
Chris Peterson 1ca3d5aa46 Bug 870698 - Part 8: Replace Equals(NS_LITERAL_CSTRING("")) with EqualsLiteral(""). r=erahm
The NS_LITERAL_CSTRING macro creates a temporary nsLiteralCString to encapsulate the string literal and its length, but AssignLiteral() can determine the string literal's length at compile-time without nsLiteralCString.

MozReview-Commit-ID: B5Y8KyExPQ8

--HG--
extra : rebase_source : e27b266c145daa5acd887e998c6d5b408101e1db
extra : source : 33f49977a33cbdb1c7127871b940eefccc018f65
2017-09-06 15:00:31 -07:00
Chris Peterson 9f4c1f5278 Bug 870698 - Part 1: Replace Assign("") with AssignLiteral(""). r=erahm
MozReview-Commit-ID: A0u9PP49OW3

--HG--
extra : rebase_source : 7d5286959f510eb4b7df1b7e32d5b9b58719c48b
extra : intermediate-source : f552b4a78236c42bc09030b3eb008725a3edb9c8
extra : source : 26ac4a1014f6661a70e3bf9f552407e12c2c3981
2017-09-03 22:12:56 -07:00
Nicholas Nethercote 225f3a87e4 Bug 1400193 (part 2) - Shrink PLDHashTable. r=froydnj.
This patch reduces sizeof(PLDHashTable) as follows.

- 64-bit: from 40 bytes to 32
- 32-bit: from 28 bytes to 20

It does this by doing the following.

- It moves mGeneration from EntryStore to PLDHashTable, to avoid unnecessary
  padding on 64-bit. This requires tweaking EntryStore::Set() as explained in a
  comment.

- It also shrinks mGeneration from uint32_t to uint16_t, saving 2 bytes of
  data.

- It shrinks mEntrySize from uint32_t to uint8_t, to cut 3 bytes of data.

- It shrinks mHashShift from int16_t to uint8_t, trimming another byte of data,
  and moves it, saving another 2 bytes of padding.

And it reorders the fields so the word-sized ones are at the start, which makes
it easier to imagine the memory layout.

The patch also adds a test, and fixes some misordered function arguments in
existing tests.

--HG--
extra : rebase_source : 6ed6f7be68477fd4a82f07dd2f51c1f1d9b92dcc
2017-09-15 20:04:29 +10:00
Tom Tromey f993bb28d0 Bug 1401821 - nsTextFormatter "*" width argument comes before the actual argument; r=froydnj
Bug 1388789 introduced a bug breaking formats like "%*.f".  The problem
was that the next "natural" argument was taken before the "*" width
argument.

MozReview-Commit-ID: BZack9faY7a

--HG--
extra : rebase_source : a14485914ef9e29e38f29be6c1df1372ce5e722f
2017-09-21 09:43:28 -06:00
Tom Tromey 971dbd3853 Bug 1388789 - clean up \0 emission in nsTextFormatter; r=froydnj
nsTextFormatter unconditionally emitted a trailing \0, leading some code
elsewhere to have to work around this.  This changes the code to only
emit it in snprintf.

MozReview-Commit-ID: G3CBpAPp9Tn

--HG--
extra : rebase_source : 36666476a4f796e2553c9fa31daa54d245ae3b5f
2017-09-06 09:38:58 -06:00
Tom Tromey f2a652249e Bug 1388789 - make nsTextFormatter runtime type-safe; r=froydnj
Change nsTextFormatter functions to template functions, box their
arguments, and then make the formatter mostly impervious to type
mismatches.  Most formatting is done according to the type of the actual
argument.

MozReview-Commit-ID: H8WmyxFCb7s

--HG--
extra : rebase_source : ad98ad6243825f1a892fc6a641d155e239b12a6b
2017-09-01 14:03:56 -06:00
Tom Tromey 586209d1a8 Bug 1388789 - handle unrecognized escapes in nsTextFormatter; r=froydnj
nsTextFormatter tried to pass unrecognized escapes in the format string
through to the output.  However, if the format held a width or
precision, that text was not output.  It seems better to me to try to
preserve the format text as-is.

MozReview-Commit-ID: HoBykpfzK7C

--HG--
extra : rebase_source : 9b071db3800e3e75cabb4995a920818dfb35b03d
2017-09-01 08:31:49 -06: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
Gerald Squelart 7dbe315e25 Bug 1398999 - nsDequeFunctor::operator() doesn't need to return anything - r=froydnj
Its return value is never used, and most implementations return nullptr anyway.

MozReview-Commit-ID: 8rxC053mmE8

--HG--
extra : rebase_source : 61a0b8b1373396182efd27d3c01b96e5e5541364
2017-02-09 14:06:36 +11:00
Xidorn Quan 306241f7a1 Bug 1397130 - Use signed integer for gUnusedAtomCount. r=froydnj
MozReview-Commit-ID: 9KweZdyu5WF

--HG--
extra : rebase_source : 81981c706fbde89b18168e39b15dee0cbff27cca
2017-09-06 15:06:16 +10:00
Xidorn Quan 749154c86c Bug 1397052 - Add gtest for concurrent accessing. r=froydnj
MozReview-Commit-ID: K3enhwjyGYE

--HG--
extra : rebase_source : 0c714a453e584ba3ceeef7e46e2c13bd6016a179
2017-09-07 10:08:31 +10:00
Nathan Froyd f21b0d5aee Bug 1362449 - part 0 - add test cases for base64 string encode/decode; r=erahm
We already had testcases for streaming encoding, but we didn't have any
for one-shot encoding and decoding.  Let's fix that.
2017-09-06 16:58:37 -04:00
Henri Sivonen 3e8b6b5f47 Bug 1395527 part 1 - Add microbenchmarks for IsASCII and IsUTF8. r=froydnj
MozReview-Commit-ID: 3oploVISQ3F

--HG--
extra : rebase_source : 08d184e9b09a6375f6c6ace2b3511d39e9b36691
2017-08-31 14:46:25 +03:00
Sebastian Hengst 427e06082d Backed out changeset 40934888ed06 (bug 1395527) for Android bustage at uriloader/exthandler/android/nsMIMEInfoAndroid.cpp:62: too many arguments to function 'bool IsUTF8(const nsACString&)'. r=backout 2017-09-02 10:39:06 +02:00
Henri Sivonen 521edd3c6a Bug 1395527 part 1 - Add microbenchmarks for IsASCII and IsUTF8. r=froydnj
MozReview-Commit-ID: 3oploVISQ3F

--HG--
extra : rebase_source : 08d184e9b09a6375f6c6ace2b3511d39e9b36691
2017-08-31 14:46:25 +03:00
Michael Layzell eab07b465e Bug 1393581 - Name all IdleTaskRunner runnables, r=smaug 2017-08-25 11:24:27 -04:00
Jan de Mooij a5de55dced Bug 1389510 part 3 - Remove getProperty/setProperty hooks from ClassOps. r=evilpie 2017-08-25 10:12:16 +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
Nathan Froyd 4f91b7f41c Bug 1349821 - reduce iterations for 32-bit Windows to OOM in TestTArray.test_fallible; r=erahm 2017-08-22 16:08:18 -04: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
Bill McCloskey a5168688f9 Bug 1382922 - Fix test bustage on a CLOSED TREE
MozReview-Commit-ID: D03XhT1oTP0
2017-08-16 21:27:14 -07:00
Bill McCloskey 9edd615af7 Bug 1382922 - Refactor event queue to allow multiple implementations (r=erahm)
This patch refactors the nsThread event queue to clean it up and to make it easier to restructure. The fundamental concepts are as follows:

Each nsThread will have a pointer to a refcounted SynchronizedEventQueue. A SynchronizedEQ takes care of doing the locking and condition variable work when posting and popping events. For the actual storage of events, it delegates to an AbstractEventQueue data structure. It keeps a UniquePtr to the AbstractEventQueue that it uses for storage.

Both SynchronizedEQ and AbstractEventQueue are abstract classes. There is only one concrete implementation of SynchronizedEQ in this patch, which is called ThreadEventQueue. ThreadEventQueue uses locks and condition variables to post and pop events the same way nsThread does. It also encapsulates the functionality that DOM workers need to implement their special event loops (PushEventQueue and PopEventQueue). In later Quantum DOM work, I plan to have another SynchronizedEQ implementation for the main thread, called SchedulerEventQueue. It will have special code for the cooperatively scheduling threads in Quantum DOM.

There are two concrete implementations of AbstractEventQueue in this patch: EventQueue and PrioritizedEventQueue. EventQueue replaces the old nsEventQueue. The other AbstractEventQueue implementation is PrioritizedEventQueue, which uses multiple queues for different event priorities.

The final major piece here is ThreadEventTarget, which splits some of the code for posting events out of nsThread. Eventually, my plan is for multiple cooperatively scheduled nsThreads to be able to share a ThreadEventTarget. In this patch, though, each nsThread has its own ThreadEventTarget. The class's purpose is just to collect some related code together.

One final note: I tried to avoid virtual dispatch overhead as much as possible. Calls to SynchronizedEQ methods do use virtual dispatch, since I plan to use different implementations for different threads with Quantum DOM. But all the calls to EventQueue methods should be non-virtual. Although the methods are declared virtual, all the classes used are final and the concrete classes involved should all be known through templatization.

MozReview-Commit-ID: 9Evtr9oIJvx
2017-08-16 20:55:43 -07:00
Carsten "Tomcat" Book eea1986e03 merge mozilla-inbound to mozilla-central a=merge 2017-08-16 11:23:24 +02:00
Nicholas Nethercote 4d15e13fc4 Bug 1390036 (part 3) - Remove nsXPIDLString. r=erahm.
--HG--
extra : rebase_source : 87094fef8b919094926ec1be26867985a7fe8708
2017-08-14 15:25:04 +10:00
Masatoshi Kimura f7fb96c7e5 Bug 1390106 - Stop using versioned scripts in tests. r=jmaher
MozReview-Commit-ID: ErqU4M1f7Oj

--HG--
extra : rebase_source : 968490c3f787949324c44ba75b6daf5c346f54c3
2017-08-14 20:46:55 +09:00
Wes Kocher 7651bde05c Merge m-c to inbound, a=merge
MozReview-Commit-ID: 9Abf0fILvvK
2017-08-08 15:16:00 -07:00
Eric Rahm 65313fd340 Bug 1380154 - Part 1: Add the Chromium DAFSA generator. r=njn
This imports Chromium's `make_dafsa.py` script [1]. It takes in a gperf
formatted file (note: gperf is *not* required) and converts that to a compact
binary representation of the string data in the form of a deterministic
acyclic finite state automaton (DAFSA) [2].

The only change made to the script was to make it handle the arguments our
file generation script passes in to the `main` function.

It also imports the logic for traversing the DAFSA [3] almost verbatim in
`Dafsa.cpp`. A thin wrapper was added so that we can reuse the DAFSA structure
for multiple tables.

The only change made to the original logic was to swap in mozilla style
assertions and rename the not found constant from `kNotFound` to
`Dafsa::kKeyNotFound` in order to avoid a collision with `kNotFound` defined in
our nsString code.

[1] 6ba04a9056/tools/dafsa/make_dafsa.py
[2] https://en.wikipedia.org/wiki/Deterministic_acyclic_finite_state_automaton
[3] a2a90a35aa/net/base/registry_controlled_domains/registry_controlled_domain.cc (72)

MozReview-Commit-ID: Eion9POHZm5
2017-07-17 16:09:42 -07:00
Henry Chang 31e6f23f84 Bug 1355746 - Part 3. Test cases for IdleTaskRunner. r=smaug
MozReview-Commit-ID: 3RsC1pT9Fzc

--HG--
extra : rebase_source : 0e809780c75c9b8115e7242822ba1d44a1a0fe5d
extra : intermediate-source : 0a7daa942672d158b160b3e1af3ddbb88b36c953
extra : source : 08210ea8446bd222cda5c19ee326f8ffdbb65b3f
2017-07-12 14:13:44 +08:00
Sebastian Hengst a26fb8b04b Backed out changeset 9c41f1c5bcb8 (bug 1380154) for debug build bustage at xpcom/tests/gtest/TestExpirationTracker.cpp:83. r=backout on a CLOSED TREE 2017-08-07 21:43:08 +02:00
Eric Rahm 8075fcae90 Bug 1380154 - Part 1: Add the Chromium DAFSA generator. r=njn
This imports Chromium's `make_dafsa.py` script [1]. It takes in a gperf
formatted file (note: gperf is *not* required) and converts that to a compact
binary representation of the string data in the form of a deterministic
acyclic finite state automaton (DAFSA) [2].

The only change made to the script was to make it handle the arguments our
file generation script passes in to the `main` function.

It also imports the logic for traversing the DAFSA [3] almost verbatim in
`Dafsa.cpp`. A thin wrapper was added so that we can reuse the DAFSA structure
for multiple tables.

The only change made to the original logic was to swap in mozilla style
assertions and rename the not found constant from `kNotFound` to
`Dafsa::kKeyNotFound` in order to avoid a collision with `kNotFound` defined in
our nsString code.

[1] 6ba04a9056/tools/dafsa/make_dafsa.py
[2] https://en.wikipedia.org/wiki/Deterministic_acyclic_finite_state_automaton
[3] a2a90a35aa/net/base/registry_controlled_domains/registry_controlled_domain.cc (72)

MozReview-Commit-ID: Eion9POHZm5
2017-07-17 16:09:42 -07:00
Julian Seward 408d24da56 Bug 1382563 - Remove ns*String::AssignWithConversion. r=erahm.
This patch replaces four functions of the name AssignWithConversion which
are essentially wrappers around CopyASCIItoUTF16 and LossyCopyUTF16toASCII
with direct calls to the latter two functions.  The replaced functions are:

  void nsCString::AssignWithConversion( const nsAString& aData )
  void nsString::AssignWithConversion( const nsACString& aData )

  void nsTString_CharT::AssignWithConversion(
                            const incompatible_char_type* aData,
                            int32_t aLength = -1);

The last of the three exists inside the double-included nsTString* world and
so describes two functions, giving four in total.

This has two advantages:

* it removes code

* at the call points, it makes clear (from the replacement name) which
  conversion is being carried out.  The generic name "AssignWithConversion"
  doesn't make that obvious -- one had to infer it from the types.

The patch also removes two commented out lines from
editor/composer/nsComposerCommands.cpp, that appear to be related.  They are
at top level, where they would never have compiled.  They look like
leftovers from some previous change.

--HG--
extra : rebase_source : fb47bf450771c3c9ee3341dd14520f5da69ec4f5
2017-07-24 19:23:52 +02:00
Nathan Froyd a6c96367a7 Bug 1347963 - part 1 - introduce mozilla::RecursiveMutex; r=erahm
Having a proper recursively-acquirable mutex type makes intent clearer,
and RecursiveMutex also happens to be somewhat faster than
ReentrantMonitor.
2017-03-14 14:05:51 -04:00
Sylvestre Ledru 7c0ae251cd Bug 1381253 - Remove redundant control flow declarations rs=ehsan
MozReview-Commit-ID: FFxP4aMCbOL

--HG--
extra : amend_source : 3aec108430b11048f47ffe19d5da7ac5034770a9
2017-07-15 19:03:04 +02:00
Marco Castelluccio 0f9d4e1985 Bug 1380665 - Define MOZ_CODE_COVERAGE for the entire tree. r=jmaher 2017-07-13 19:12:23 +02: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
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 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
Wes Kocher ac0fd2038c Merge inbound to m-c a=merge
MozReview-Commit-ID: 3LXFVwSoMvs
2017-06-21 17:58:17 -07:00
Nathan Froyd 27c58cf89f Bug 1372670 - part 3 - add spinEventLoopUntil to nsIThreadManager; r=erahm,florian 2017-06-21 12:59:28 -04:00
Sebastian Hengst 0cbb4ac4e7 Backed out changeset 8cd0a75a643a (bug 1355746)
MozReview-Commit-ID: 1CxBzyDfpIP
2017-06-21 19:48:59 +02:00
Carsten "Tomcat" Book 8a1350b5a6 Backed out changeset 4f6302a98ae4 (bug 1372405)
--HG--
extra : rebase_source : 41632f3158e88e692809731394a683d065a73dfb
2017-06-21 13:59:26 +02:00
Henry Chang 2e272c0cd8 Bug 1355746 - Part 3. Test cases for IdleTaskRunner. r=smaug
MozReview-Commit-ID: 3RsC1pT9Fzc

--HG--
extra : rebase_source : d91cbd4da3c45c4d07159ecd80427d46fd10cd25
extra : intermediate-source : 59ea54d209ac6d47df340e9ff185b01f09afb995
extra : source : a14555b477d6c46d2ab75df7935d2af327e73cc3
2017-06-15 17:32:01 +08:00
Andreas Farre 43c18d7af3 Bug 1371274 - Add tests for NewIdleRunnable for classes without SetDeadline. r=froydnj
--HG--
extra : rebase_source : 9291a38f5533faf030b13d0c4e27dab06ddd5afe
2017-06-09 02:44:00 +02:00
Mats Palmgren e4f9fc369e Bug 1372317 part 3 - Remove nsBaseHashtable::LookupRemoveIf() since it's not used anymore. r=froydnj
Also, change the gtest to test Lookup() and Lookup().Remove()
in various forms.

MozReview-Commit-ID: 6AguNDhcR5W
2017-06-18 17:07:54 +02:00
Bill McCloskey 1158c7c282 Bug 1372733 - EventTargetFor should return an nsISerialEventTarget (r=bkelly)
MozReview-Commit-ID: Kchg4kqBERt
2017-06-15 20:16:25 -07:00
Jan de Mooij 83f290de99 Bug 1370608 part 1 - Move newEnumerate hook from ObjectOps to ClassOps. r=evilpie,bz 2017-06-14 10:37:44 +02: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
Mats Palmgren efb3f5fa2f Bug 1371094 part 2 - Add some tests for the LookupForAdd/OrInsert/LookupRemoveIf methods. r=froydnj
MozReview-Commit-ID: 4TgtCwyvBQt
2017-06-14 01:03:38 +02:00
Bill McCloskey 5066de8593 Bug 1366072 - MozPromise tests (r=jwwang)
MozReview-Commit-ID: 69OQb1f3UTd
2017-06-13 14:51:07 -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
Bill McCloskey 595e5d79c8 Bug 1361164 - Add nsISerialEventTarget (r=froydnj)
MozReview-Commit-ID: 8y1GdEGCPSB
2017-06-12 20:20:08 -07:00
Eric Rahm 32235488fc Bug 1370644 - Part 1: Only use NS_ERROR for an imminent failure. r=froydnj
This modifies the logic in |CheckAcquisition| to only call |NS_ERROR| if we're
really going to deadlock. Instead, if we detect a suspicious cycle, we just use
an |NS_WARNING|. This means that we'll still output warning text in debug
builds, but we won't cause the process to abort.

MozReview-Commit-ID: 71mFInWwbDY
2017-06-12 16:53:04 -04:00
Olli Pettay e4559f5c3b Bug 1368493, TimerThread::FindNextFireTimeForCurrentThread should look at timers in order, r=bkelly
--HG--
extra : rebase_source : a86b344380cbcd34d8930688eb90192846636dd8
2017-06-05 16:49:54 +03:00
Bryce Van Dyk 5d382edc2b Bug 1272371 - Add gtest to cover nsMultiplexInputStream set seek. r=froydnj
MozReview-Commit-ID: b3kTP3rerq

--HG--
extra : rebase_source : 3c760baa52a409eaf371d966fdaa293d3d53f81a
2017-05-30 11:27:18 +12:00
Ryan VanderMeulen 25cb66b774 Merge m-c to autoland on a CLOSED TREE. a=merge 2017-05-26 15:45:41 -04:00
Milan Sreckovic 831111d1d7 Bug 1361724: Remove unused offset parameter from StripChar, StripChars, StripTaggedASCII, StripCRLF. r=froydnj
MozReview-Commit-ID: 3MV5TFMxGjn

--HG--
extra : rebase_source : de7ee1fd36e1b18427c67d9ac6e98f50f780a498
2017-05-17 13:49:52 -04:00
Olli Pettay d9d7f6e11e Bug 1311425 - gtests for NS_GetTimerDeadlineHintOnCurrentThread, r=ehsan
--HG--
extra : rebase_source : 3c0164dac2d12705838fc6663bc8f824f17bbbea
2017-05-25 21:20:00 -04:00
Olli Pettay 67c78feadf Bug 1358476, add support for timeout when doing idle dispatch, tests, p=farre,smaug, r=nfroyd
--HG--
extra : rebase_source : 054bb7a4b7fdb41f255199bdc60a210149957292
2017-05-24 15:36:49 -04: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
Nathan Froyd d0e620966f Bug 1363172 - add mozilla::RWLock; r=erahm
This sort of lock is mostly useful in the context of Stylo right now,
but perhaps there are other applications waiting to be written.
2017-05-22 21:26:26 -04:00
Marco Castelluccio 11243e335a Bug 1353882 - Disable TestArenaAllocator.AllocationsPerChunk and TestArenaAllocator.MemoryIsValid tests in code coverage builds. r=jmaher
--HG--
extra : rebase_source : 7a77f473f4fde7794cd70c17d8fdc4e8aa847061
2017-05-16 10:39:22 +02:00
Milan Sreckovic 725d1c193f Bug 1358297: Part 3. Create special case for stripping CR and LF on TSubstring, and use it in all the places that it is called. Use ASCIIMask to make it fast. r=froydnj
MozReview-Commit-ID: 5ugh3Ma0OtH

--HG--
extra : rebase_source : 956a7a0535c3b7433fadfa65d0cfc26d9915f61a
2017-05-10 13:12:36 -04:00
Milan Sreckovic 40b6fdfb4b Bug 1358297: Part 2. Helper class to mask ascii characters, letting us do a faster test for membership in a string/character set. r=froydnj
MozReview-Commit-ID: 1s3mYNVThoD

--HG--
extra : rebase_source : d9c845addaa4a7a326b787a99f5cc83abb567848
2017-05-10 13:12:30 -04:00
Milan Sreckovic 0bf3678bac Bug 1358297: Part 1. Unit test, including performance, for Strip/CompressWhitespace. Also using AssignLiteral in other tests where appropriate. r=froydnj
MozReview-Commit-ID: 658BVB7TIRz

--HG--
extra : rebase_source : c39f1440bd80f912886d3574baedd2754e224d59
2017-05-10 13:12:24 -04:00
Wes Kocher 6d6d039d43 Backed out 4 changesets (bug 1358297) for hazard build failures a=backout
Backed out changeset 95211a496191 (bug 1358297)
Backed out changeset 3c1b426a5cce (bug 1358297)
Backed out changeset 9201d345a1d5 (bug 1358297)
Backed out changeset c926817dea60 (bug 1358297)

MozReview-Commit-ID: 874DF43K7Dp
2017-05-05 12:45:46 -07:00
Milan Sreckovic 196fb1a3bc Bug 1358297: Part 3. Create special case for stripping CR and LF on TSubstring, and use it in all the places that it is called. Use ASCIIMask to make it fast. r=froydnj
MozReview-Commit-ID: 3p97cCGfy6i

--HG--
extra : rebase_source : a91d9a5e6e61495cfe78b06959b200e48ca16535
2017-05-05 13:37:13 -04:00
Milan Sreckovic d26cf838c6 Bug 1358297: Part 2. Helper class to mask ascii characters, letting us do a faster test for membership in a string/character set. r=froydnj
MozReview-Commit-ID: Ht1HBggc6DI

--HG--
extra : rebase_source : 72f81e1fa588d7852c9b0b316a53e6274835526b
2017-05-05 13:37:05 -04:00
Milan Sreckovic 69d3bca435 Bug 1358297: Part 1. Unit test, including performance, for Strip/CompressWhitespace. Also using AssignLiteral in other tests where appropriate. r=froydnj
MozReview-Commit-ID: H7PZsLmTzkc

--HG--
extra : rebase_source : 208e781360d4c9dd1a39070a370466b9fc009f9b
2017-05-05 13:36:55 -04:00
Tom Tromey 99f4608655 Bug 1334278 - change mozilla::Smprintf to return a UniquePtr; r=froydnj
Change mozilla::Smprintf and friends to return a UniquePtr, rather than
relying on manual memory management.  (Though after this patch there are
still a handful of spots needing SmprintfFree.)

MozReview-Commit-ID: COa4nzIX5qa

--HG--
extra : rebase_source : ab4a11b4d2e758099bd0794d5c25d799a7e42680
2017-03-03 08:17:27 -07:00
Andrea Marchesini 7998eae548 Bug 1355369 - gtests for SlicedInputStream and ASyncWait, r=me 2017-04-12 13:49:08 +02:00
Eric Rahm f4d91001fe Bug 1351732 - Part 1: Add an ArenaAllocator strdup extension. r=froydnj
This adds an extension to ArenaAllocator that provides strdup-like
functionality for various string types.

MozReview-Commit-ID: 87SHTs6flHY
2017-03-30 16:46:56 -07:00
Eric Rahm 131c4c002f Bug 943156 - Add a templated ArenaAllocator. r=froydnj
This adds an arena allocator that can be used as a drop-in replacement for
NSPR's PLArena. Example usage for defining an 8-byte aligned allocator that
uses a 4K arena size:

mozilla::ArenaAllocator<4096,8> a;
void* memory = a.Allocate(200);
2017-03-30 16:46:55 -07:00
Carsten "Tomcat" Book 48d1be80d3 Merge mozilla-central to mozilla-inbound 2017-03-27 12:59:33 +02: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
JW Wang b45a420b3e Bug 1318226. P2 - add gtest TestTaskQueue to test the order of regular tasks. r=bholley
MozReview-Commit-ID: 9Eg2ALRsV9j

--HG--
extra : rebase_source : 7245dc59749598f631bae3be46e46661e11642f6
extra : intermediate-source : 4fd827e0797d7bc1ac19c81a6e0b7915cf154bfe
extra : source : a96d4417c994020fa8d3df33a894a89192033fe4
2016-11-17 14:25:53 +08: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
David Major af163b2b51 Bug 1346099: Fix a typo in the string splitter. r=dbaron
This just-so-happened to work because nobody refers to the splitter directly by name.

The added gtest doesn't actually prove that this patch fixes anything, but I figured we could use a wide string for good measure.

MozReview-Commit-ID: 1ADy4X44HO1
2017-03-13 11:19:49 +13:00
Dan Minor d6eb4d1229 Bug 1343557 - Make operator AutoCreateAndDestroyReentrantMonitor::ReentrantMonitor* const; r=bsmedberg
MozReview-Commit-ID: Fy3k5fvEs5J

--HG--
extra : rebase_source : 52b9939a66bc828ca2609921300026b65d54f8e5
2017-03-02 08:57:54 -05:00
Eric Rahm 3bec954d62 Bug 792209 - Remove nsISupportsArray. r=froydnj
MozReview-Commit-ID: G28VUoYj9Wj
2016-11-17 11:45:41 -08:00
Wes Kocher 8c4ce17711 Merge inbound to m-c a=merge
MozReview-Commit-ID: DCUf7VEDrTt
2017-02-17 13:38:51 -08:00
Honza Bambas af9b0f549f Bug 1340260 - Fix gtest Werror build bustage on a CLOSED TREE. 2017-02-17 12:35:59 -05:00
Honza Bambas 5d95d03e70 Bug 1340260 - Fix potentially wrong string returned from Tokenizer::ReadUntil, keep Record/Claim work after ReadUntil. r=froydnj
--HG--
extra : rebase_source : 1029f9b6743085b7865554fdedc1c96e9239b13a
2017-02-17 08:13:00 -05:00
Tom Tromey b18d4c7b9e Bug 1060419 - make TestPipes.cpp use Printf.h, r=froydnj
MozReview-Commit-ID: LMFNBYVoJZf

--HG--
extra : rebase_source : fb47a1aaf1371797cdd131f9157f8fd1d8f06e26
2016-12-09 10:53:35 -10:00
Bevis Tseng 1ebeb1002b Bug 1333997 - Part 3: Add Test Coverage for Named NewRunnable APIs. r=froydnj
--HG--
extra : rebase_source : 7038228e2744072d1b64f903ab6ae9ca2f053bef
2017-02-07 16:45:45 +08:00
Carsten "Tomcat" Book 092e5dc5f1 merge mozilla-inbound to mozilla-central a=merge 2017-02-07 14:08:46 +01:00
Honza Bambas 3a39b6dbee Bug 1322825 - Incremental tokenizer. r=froydnj 2017-02-06 10:49:00 -05:00
Gerald Squelart 213ba5c515 Bug 1336215 - Optimize iterator if nsDeque is const - r=froydnj
Handling potential nsDeque size changes means a bit of extra work.

But if the nsDeque is const, we can assume that it shouldn't get modified, so
we can provide a more optimized iterator that doesn't need to handle size
changes.

Optimizing a range-for loop in which the deque is not modified, can be done
by writing: `for (void* item : const_cast<const nsDeque&>(deque)) {...}`

MozReview-Commit-ID: AFupjoTsoH3

--HG--
extra : rebase_source : a71b09c9cb73787ce686c7c762f92ef0c208e76a
2017-02-03 13:08:10 +11:00