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

2831 Коммитов

Автор SHA1 Сообщение Дата
Masayuki Nakano 78077d5b3c Bug 1475461 - part 1: Mark PLDHashTable::Search() and called by it as const r=Ehsan
PLDHashTable::Search() does not modify any members.  So, this method and
methods called by it should be marked as const.

MozReview-Commit-ID: 6g4jrYK1j9E

--HG--
extra : rebase_source : eda6c50c538fec0e8c09cb2ba629735eea6ec711
2018-07-13 16:56:29 +09:00
Boris Zbarsky 8f7c90d6be Bug 1473149. Add an external string variant that keeps a DynamicAtom alive. r=njn,rwood
The change to call AsStatic() in SetKnownLiveAtom is drive-by performance cleanup.
2018-07-10 11:21:42 -07:00
Kris Maglione 94f26a6578 Bug 1457728: Support tri-state comparators in nsTArray. r=erahm
MozReview-Commit-ID: FC9GPsJJ03K

--HG--
extra : source : e2d3d7bb9d1f7150ec3be7f8507977f7378ec541
extra : amend_source : 23fe2a504342c2b548e1f01fc80b662ee16443dd
2018-04-28 15:15:04 -07:00
Andreea Pavel be1d77cb98 Backed out changeset e2d3d7bb9d1f (bug 1457728) for build bustages at build\build\src\xpcom\ds\nsTArray.h(807) on a CLOSED TREE 2018-07-07 22:55:25 +03:00
Kris Maglione cd92626ded Bug 1457728: Support tri-state comparators in nsTArray. r=erahm
MozReview-Commit-ID: FC9GPsJJ03K

--HG--
extra : rebase_source : e2384e8f98b76a55aece2358528e9d9cf0272e80
extra : histedit_source : 6d0d89de11127fafd62dda2b860a50ccbbfb583d
2018-04-28 15:15:04 -07:00
Ciure Andrei f61df5dc45 Backed out 4 changesets (bug 1461450, bug 1471726) for linting failure xpidl.py CLOSED TREE
Backed out changeset 6e8148c1ca7f (bug 1461450)
Backed out changeset 2a02d86bc113 (bug 1461450)
Backed out changeset 1907567a85c5 (bug 1471726)
Backed out changeset c4df8eab6d1c (bug 1471726)
2018-07-07 03:12:10 +03:00
Nika Layzell aa3038043c Bug 1461450 - Part 1: Add move constructors and assignment operators to nsTArray, r=froydnj 2018-07-06 19:53:06 -04:00
Gabriele Svelto 2d99f56b0e Bug 1469914 - Prevent the HAL from registering duplicate observers; r=froydnj
This also replaces the custom logic in ObserverList with an nsTObserverArray
which has all the necessary logic for stable iteration over a potentially
changing list of items. Unused dependencies were also removed.

--HG--
extra : source : 303478f7f248470a1c747f42dad9cb85c3129f0a
2018-06-22 00:35:08 +02:00
Dorel Luca 6140855547 Backed out changeset cd857f86810c (bug 1469914) for causing leaks on multiple tests. CLOSED TREE 2018-07-02 13:14:18 +03:00
Gabriele Svelto 30be205426 Bug 1469914 - Prevent the HAL from registering duplicate observers; r=froydnj
This also replaces the custom logic in ObserverList with an nsTObserverArray
which has all the necessary logic for stable iteration over a potentially
changing list of items. Unused dependencies were also removed.

--HG--
extra : source : 1a83516d2ee5939052c5fb226b81563a0d114ff9
2018-06-22 00:35:08 +02:00
Marcos Cáceres 60e5daf61c Bug 1468356 - Implement onpaymentmethodchange attribute. r=mrbkap
--HG--
extra : rebase_source : 220c160ce0a4ab0568285c276de7326d4a16da23
2018-06-30 10:11:00 +03:00
Stephen A Pohl 1f2e716a79 Bug 1466335: Automatically switch to the appropriate Firefox theme based on the macOS dark mode system preference. r=dao,mstange 2018-06-27 13:59:21 -04:00
Chris Peterson 2afd829d0f Bug 1469769 - Part 6: Replace non-failing NS_NOTREACHED with MOZ_ASSERT_UNREACHABLE. r=froydnj
This patch is an automatic replacement of s/NS_NOTREACHED/MOZ_ASSERT_UNREACHABLE/. Reindenting long lines and whitespace fixups follow in patch 6b.

MozReview-Commit-ID: 5UQVHElSpCr

--HG--
extra : rebase_source : 4c1b2fc32b269342f07639266b64941e2270e9c4
extra : source : 907543f6eae716f23a6de52b1ffb1c82908d158a
2018-06-17 22:43:11 -07:00
Coroiu Cristina d9d047381d Merge mozilla-central to autoland a=merge on a CLOSED TREE 2018-06-22 12:59:11 +03:00
Nicholas Nethercote 60b1f563cb Bug 1447951 - Store nsDynamicAtom's chars after the end of the object. r=froydnj
This reduces memory usage because we only need one allocation instead of two
for the dynamic atom and its chars, and because we don't need to store a
refcount and a size. It precludes sharing of chars between dynamic atoms, but
we weren't benefiting much from that anyway.

This reduces per-process memory usage by up to several hundred KiB on my
Linux64 box.

One consequence of this change is that we need to allocate + copy in
DOMString::SetKnownLiveAtom(), which could make some things slower.

--HG--
extra : rebase_source : ba4065ea31e509dd985c003614199f73def0596c
2018-06-22 09:38:42 +10:00
Arnaud Bienner 5fdd4661b7 Bug 1458446 - Add AudioWorkletNode interface definitions. r=baku,karlt
MozReview-Commit-ID: BLumJG4BDke

--HG--
extra : rebase_source : 1a507149cefb76cedbcc336d9b9ae6e0eebed59c
2018-06-01 19:10:02 +02:00
Andi-Bogdan Postelnicu 78304aaf0d Bug 1453795 - XPCOM - Initialize member fields in classes/ structures. r=froydnj
--HG--
extra : rebase_source : c9d9e80b83ad52d8ac9203f491f1c9469a7e9b0c
extra : amend_source : ca502ae98ff21a2e3d1ab2d389310f3a5aded5ed
2018-06-15 14:41:20 +03:00
Tokio Kajitsuka e1e329ad54 Bug 1462465 - Cache AccessibleNode in Node. r=surkov,smaug
Cache AccessibleNode and make it able to operate the same instance by nsINode::GetAccessibleNode

--HG--
extra : rebase_source : 063eec8658af020f5408260d7d581ee76a04bd37
2018-05-26 22:47:48 +09:00
Sylvestre Ledru 34a5216fe7 Bug 1464869 - Run autopep8 on xpcom/ r=Nika
MozReview-Commit-ID: JDdoIvkmOIx

--HG--
extra : rebase_source : c23ee8d3da399dd837eccf6a63a50cd50f5e81c6
2018-05-25 21:29:52 -07:00
Joanmarie Diggs df8c297289 Bug 1466822 - Implement support for new blockquote, caption, and paragraph ARIA roles r=Jamie
* Create BLOCKQUOTE internal role (also needed for correct exposure of
  blockquote element on ATK)
* Add new ARIA roles to internal ARIA map
* Add new roles to existing ARIA roles mochitest and update blockquote
  element test to reflect mapping to the new internal role
2018-06-05 09:54:00 +03:00
Tiberius Oros bd7f417d6a Backed out changeset 671ec6415311 (bug 1466822) for failing test_txtcntr.html on a CLOSED TREE 2018-06-05 19:10:13 +03:00
Joanmarie Diggs 9ef9fae7c4 Bug 1466822 - Implement support for new blockquote, caption, and paragraph ARIA roles. r=surkov
* Create BLOCKQUOTE internal role (also needed for correct exposure of
  blockquote element on ATK)
* Add new ARIA roles to internal ARIA map
* Add new roles to existing ARIA roles mochitest and update blockquote
  element test to reflect mapping to the new internal role
2018-06-05 06:46:00 -04:00
Emilio Cobos Álvarez 1e9c395548 Bug 1466168: Remove mozilla::Forward in favor of std::forward. r=froydnj
Same approach as the other bug, mostly replacing automatically by removing
'using mozilla::Forward;' and then:

  s/mozilla::Forward/std::forward/
  s/Forward</std::forward</

The only file that required manual fixup was TestTreeTraversal.cpp, which had
a class called TestNodeForward with template parameters :)

MozReview-Commit-ID: A88qFG5AccP
2018-06-02 09:33:26 +02:00
Paolo Amadini 61cbbdb92c Bug 1457719 - Part 4 - Remove the "autorepeatbutton" element. r=bz
The DoMouseClick helper is also removed because no other caller can now pass a null aEvent. Other MouseClicked implementations are also updated since aEvent cannot be null, which was already the case.

MozReview-Commit-ID: 3bTJ6cZW9ZA

--HG--
extra : rebase_source : ae1bafe7144f6f428e2ef4e7047d5c64e0a19e8c
2018-06-01 11:15:56 +01: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
Honza Bambas 38ced61e49 Bug 1463786 - Make mozilla::Tokenizer work also with char16_t, r=froydnj 2018-05-31 03:40:00 +03:00
Gabriele Svelto 08f7efc25a Bug 1464252 - Remove global observers functionality from the observer service; r=froydnj
MozReview-Commit-ID: HGtG3obDryw

--HG--
extra : rebase_source : fd73d6da5727ca01f6e71fed8d4dc95751d3a7a0
2018-05-24 23:58:31 +02:00
Kristen Wright 5e4b4031fc Bug 1462138 - Part 1: Add a memory reporter for nsStringBundleService. r=erahm
Added memory reporter in nsStringBundleService. Added SizeOfIncluding/ExcludingThis functions in IStringBundle, StringBundle, ExtensibleStringBundle, PersistentProperties, StringBundleTextOverride.

--HG--
extra : rebase_source : 0756ed2181f02ffe42dd94db282ddf3dfa59047c
2018-05-18 13:16:31 -07:00
Kris Maglione 54d867ef69 Bug 1456485: Part 2 - Allow extensions with the mozillaAddons permission to match restricted schemes. r=zombie
The schema handling for this is currently a bit ugly, for the sake of
simplifying uplift. In the figure, we should find a way to change the schema
pattern matching based on whether or not the extension is privileged.

MozReview-Commit-ID: CU9WR2Ika6k

--HG--
extra : rebase_source : 28e1c43cf0f0efc01b40757e4e65c4ac5d882258
2018-05-09 18:55:59 -07:00
Emilio Cobos Álvarez f47a8a463b Bug 1451256: Make toolbarpaletteitem always use box layout. r=dholbert
It doesn't really need the button magic.

MozReview-Commit-ID: 390aozlyYZa
2018-05-22 21:55:01 +02:00
Randell Jesup 27aae0dbeb Bug 1425930: Handle Broadcast()->Notify() calling RemoveObserver() r=froyd 2018-05-21 15:30:35 -04:00
Andreea Pavel 229a6df6d4 Backed out changeset 9d111a95cfbb (bug 1425930) for build bustages at ../testing/xpcshell/selftest.py::XPCShellTestsTests::testAddTaskSki on a CLOSED TREE 2018-05-21 18:01:29 +03:00
Randell Jesup ae19cc881a Bug 1425930: Handle Broadcast()->Notify() calling RemoveObserver() r=froyd 2018-05-21 10:35:08 -04:00
Coroiu Cristina 7917fae007 Backed out changeset 4dce0b1b22af (bug 1425930) for causing build bustage on a CLOSED TREE 2018-05-20 23:16:12 +03:00
Randell Jesup ceedbeadd3 Bug 1425930 - Handle Broadcast()->Notify() calling RemoveObserver(). r=froyd
--HG--
extra : rebase_source : 87dc3560125bbb6c77215777753c9fbc2a34e7f6
2018-05-18 11:15:30 -04:00
Markus Stange 3c2f4b195e Bug 1460733 - Rename nsTArrayHeader::sEmptyHdr to extern "C" { sEmptyTArrayHeader } so that thin-vec can link with it. r=froydnj
MozReview-Commit-ID: CjaE7udG9m2

--HG--
extra : rebase_source : 83f36ecf7fe96c6207575ce222a807a629866168
2018-05-10 16:37:27 -04:00
Csoregi Natalia f034c0ab5d Merge mozilla-central to inbound. a=merge CLOSED TREE 2018-05-10 12:52:31 +03:00
Kris Maglione 27f3639e38 Bug 1460416: Remove unused static atoms. r=froydnj
These were found using some ugly text searches, so it's possible some unused
atoms remain. In the future, we should enforce removing unused atoms using
static analysis. Or just generate the static atoms table based on string atom
names in our code.

This patch leaves unused RDF atoms in place, since those are being dealt with
in another bug.

MozReview-Commit-ID: 1KpH9KsHzQy

--HG--
extra : rebase_source : 8138faa2b16e847da31861abae2bbc1c7bac4e02
2018-05-09 13:28:05 -07:00
Brendan Dahl 295e2f4aca Bug 1453788 - Allow top level HTML windows to have persistent window state. r=smaug
Move tracking of persistent window state into nsXULWindow. Also, move
special handling of the width/height of the window into nsXULWindow.

MozReview-Commit-ID: LOmHGyYeNSU

--HG--
extra : rebase_source : bcea16eb6209ff789948644a64968a7325cea4ef
2018-04-26 17:53:54 -07:00
Chris Peterson 71422dcaa9 Bug 1457813 - Part 2: Replace non-asserting NS_PRECONDITIONs with MOZ_ASSERTs. r=froydnj
s/NS_PRECONDITION/MOZ_ASSERT/ and reindent

MozReview-Commit-ID: KuUsnVe2h8L

--HG--
extra : source : c14655ab3df2c9b1465dd8102b9d25683359a37b
2018-04-28 12:50:58 -07:00
Kris Maglione a259026c9d Bug 1456035: Part 4 - Convert callers of XPCOMUtils.generateQI to ChromeUtils.generateQI. r=mccr8
This also removes any redundant Ci.nsISupports elements in the interface
lists.

This was done using the following script:

acecb401b7/processors/chromeutils-generateQI.jsm

MozReview-Commit-ID: AIx10P8GpZY

--HG--
extra : rebase_source : a29c07530586dc18ba040f19215475ac20fcfb3b
2018-04-22 20:55:06 -07:00
Emilio Cobos Álvarez 0faef276ec Bug 1455885: Make the SVG context paint not use a node property, but a member in SVGDocument. r=jwatt
MozReview-Commit-ID: H6SRTsDL5Rh
2018-04-26 17:07:39 +02: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
Matt Woodrow a6e9002c24 Bug 1406727 - Improve diagnostics in BuildDisplayList. r=froydnj
MozReview-Commit-ID: Ctb7HFxgPac

--HG--
extra : rebase_source : 696683a6a905e0f4862e0a7f8a9708c487e5248b
2018-02-06 12:21:31 +13:00
Nika Layzell 14da321a67 Bug 1444745 - Part 5: Update consumers of nsIInterfaceInfo to use the nsXPTInterfaceInfo directly, r=mccr8
Due to the decision to keep the old API on nsXPTInterfaceInfo in part 4, this is
a fairly straightforward patch.

1. I had to change a couple of consumers of `IsRetval()` due to the movement of
that flag.
2. I changed all code which held a nsIInterfaceInfo to hold an `const
nsXPTInterfaceInfo*` instead.
3. I changed code which used the nsIInterfaceInfoManager to instead call the
static methods on nsXPTInterfaceInfo.
2018-04-17 19:20:56 -04:00
Margareta Eliza Balazs dbef13782c Backed out 2 changesets (bug 1451278) for breaking windows pgo builds a=backout
Backed out changeset ac685df07bfc (bug 1451278)
Backed out changeset 5944ccd5060d (bug 1451278)
2018-04-16 21:41:03 +03:00
Nicholas Nethercote e1318b1d03 Bug 1451278 - Remove ConstExpr hash functions. r=froydnj
MozReview-Commit-ID: L6yRyt4DZRR

--HG--
extra : rebase_source : 2d56a50b1a99e66c397165b9b851e23ca66d97a0
2018-04-16 08:37:15 +10:00
Jeff Walden 821db93ccc Bug 1453456 - Replace nsCRT::IsAscii{Alpha,Digit} with mfbt/TextUtils.h versions. r=froydnj
--HG--
extra : rebase_source : b31986c0e6828be79442cfb0cf369eb80c232139
2018-04-12 20:19:30 -07: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
Eric Rahm 098e642086 Bug 1452202 - Clean up PLDHashTable move operator. r=froydnj
--HG--
extra : rebase_source : 2fe44e09de738ffa827b8c7fd51162eaa8c53890
2018-04-09 11:01:59 -07:00
Tristan Bourvon a3a77c0312 Bug 525063 - Initialize uninitialized class attributes in m-c. r=ehsan 2018-04-10 21:11:02 +02:00
Venkatesh Pitta 2c25ef1a1c Bug 1427025 - Remove nsCRT::memmem. r=froydnj 2018-04-10 04:47:52 +10:00
Eric Rahm 691c3159a1 Bug 1452288 - Use calloc for allocating PLDHashTable entries. r=froydnj
--HG--
extra : rebase_source : 73f3aba71dc8ad8bc23786153f2a22cdbf86f8dd
2018-04-06 16:51:58 -07:00
Bobby Holley 2b985ab718 Bug 1451421 - Add a ToLowerCaseASCII utility method for nsAtom. r=hisvonen 2018-04-06 15:30:15 -07:00
Paolo Amadini 44e022ac15 Bug 1451782 - Remove unused properties of XULElement. r=bz
This removes properties of XULElement that can easily seen to be unused, even if the attributes they control are still in use. There are other properties that may still be used once or twice, and they are not removed here.

MozReview-Commit-ID: IL6mCvtGQAG

--HG--
extra : rebase_source : 4b22b330d311ef22e3466f517c04d5a19512ab71
2018-04-05 17:10:28 +01: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
Honza Bambas 951c3c0c9e Bug 1441726 - Include CacheStorageService::mPurgeTimeStamps hashtable in the memory reporter. r=michal 2018-03-27 10:21:00 +03:00
Nicholas Nethercote 380782f6b6 Bug 1445113 - Disallow duplicate static atoms. r=froydnj
This will allow us to work with direct pointers to static atoms that are
initialized at compile-time, rather than pointers to pointers to static atoms
that are initialized at runtime.

MozReview-Commit-ID: K04pEicuqu3

--HG--
extra : rebase_source : c5d895b34567c621f4591769390fc95a4c6ff405
2018-03-29 05:54:10 +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
Markus Stange ec65624c9e Bug 1335191 - Remove support for the attributes "activetitlebarcolor" and "inactivetitlebarcolor" for XUL window elements. r=emilio
The last piece of code that was using these attributes was removed in
https://hg.mozilla.org/mozilla-central/rev/35b7fa5ebd58

MozReview-Commit-ID: FyF7kzlpqMz

--HG--
extra : rebase_source : edaf64a4be92be1f72ff67f90c03eed09173cce3
2018-03-24 01:14:23 -04: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
Timothy Guan-tin Chien 8bc65dd64e Bug 1446157 - Remove unused grippy binding r=enndeakin+6102
MozReview-Commit-ID: KWC9HpTzig

--HG--
extra : rebase_source : 7b6b24330d072d5126851c63614ba91f4315ddc9
2018-03-20 17:21:19 +08:00
Andreea Pavel 62b7a93603 Backed out 3 changesets (bug 1446157) for browser chrome failures at browser/base/content/test/static/browser_all_files_referenced.js on a CLOSED TREE
Backed out changeset 2491f8caeffa (bug 1446157)
Backed out changeset be65061c2d72 (bug 1446157)
Backed out changeset de560a993de1 (bug 1446157)
2018-03-22 18:49:31 +02:00
Timothy Guan-tin Chien aa45f889db Bug 1446157 - Remove unused grippy binding r=enndeakin+6102
MozReview-Commit-ID: KWC9HpTzig

--HG--
extra : rebase_source : 382083ebb3fd2d1b10c70df314bd67ce5ded1f08
2018-03-20 17:21:19 +08:00
Peter Van der Beken 5ad9618d7c Bug 888600 - Move ContentFrameMessageManager to WebIDL. Part 4: Convert MessageManager to WebIDL. r=bz.
--HG--
extra : rebase_source : aa7aa3a5f720b5a4f6ff88e41eb9e80ffb9092cd
2017-06-20 11:09:50 +02:00
Nicholas Nethercote 2211e2da6f Bug 1446865 - Rename various AddRefTable() functions as RegisterStaticAtoms. r=froydnj
These functions no longer perform any refcounting, so the existing names are
misleading.

MozReview-Commit-ID: LX55e0bUP8N

--HG--
extra : rebase_source : 89a3da577325286c1d31723acfd4153754f49703
2018-03-20 13:01:30 +11:00
Nicholas Nethercote db20ce5cdf Bug 1446865 - Introduce nsStaticAtomUtils::Lookup. r=froydnj
This function captures a common usage pattern, generalizing the existing
IsMember() function.

MozReview-Commit-ID: 5Pt7kqyGD6Y

--HG--
extra : rebase_source : b03e4cc8f5a4a25da9236420f4b64493664b70e0
2018-03-20 13:01:28 +11:00
Nicholas Nethercote b719af74df Bug 1446865 - Move nsAtomListUtils. r=froydnj
It seems silly to have a tiny utils class with a single function in its own
module. This patch moves it into nsStaticAtom.h/nsAtomTable.cpp. It also
renames nsAtomListUtils as nsStaticAtomUtils. Finally, it uses templates to
remove the need for the `aCount` parameter at callsites.

MozReview-Commit-ID: DvJVoZFv89c

--HG--
extra : rebase_source : 1f1dd27d56e46c71c30c10102ac6132a721e23d1
2018-03-20 11:44:28 +11:00
Emilio Cobos Álvarez 500ff7c746 Bug 1446342: Don't include forms in the scope chain for XBL datetime bindings. r=smaug
Reviewers: smaug

Bug #: 1446342

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

MozReview-Commit-ID: HK7nChYf0X6
2018-03-20 01:34:09 +01:00
Boris Zbarsky 46fc331568 Bug 1446097. Switch to "set" as the canonical nsGkAtoms name of the string "set", so it matches the actual tag name "set" in SVG. r=hsivonen,njn
Most of the noise is from the fact that clang-format on parser/html/*.{h,cpp}
reformatted all sorts of stuff.  Not running it caused lots of format changes
from the generator... I guess we changed the format rules since the last time
this got run?

MozReview-Commit-ID: IA2G87zUIKN
2018-03-16 11:26:06 -04:00
Andrew Osmond 03ddb93873 Backed out changeset 8f16d20b0a3b (bug 1433351) for build bustage on a CLOSED TREE. 2018-03-15 11:18:35 -04:00
Andrew Osmond 866a8daa39 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-15 10:33:40 -04:00
Nicholas Nethercote e303a46fae Bug 1445142 - Remove DefaultAtoms. r=froydnj
Now that nsGkAtoms is in xpcom/, we can call nsGkAtoms::AddRefAtoms() from
NS_InitAtomTable(), which removes the need for DefaultAtoms, and also removes a
duplicate static atom.

MozReview-Commit-ID: CyfvnvZomzZ

--HG--
extra : rebase_source : 53ead62323a340038c1b4594b1a3eb225aa19626
2018-03-14 11:11:02 +11:00
Nicholas Nethercote 23f8a3de52 Bug 1445142 - Move nsGkAtoms into xpcom/. r=froydnj
This list of atoms isn't particularly DOM-ish, and having it in xpcom/ will
help with the next patch.

MozReview-Commit-ID: 1Y3Fhn9lNbh

--HG--
rename : dom/base/nsGkAtomList.h => xpcom/ds/nsGkAtomList.h
rename : dom/base/nsGkAtoms.cpp => xpcom/ds/nsGkAtoms.cpp
rename : dom/base/nsGkAtoms.h => xpcom/ds/nsGkAtoms.h
extra : rebase_source : 0a0f6ab4432e0d58ea4662299b750a8c52325ad5
2018-03-14 11:10:55 +11:00
Blake Kaplan 05cd548863 Bug 1326028 - Allow moving a reference into nsInterfaceHashtable. r=smaug
Without this patch, it's impossible for clients to move a reference into an
nsInterfaceHashtable. That causes at least one extra addref/release pair when
they otherwise could. With this patch, a client can do `hashTable.Put(key,
comptr.forget());` to avoid the additional refcounting.

MozReview-Commit-ID: Ghm7n41ziZp

--HG--
extra : rebase_source : a3e842bf9dfe202134c58e447ecf4fa79851c076
2018-02-22 14:09:26 -08:00
Andrea Marchesini 5784769019 Bug 1443079 - nsScriptError.isFromPrivateWindow must match the correct value also in e10s mode, r=smaug 2018-03-13 06:40:38 +01:00
Bas Schouten 0d91fc49fd Bug 1444200: Explicitly call the parent class default constructor from AutoTArray's copy constructor. r=froydnj
MozReview-Commit-ID: 5alSZfYJxmV
2018-03-09 05:27:14 +01:00
Nicholas Nethercote 0e2f1f5ab8 Bug 1444031 - Rename nsStaticAtom::mAtom as mAtomp. r=froydnj
Because (a) that name better indicates that it's a pointer to a pointer, and
(b) because nsStaticAtom::mString is going to be renamed as mAtom in bug
1411469.

MozReview-Commit-ID: D5tuNOstMgr

--HG--
extra : rebase_source : 9344eeea0288c8c52c069ce21e8bc55f6e0f3f6f
2018-03-08 11:42:06 +11:00
Nicholas Nethercote 8ac9830be0 Bug 1444031 - Rename Is{Static,Dynamic,HTML5}Atom. r=froydnj
By removing the "Atom" suffix, which is redundant.

MozReview-Commit-ID: 4MCX9Icfjrw

--HG--
extra : rebase_source : c3c759a508a8938b59d36dbb20448d2964b98c91
2018-03-07 15:17:34 +11:00
Nicholas Nethercote ba2ac04f54 Bug 1442433 - Make nsAtom::mString even more const. r=froydnj
MozReview-Commit-ID: ANm2nrnO4Lb

--HG--
extra : rebase_source : 444f72316f047004cddfc2eef947b122db1cb87d
2018-03-07 11:59:01 +11:00
Nicholas Nethercote 9bc7f17b9e Bug 1442433 - Make nsAtom::mString more const. r=froydnj
The patch also uses GetStringBuffer() in a couple of appropriate places.

MozReview-Commit-ID: JufCUgmO8JL

--HG--
extra : rebase_source : ecd3f17b5560b19622c86759d605fa122d70e48a
2018-03-07 11:57:54 +11:00
Nicholas Nethercote f39f6d1228 Bug 1442433 - Make some nsAtom fields `const`. r=froydnj
Also remove the unused SetKind() method.

MozReview-Commit-ID: CIh6BmN7OLI

--HG--
extra : rebase_source : 149b9e9ef1180e074b13fd5812ea8dbf2f907bb4
2018-03-05 13:54:06 +11:00
Nicholas Nethercote aa19ca1709 Bug 1442433 - Remove the refcount from static atoms. r=froydnj
The refcount is only used for dynamic atoms.

On 64-bit, this reduces sizeof(nsStaticAtom) from 24 bytes to 16 bytes, and the
on-heap size from 32 bytes to 16 bytes. This saves 42 KiB per process.

On 32-bit, this reduces sizeof(nsStaticAtom) from 16 bytes to 12 bytes, but the
on-heap size stays at 16 bytes, so memory usage is unchanged.

MozReview-Commit-ID: 7d9H7MRHN9a

--HG--
extra : rebase_source : d3eafb3aaf44a592afd6c89cd0519d043056e65a
2018-03-05 13:54:06 +11:00
Andrew McCreight e1a6f8c267 Bug 1442295 - Add two missing includes in XPCOM. r=erahm
nsTArray.h needs mozalloc.h for moz_xmalloc

nsTStringRepr.h needs fallible.h for fallible

MozReview-Commit-ID: 9jz2pGPXMHk
2018-03-01 11:03:00 +02: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
Sebastian Hengst 6098a3cc4d merge mozilla-central to mozilla-inbound. CLOSED TREE 2018-03-01 12:29:42 +02:00
Sebastian Hengst 3a10644021 Backed out 6 changesets (bug 888600) for beta simulation failures: build bustage on Linux and Windows opt (bug 1442036) and devtools failure browser_net_view-source-debugger.js (bug 1441961). a=backout
Backed out changeset 83c87140dc3d (bug 888600)
Backed out changeset 2efb9b1753f6 (bug 888600)
Backed out changeset af5303781961 (bug 888600)
Backed out changeset 79ef59047e63 (bug 888600)
Backed out changeset 30d568d628dd (bug 888600)
Backed out changeset c7bd4c6c9741 (bug 888600)

--HG--
extra : histedit_source : 791b22f6770f4fead2f909478a93d65d85829fe0%2Cbb387309e90f53e1dde45dcf8cf4ebedcc6e5c5e
2018-03-01 11:51:09 +02:00
Nicholas Nethercote 50976e53e0 Bug 1441714 - Respect the 80 line char style rule better in nsAtomTable.cpp. r=froydnj
This mostly affects comments; some are too long, some could be longer.

MozReview-Commit-ID: HprR0sIDZwU
2018-02-28 10:57:18 +11:00
Nicholas Nethercote e340c5594b Bug 1441714 - Remove two unused AtomTableKey consructors. r=froydnj
MozReview-Commit-ID: FSsdDYxQHTW
2018-02-28 10:57:02 +11:00
Nicholas Nethercote f76d17db0f Bug 529808 - Remove the static atom table. r=froydnj
Various atom-related things have improved recently.

- The main atom table is now threadsafe (bug 1275755) and so can be accessed on
  any thread. It has also been split into pieces (bug 1440824), which greatly
  reduces lock contention.

- A cache has been added to the HTML5 parser (bug 1352874) that removes the
  need for most of the full table lookups.

As a result, there is no point having a separate static atom table. This patch
removes it.

MozReview-Commit-ID: 8ou1BrnPAwd

--HG--
extra : rebase_source : 0c6ab073b1a20b703705582d28731a68456741e1
2018-02-28 07:34:12 +11:00
Nicholas Nethercote 7ac2324679 Bug 1441430 - Provide more detail about atoms memory usage. r=froydnj
The old output had a single value: "atoms-table". The new output looks like
this:

> 649,904 B (00.39%) -- atoms
> ├──350,256 B (00.21%) -- dynamic
> │  ├──235,056 B (00.14%) ── unshared-buffers
> │  └──115,200 B (00.07%) ── atom-objects
> ├──212,992 B (00.13%) ── table
> └───86,656 B (00.05%) ── static/atom-objects

MozReview-Commit-ID: 924vUmxHAlh

--HG--
extra : rebase_source : 6c977546a69eeee62ebc87e335982e8278217484
2018-02-28 11:05:07 +11:00
Eric Rahm 694ff7ca49 Bug 1432323 - Refactor operator new in nsArrayEnumerator. r=froydnj
--HG--
extra : rebase_source : 9df6db9f17e14eff2f79cd29599b03619068cef3
2018-02-22 12:38:15 -08:00
Peter Van der Beken e9ab02acb0 Bug 888600 - Move ContentFrameMessageManager to WebIDL. Part 4: Convert MessageManager to WebIDL. r=bz.
--HG--
extra : rebase_source : 21a04b112c838f100afe28bc31265130900703da
2017-06-20 11:09:50 +02:00
arthur.iakab 9bffb6aa72 Merge inbound to mozilla-central. a=merge 2018-02-27 11:58:55 +02:00
Bobby Holley b54cbd7921 Bug 1440824 - Enable multiple hashtables for atoms. r=froydnj
MozReview-Commit-ID: Hj8gKPap0cR
2018-02-26 18:44:39 -08:00
Bobby Holley 62b82589a5 Bug 1440824 - Overhaul the atom infrastructure to support multiple subtables. r=froydnj
MozReview-Commit-ID: E1bcchzuMOu
2018-02-26 18:44:38 -08:00
Bobby Holley 1a54fdfd7a Bug 1440824 - Move some code around. r=froydnj
MozReview-Commit-ID: 4uMktcaYwWW
2018-02-26 18:44:38 -08:00
Eric Rahm e8e3e9a5e7 Bug 1440808 - Cleanup error handling in nsXULPrototypeDocument::Read. r=mccr8
This converts from the odd `tmp` for `rv` pattern and just returns immediately
on failure instead.

--HG--
extra : rebase_source : 1ad5882c1411e9e10f99201b6233ed87c71a20cc
2018-02-22 11:33:20 -08: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
Xidorn Quan 56145e003a Bug 1435944 part 1 - Add ToAddRefed() for nsStaticAtom. r=froydnj
MozReview-Commit-ID: 80HginrqhOi

--HG--
extra : rebase_source : ddd069bc6eb81583f324185dc39d01fc1f5ac6d1
extra : source : 1ff105f064173fa84db031400cc0f95bbf67dfef
2018-02-08 13:50:42 +11:00
Andrew McCreight 5dec0e0beb Bug 1432992, part 1 - Remove definitions of Ci, Cr, Cc, and Cu. r=florian
This patch was autogenerated by my decomponents.py

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

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

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

MozReview-Commit-ID: DeSHcClQ7cG

--HG--
extra : rebase_source : d9c41878036c1ef7766ef5e91a7005025bc1d72b
2018-02-06 09:36:57 -08:00
Nathan Froyd 13f6115da5 Bug 1435702 - specialize copying nsTHashtable elements where possible; r=mystor
This saves us a function call to memcpy when the compiler inlines the
memcpy, which is pretty common.
2018-02-05 16:18:12 -05:00
Kris Maglione 918ed6c474 Bug 1431533: Part 5a - Auto-rewrite code to use ChromeUtils import methods. r=florian
This was done using the following script:
37e3803c7a/processors/chromeutils-import.jsm

MozReview-Commit-ID: 1Nc3XDu0wGl

--HG--
extra : source : 12fc4dee861c812fd2bd032c63ef17af61800c70
extra : intermediate-source : 34c999fa006bffe8705cf50c54708aa21a962e62
extra : histedit_source : b2be2c5e5d226e6c347312456a6ae339c1e634b0
2018-01-29 15:20:18 -08:00
Daniel Holbert 1e76715d6d Bug 1433584: Fix misleading nsTArray::SetCapacity documentation to avoid implying that its arg is a delta. r=froydnj
DONTBUILD because comment-only

MozReview-Commit-ID: 8cr092aAJSm

--HG--
extra : rebase_source : 730be11254e22a81cca78911813444b366e16eaa
2018-01-26 14:24:48 -08:00
Nika Layzell 0c171ce388 Bug 1431122 - Part 1: Add UnorderedRemoveElement[s]At to nsTArray, r=froydnj
MozReview-Commit-ID: H0oqG7H7299
2018-01-23 17:27:35 -05: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
Matt Woodrow dfb1aaac57 Bug 1421345 - Check the canary during allocations. r=jet
--HG--
extra : rebase_source : c5b0710a9cbb07d6024a69fe238d29d0bf1747c5
2018-01-17 12:07:34 +13: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
Adrian Wielgosik 1e20a980f6 Bug 1361815 - Do less work in nsTArray's Clear() and destructor. r=froydnj
MozReview-Commit-ID: DnkE7LFxkF3
2018-01-12 11:26:55 +01:00
Masatoshi Kimura 8b05ff3704 Bug 1427023 - Remove nsCRT::strncmp. r=erahm 2018-01-09 23:49:37 +09: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
Mike Hommey a1947c3098 Bug 1423119 - Remove the sole use of MOZALLOC_HAVE_XMALLOC. r=erahm
When this was added, the xpcom glue was still a thing, and there was a
distinction between things that would build with mozalloc available and
others. There is no such distinction anymore. Anything that has access
to xpcom has access to infallible allocator functions.

--HG--
extra : rebase_source : 04bce114e940c53709275d0354ea7240df4a051e
2017-12-05 17:45:20 +09:00
Matt Woodrow aab0cbe92c Bug 1406727. r=froydnj 2017-11-16 16:09:28 +13:00
Narcis Beleuzu af710e4746 Backed out changeset 0f783930e1b2 (bug 1406727) for GTest failures on ArenaAllocator. r=backout on a CLOSED TREE 2017-11-16 07:45:06 +02:00
Matt Woodrow 5e1a10f3be Bug 1406727. r=froydnj 2017-11-16 16:09:28 +13:00
Blake Kaplan a64ff6d116 Bug 1417279 - Remove an odd second case from nsArray::IndexOf. r=froydnj
Now that nsArray uses nsCOMArray under the hood, we don't have to do weird
ForwardEnumeration hacks to start IndexOf at a non-zero index.

MozReview-Commit-ID: 3ReDV0BT0hn

--HG--
extra : rebase_source : 399a988d00fabaa314eb7592b2aacf277a2ca477
2017-11-14 16:34:42 -08:00
Julian Seward b9b2ff68ea Bug 1415637 - Possibly incorrect MOZ_MAKE_MEM_UNDEFINED in nsTHashtable copy constructor. r=froydnj.
--HG--
extra : rebase_source : 7b9e456c52d0cca67984cd261afcae1f57356995
2017-11-10 11:23:12 +01:00
Matt Woodrow 27911d9e0c Bug 1406727 - Add more assertions. r=froydnj, r=francois
MozReview-Commit-ID: JT9lMXAI9GT
2017-11-01 16:20:51 +13: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
Nicholas Nethercote 8ad99dd7fa Bug 1411893 - Introduce nsStaticAtom. r=emilio,froydnj.
It's a sub-class of nsAtom, useful for cases where you know you are dealing
exclusively with static atoms. The nice thing about it is that you can use
raw nsStaticAtom pointers instead of RefPtr<>. (In fact, the AddRef/Release
implementations ensure that we'll crash if we use RefPtr<nsStaticAtom>.)

MozReview-Commit-ID: 4Q6QHX5h44V

--HG--
extra : rebase_source : e4237f85b4821b684db0ef84d1f9c5e17cdee428
2017-10-27 10:31:13 +11:00
Sylvestre Ledru ae9444af4d Bug 1411034 - Remove the const to fix the -Wignored-qualifiers warning r=erahm
MozReview-Commit-ID: 8AvGwUQsdE8

--HG--
extra : rebase_source : 25b61a81b83ff3fa65ab15a23af92a56e3a6be12
2017-10-23 22:42:35 +02:00
Sebastian Hengst 364d36fab2 merge mozilla-inbound. r=merge a=merge
MozReview-Commit-ID: B09kHrHK42C
2017-10-23 23:50:37 +02:00
Nicholas Nethercote 3842370ed8 Bug 1405541 (attempt 2) - Split AUTO_PROFILER_LABEL_DYNAMIC into three macros. r=mstange.
It's easy to mess up the scoping so that (a) the label is pushed and then
immediately popped, and/or (b) the string doesn't live long enough. It's also
easy to do a utf16-to-utf8 conversion unnecessarily when the profiler is
inactive. This patch splits that macro into three new ones that are harder to
mess up.

- AUTO_PROFILER_LABEL_DYNAMIC_CSTR: same as current.
- AUTO_PROFILER_LABEL_DYNAMIC_NSCSTRING: for nsCStrings.
- AUTO_PROFILER_LABEL_DYNAMIC_LOSSY_NSSTRING: for nsStrings.

--HG--
extra : rebase_source : 3e2bbec4737b696e1c86579ae54be4cb3186c100
2017-10-13 16:12:57 +11: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
Masatoshi Kimura dbd92543c6 Bug 1313150 - Remove |weak| parameter from nsIMutableArray methods. r=froydnj
MozReview-Commit-ID: 7JoD4VYzZp3

--HG--
extra : rebase_source : 5db437f1c34608aa223916874d62b48c59baeae8
2017-10-21 23:53:02 +09:00
Ryan VanderMeulen cb612851ed Merge inbound to m-c. a=merge 2017-10-18 21:01:34 -04:00
Andrew McCreight 4ae455cdc5 Bug 1403959, part 2 - Automatically generated eslint fixes. r=froydnj
These were generated with |./mach eslint --fix xpcom| with the
.eslintignore and xpcom/tests/unit/.eslintrc.js changes from the next
patch.

MozReview-Commit-ID: 8pKkICSK3JQ

--HG--
extra : rebase_source : bbc98050928f27160d8ca63d38aa0c383be95878
2017-09-28 15:49:04 -07:00
Nicholas Nethercote 7f098bdb9c Bug 1409227 (part 4) - Replace nsMemory::Clone(id, sizeof(nsID)) with nsID::Clone(id). r=mccr8.
This change requires introducing nsID::Clone(). Because it's infallible, the
patch also removes some redundant failure-handling code. (nsMemory::Clone() is
also infallible, so this code was redundant even before this change.)

--HG--
extra : rebase_source : ef22757d3fa814320490bf7e19e822b8f0c4bdc3
2017-10-18 10:39:20 +11:00
Nicholas Nethercote 1fdf1c46d3 Bug 1409227 (part 3) - Replace nsMemory::Clone(s, sizeof(s)) with moz_xstrdup(s). r=froydnj.
The new code is slightly less efficient because it requires measuring the
string length, but these strings are all short so it shouldn't matter.

Note that the case in DataToString() is a little different. The std::min() that
was there appears to be excessive caution -- this code is always printf'ing
some kind of number, so 32 chars should never be reached -- but it was bogus
anyway, because if 32 was exceeded then (a) we would have overflowed `buf`, and
(b) we'd be returning a non-null-terminated string.

--HG--
extra : rebase_source : b666ad72c09d8c32b98bb9abc9dce1bd0c912c9b
2017-10-17 13:28:40 +11:00
Nicholas Nethercote 3076238153 Bug 1409227 (part 2) - Replace nsMemory::Clone(s, strlen(s)+1) with moz_xstrdup(s). r=erahm.
They are equivalent -- both infallible, both requiring measuring the length of
the string -- but moz_xstrdup is much more readable. (One place deals with
16-bit strings and so uses NS_strdup instead, which is also infallible.)

The patch also removes some failure-path code that will never execute due to
the infallibility.

--HG--
extra : rebase_source : 115574cf55db90b60e6bee59e5dc6ee409374159
2017-10-17 13:09:29 +11:00
Boris Zbarsky fb684cc726 Bug 1409152. Add an nsTArray::ContainsSorted method. r=froydnj 2017-10-17 15:39:59 -04:00
Matt Woodrow d8a662f0d2 Bug 1406727. r=mstange,froydnj a=abillings
--HG--
extra : rebase_source : a9932eb10d3ca451e1ce3a424cd48e957801f593
2017-10-17 15:19:44 +13: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 f2d1f3b005 Bug 1407117 - Simplify static atom representation. r=froydnj,bz.
Currently nsAtom::mString points to the interior of an nsStringBuffer. For
static atoms this requires the use of nsFakeStringBuffer, which is pretty
gross.

This patch changes things so that nsAtom::mString points to a static char
buffer for static atoms. This simplifies a number of things:

- nsFakeStringBuffer and CheckStaticAtomSizes are no longer needed.

- FakeBufferRefCountHelper is no longer needed.

- nsAtom's constructor for static atoms is simpler.

- RegisterStaticAtoms() is simpler.

On the flip-side, a couple of things get more complicated.

- nsAtom::ToString() treats static and dynamic atoms differently.

- nsAtom::GetStringBuffer() is now only valid for dynamic atoms. This
  function is only used in two places, both involving DOMString, so those
  locations are updated appropriately. This also requires updating some other
  code assigning nsStrings to DOMStrings, because we can't assume that
  nsStrings are shared.

On Linux64 this change reduces the size of the binary by 8752 B, and moves
81968 B from the .data to the .rodata section, where it can be shared between
processes.

--HG--
extra : rebase_source : 0f6fcdec1c525aa66222e208b66a9f9026f69bcb
2017-10-12 10:52:17 +11:00
Xidorn Quan 2215d24611 Bug 1407843 part 1 - Introduce a global-level AtomArray type alias. r=froydnj
MozReview-Commit-ID: DbGkWxkPfX7

--HG--
extra : rebase_source : 4f389d544bef98dccbfa694c1b821591bdae4103
2017-10-13 11:59:23 +11:00
Sebastian Hengst c2f23c4622 merge mozilla-central to mozilla-inbound. r=merge a=merge
--HG--
rename : browser/base/content/test/general/browser_bug585558.js => browser/base/content/test/tabs/browser_positional_attributes.js
rename : devtools/client/webconsole/new-console-output/test/mochitest/browser_webconsole_jsterm_dollar.js => devtools/client/webconsole/new-console-output/test/mochitest/browser_jsterm_dollar.js
rename : devtools/client/webconsole/new-console-output/test/mochitest/test-bug-621644-jsterm-dollar.html => devtools/client/webconsole/new-console-output/test/mochitest/test-jsterm-dollar.html
rename : dom/media/doctor/DDLogClass.cpp => dom/media/doctor/DDLogCategory.cpp
rename : dom/media/doctor/DDLogClass.h => dom/media/doctor/DDLogCategory.h
rename : mobile/android/app/src/main/res/drawable-hdpi/find_prev.png => mobile/android/app/src/photon/res/drawable-hdpi/find_prev.png
rename : mobile/android/app/src/main/res/drawable-hdpi/url_bar_entry_default.9.png => mobile/android/app/src/photon/res/drawable-hdpi/url_bar_entry_default.9.png
rename : mobile/android/app/src/main/res/drawable-hdpi/url_bar_entry_default_pb.9.png => mobile/android/app/src/photon/res/drawable-hdpi/url_bar_entry_default_pb.9.png
rename : mobile/android/app/src/main/res/drawable-hdpi/url_bar_entry_pressed.9.png => mobile/android/app/src/photon/res/drawable-hdpi/url_bar_entry_pressed.9.png
rename : mobile/android/app/src/main/res/drawable-hdpi/url_bar_entry_pressed_pb.9.png => mobile/android/app/src/photon/res/drawable-hdpi/url_bar_entry_pressed_pb.9.png
rename : mobile/android/app/src/main/res/drawable-large-hdpi-v11/url_bar_entry_default.9.png => mobile/android/app/src/photon/res/drawable-large-hdpi-v11/url_bar_entry_default.9.png
rename : mobile/android/app/src/main/res/drawable-large-hdpi-v11/url_bar_entry_default_pb.9.png => mobile/android/app/src/photon/res/drawable-large-hdpi-v11/url_bar_entry_default_pb.9.png
rename : mobile/android/app/src/main/res/drawable-large-hdpi-v11/url_bar_entry_pressed.9.png => mobile/android/app/src/photon/res/drawable-large-hdpi-v11/url_bar_entry_pressed.9.png
rename : mobile/android/app/src/main/res/drawable-large-hdpi-v11/url_bar_entry_pressed_pb.9.png => mobile/android/app/src/photon/res/drawable-large-hdpi-v11/url_bar_entry_pressed_pb.9.png
rename : mobile/android/app/src/main/res/drawable-large-xhdpi-v11/url_bar_entry_default.9.png => mobile/android/app/src/photon/res/drawable-large-xhdpi-v11/url_bar_entry_default.9.png
rename : mobile/android/app/src/main/res/drawable-large-xhdpi-v11/url_bar_entry_default_pb.9.png => mobile/android/app/src/photon/res/drawable-large-xhdpi-v11/url_bar_entry_default_pb.9.png
rename : mobile/android/app/src/main/res/drawable-large-xhdpi-v11/url_bar_entry_pressed.9.png => mobile/android/app/src/photon/res/drawable-large-xhdpi-v11/url_bar_entry_pressed.9.png
rename : mobile/android/app/src/main/res/drawable-large-xhdpi-v11/url_bar_entry_pressed_pb.9.png => mobile/android/app/src/photon/res/drawable-large-xhdpi-v11/url_bar_entry_pressed_pb.9.png
rename : mobile/android/app/src/main/res/drawable-large-xxhdpi-v11/url_bar_entry_default.9.png => mobile/android/app/src/photon/res/drawable-large-xxhdpi-v11/url_bar_entry_default.9.png
rename : mobile/android/app/src/main/res/drawable-large-xxhdpi-v11/url_bar_entry_default_pb.9.png => mobile/android/app/src/photon/res/drawable-large-xxhdpi-v11/url_bar_entry_default_pb.9.png
rename : mobile/android/app/src/main/res/drawable-large-xxhdpi-v11/url_bar_entry_pressed.9.png => mobile/android/app/src/photon/res/drawable-large-xxhdpi-v11/url_bar_entry_pressed.9.png
rename : mobile/android/app/src/main/res/drawable-large-xxhdpi-v11/url_bar_entry_pressed_pb.9.png => mobile/android/app/src/photon/res/drawable-large-xxhdpi-v11/url_bar_entry_pressed_pb.9.png
rename : mobile/android/app/src/main/res/drawable-xhdpi/find_prev.png => mobile/android/app/src/photon/res/drawable-xhdpi/find_prev.png
rename : mobile/android/app/src/main/res/drawable-xhdpi/url_bar_entry_default.9.png => mobile/android/app/src/photon/res/drawable-xhdpi/url_bar_entry_default.9.png
rename : mobile/android/app/src/main/res/drawable-xhdpi/url_bar_entry_default_pb.9.png => mobile/android/app/src/photon/res/drawable-xhdpi/url_bar_entry_default_pb.9.png
rename : mobile/android/app/src/main/res/drawable-xhdpi/url_bar_entry_pressed.9.png => mobile/android/app/src/photon/res/drawable-xhdpi/url_bar_entry_pressed.9.png
rename : mobile/android/app/src/main/res/drawable-xhdpi/url_bar_entry_pressed_pb.9.png => mobile/android/app/src/photon/res/drawable-xhdpi/url_bar_entry_pressed_pb.9.png
rename : mobile/android/app/src/main/res/drawable-xxhdpi/url_bar_entry_default.9.png => mobile/android/app/src/photon/res/drawable-xxhdpi/url_bar_entry_default.9.png
rename : mobile/android/app/src/main/res/drawable-xxhdpi/url_bar_entry_default_pb.9.png => mobile/android/app/src/photon/res/drawable-xxhdpi/url_bar_entry_default_pb.9.png
rename : mobile/android/app/src/main/res/drawable-xxhdpi/url_bar_entry_pressed.9.png => mobile/android/app/src/photon/res/drawable-xxhdpi/url_bar_entry_pressed.9.png
rename : mobile/android/app/src/main/res/drawable-xxhdpi/url_bar_entry_pressed_pb.9.png => mobile/android/app/src/photon/res/drawable-xxhdpi/url_bar_entry_pressed_pb.9.png
extra : rebase_source : 0cff6fa99d9ea3c6ce0bfb1604d4e9533f63ce63
2017-10-13 00:55:27 +02:00
Sebastian Hengst 5c00b8540d merge mozilla-inbound to mozilla-central. r=merge a=merge
MozReview-Commit-ID: AlcL6XYDkf
2017-10-12 23:58:31 +02:00
Nicholas Nethercote 1de4b467c1 Bug 1406829 (part 2) - Use initializer lists more in nsAtom constructors. r=froydnj. 2017-09-26 16:43:31 +10:00
Nicholas Nethercote b54a014b55 Bug 1406829 (part 1) - Add a comment about nsAtom::hash(). r=froydnj. 2017-09-26 16:20:57 +10:00
Mike Hommey 404ef7af3e Bug 1407838 - Remove the remains of NS_Alloc/NS_Realloc/NS_Free. r=njn
Bug 1134923 removed the use of those functions in gecko, and left some
for the XPCOM standalone glue. The XPCOM standalone glue was severely
stripped down in bug 1306327, with the effect of removing the
implementation for those functions.

The remains in nsXPCOM.h are:
XPCOM_API(void*) NS_Alloc(size_t aSize);
XPCOM_API(void*) NS_Realloc(void* aPtr, size_t aSize);
XPCOM_API(void) NS_Free(void* aPtr);

With no implementation left, the first arm is never actually used, and
the second arm means every remaining use of those functions in the tree
is a macro expansion to one of moz_xmalloc, moz_xrealloc or free.

--HG--
extra : rebase_source : fd1669abc5a25d8edbd5c3a8522e22a5c3f558e2
2017-10-12 11:08:44 +09:00
Eric Rahm 79b2a97ced Bug 1373371 - Properly convert index in RemoveElementsAt. r=froydnj
MozReview-Commit-ID: 2CRrUmOxA9B

--HG--
extra : rebase_source : 6071d63fa45d391b6c0fc8ce6a89bb7d0ef8eb11
2017-06-19 17:09:54 -07:00
Sebastian Hengst 051f888cef Backed out changeset 759a43ebc6bf (bug 1405541) for asserting in devtools/client/performance/test/browser_perf-console-record-03.js on Windows 7. r=backout
--HG--
extra : amend_source : 3df3e75c561cbc42db104ec1a6f6026ef021e3c7
2017-10-11 13:15:26 +02:00
Nicholas Nethercote add7e65972 Bug 1405541 - Split AUTO_PROFILER_LABEL_DYNAMIC into three macros. r=mstange.
It's easy to mess up the scoping so that (a) the label is pushed and then
immediately popped, and/or (b) the string doesn't live long enough. It's also
easy to do a utf16-to-utf8 conversion unnecessarily when the profiler is
inactive.

This patch splits that macro into three new ones that are harder to mess up.

- AUTO_PROFILER_LABEL_DYNAMIC_CSTR: same as current.
- AUTO_PROFILER_LABEL_DYNAMIC_NSCSTRING: for nsCStrings.
- AUTO_PROFILER_LABEL_DYNAMIC_LOSSY_NSSTRING: for nsStrings.

--HG--
extra : rebase_source : 53c8b43b6a1be06d00618a133e28bf95c46a3ba3
2017-10-11 13:03:34 +02:00
Phil Ringnalda bd5ca8f40d Backed out changeset 901a16fec9fc (bug 1405541) for Windows assertion failures
MozReview-Commit-ID: DRGWXU4Tbfk
2017-10-10 23:28:33 -07:00
Nicholas Nethercote b23fb68ae3 Bug 1405541 - Split AUTO_PROFILER_LABEL_DYNAMIC into three macros. r=mstange.
It's easy to mess up the scoping so that (a) the label is pushed and then
immediately popped, and/or (b) the string doesn't live long enough. It's also
easy to do a utf16-to-utf8 conversion unnecessarily when the profiler is
inactive.

This patch splits that macro into three new ones that are harder to mess up.

- AUTO_PROFILER_LABEL_DYNAMIC_CSTR: same as current.
- AUTO_PROFILER_LABEL_DYNAMIC_NSCSTRING: for nsCStrings.
- AUTO_PROFILER_LABEL_DYNAMIC_LOSSY_NSSTRING: for nsStrings.

--HG--
extra : rebase_source : 59f77df0124249bfd11fee3585420a17b4201d37
2017-10-04 13:44:24 +11:00
Sebastian Hengst 6ea9396481 merge mozilla-central to mozilla-inbound. r=merge a=merge 2017-10-09 11:29:05 +02:00
Jon Coppeard b6270c9da7 Bug 1400003 - Mark Heap<T> and barrier classes as MOZ_NON_MEMMOVABLE r=sfink r=froydnj 2017-10-09 10:03:20 +01: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
Emilio Cobos Álvarez 76571cb8eb Bug 1404897: Some fixes to allow storing non-copyable types in nsDataHashtable. r=froydnj
MozReview-Commit-ID: HaBT0igj9Yn

--HG--
extra : rebase_source : 19cc5135601931bd5a47157e3bbbd6e064b1961e
2017-10-02 15:24:59 +02:00
Sebastian Hengst 636468f6d3 Backed out changeset e3352dc9d701 (bug 1404897) 2017-10-04 12:55:22 +02:00
Emilio Cobos Álvarez c59ce1be20 Bug 1404897: Some fixes to allow storing non-copyable types in nsDataHashtable. r=froydnj
MozReview-Commit-ID: HaBT0igj9Yn

--HG--
extra : rebase_source : bf20cddb302f4de3a20797afe0872dcb43b8bdae
2017-10-02 15:24:59 +02:00
Sebastian Hengst 2dbbc650a4 Backed out changeset 9389dd982590 (bug 1404897) 2017-10-04 11:24:36 +02:00
Emilio Cobos Álvarez 0ed05a9a4e Bug 1404897: Some fixes to allow storing non-copyable types in nsDataHashtable. r=froydnj
MozReview-Commit-ID: HaBT0igj9Yn
2017-10-04 11:01:31 +02:00
Philippe Normand e22abc7e90 Bug 1404302 - Include nsQuickSort.h in nsCOMArray.cpp. r=froydnj
This fixes the build in non-unified mode, as nsCOMArray::Sort() method uses
NS_QuickSort().


MozReview-Commit-ID: CDBLIX8D3mL

--HG--
extra : rebase_source : 67902cf10b9311adbd97fecf7906762bb86c52e4
2017-09-28 14:30:29 +01:00
Nicholas Nethercote dfd3b7e7aa Bug 1400459 (part 2) - Devirtualize nsIAtom. r=heycam.
This patch merges nsAtom into nsIAtom. For the moment, both names can be used
interchangeably due to a typedef. The patch also devirtualizes nsIAtom, by
making it not inherit from nsISupports, removing NS_DECL_NSIATOM, and dropping
the use of NS_IMETHOD_. It also removes nsIAtom's IIDs.

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

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

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

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

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

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

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

MozReview-Commit-ID: DykOl8aEnUJ

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

--HG--
extra : rebase_source : 0b1e03c65233a227d84efeb9717a7cb1c464e4c8
2017-09-25 16:38:18 +10:00
Nicholas Nethercote 5018bb4f9b Bug 1401873 - Remove nsHtml5Atom. r=froydnj,hsivonen.
nsHtml5Atoms are very similar to dynamic nsAtoms. This patch removes the former
in favour of the latter, which leaves nsAtom as the only subclass of nsIAtom.

nsAtom::mKind is still used to distinguish dynamic atoms from HTML5 atoms, and
the HTML5 parser still uses manual memory management to handle its HTML5 atoms.

nsHtml5AtomEntry::mAtom had to be changed from an nsAutoPtr to a raw pointer
because nsAtom's destructor is private.

MozReview-Commit-ID: 1pBzwkog3ut

--HG--
extra : rebase_source : fbb819e527cb30606348da9ce3eede62e00fb936
2017-09-21 14:02:05 +10:00
Nicholas Nethercote de07428d79 Bug 1401873 - Expose nsAtom in nsIAtom.h. r=froydnj.
This patch moves nsAtom's declaration to nsIAtom.h. In order to keep most of
nsAtom's members private the patch also does the following.

- It introduces a new class, nsAtomFriend, which encapsulates the functions
  that will need access to nsAtom's private members.

- It moves GCKind, GCAtomTable(), and GCAtomTableLocked() out of nsAtom.

- It removes the factory methods, and replaces their uses with direct
  constructor calls.

MozReview-Commit-ID: L8vfrHsR2cS

--HG--
extra : rebase_source : d38a65515ae82c355966ca80ab235bea11b638af
2017-09-25 16:30:32 +10:00
Nicholas Nethercote fcd9a33eac Bug 1401873 - Rename Atom as nsAtom. r=froydnj.
Because it's going to be exposed via nsIAtom.h in the next few patches.

MozReview-Commit-ID: A81s1nWrvmB

--HG--
extra : rebase_source : 43990feb460fc7343c994f72fb6c6679a3aeb1cc
2017-09-21 12:36:53 +10: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
Nicholas Nethercote 6061f358d7 Bug 1400193 (part 1) - Fix subtle bug in PLDHashTable's move constructor. r=froydnj.
The current code replaces one PLDHashTable's mGeneration with another. If the
two generation values happen to be equal, it will look as though the storage
hasn't changed when really it has.

The fix is to use EntryStore::Set() to update mEntryStore, which increments
mGeneration appropriately.

--HG--
extra : rebase_source : d1779a143746c8d1a3e67bc3685e703496206b0f
2017-09-15 20:02:33 +10: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
Nicholas Nethercote 42a8532893 Bug 1396694 (part 2) - Replace nsIAtom.idl with nsIAtom.h. r=froydnj.
Now that nsIAtom is non-scriptable, a .idl file isn't needed.

I made the new nsIAtom.h file by starting with a generated nsIAtom.h file, and
then cleaning it up and removing some stuff that wasn't necessary.

--HG--
extra : rebase_source : 9655fd38984512bd96cf5555048f7774414f6d92
2017-09-05 16:07:32 +10:00
Nicholas Nethercote 4a2bc82d4c Bug 1396694 (part 1) - Make nsIAtom non-scriptable. r=froydnj.
This also lets us remove a couple of IDL methods.

--HG--
extra : rebase_source : a62d3f340c77ae8028e35aa9f01f72c5eadf0ed1
2017-09-05 16:06:43 +10:00
Nicholas Nethercote d5f5450783 Bug 1392884 - Remove nsIAtomService. r=froydnj.
It's no longer used, and we're in the process of making nsIAtom not usable from
scripts, so we don't want it to be used.
2017-08-25 17:06:58 +10:00
Andrea Marchesini 74a5faef65 Bug 1395140 - Implement "http-on-stop-request" notification, r=mayhemer 2017-09-01 11:55:37 +02:00
Jory A. Pratt e59d72ca8a Bug 1320560 - Use C99 math isfinite, finite has been depreciated and all modern libc implementations use isfinite. r=froydnj 2017-01-08 11:34:00 -05:00
Nicholas Nethercote 0a0c70a23a Bug 1392881 - Merge StaticAtom and DynamicAtom. r=froydnj.
There's no reason for them to be separate, and we can use the |kind| field to
distinguish the two kinds when necessary.

This lets us remove the duplication of ScriptableToString(), ToUTF8String(),
and ScriptableEquals().

It also lets us use |Atom*| pointers instead of |nsIAtom*| pointers in various
places within nsAtomTable.cpp, which de-virtualizes various calls and removes
the need for some static_casts.

--HG--
extra : rebase_source : 2f9183323446e353f8cc5dcedf57d9dc9a38f0a7
2017-08-24 11:10:04 +10:00
Andrew Osmond 42266555ed Bug 1389479 - Part 1. Add nsExpirationTracker::NotifyEndTransaction(Locked) callbacks for subclasses to know when an aging iteration is complete. r=froydnj 2017-08-15 15:02:14 -04:00
Bevis Tseng 41242cf89a Bug 1367497 - Part 1: Improve Error Handling in {Add|Remove}ObjectLocked(). r=froydnj
MozReview-Commit-ID: 6ecIS6PnVdj

--HG--
extra : source : 0a273c823e19e1048d78f9e6b1ddedf8cc034bd6
2017-05-26 14:36:17 +08:00
Sebastian Hengst 7b4e0b8924 Backed out changeset 0a273c823e19 (bug 1367497) for intermittently crashing in mochitest-chrome-3's layout/style/test/chrome/test_stylesheet_clone_import_rule.html on debug. r=backout 2017-08-15 18:47:29 +02:00
Bevis Tseng 4b1a41e00e Bug 1367497 - Part 1: Improve Error Handling in {Add|Remove}ObjectLocked(). r=froydnj
MozReview-Commit-ID: 6ecIS6PnVdj
2017-05-26 14:36:17 +08:00
Bevis Tseng b31fd1ee95 Backed out changeset c29f8828b859
--HG--
extra : rebase_source : 4a32c7d30c128dd9041e209c6226030c7fba567c
2017-08-15 10:45:28 +08:00
Bevis Tseng c12623dcbe Bug 1367497 - Part 1: Improve Error Handling in {Add|Remove}ObjectLocked(). r=froydnj
MozReview-Commit-ID: 6ecIS6PnVdj
2017-05-26 14:36:17 +08:00
Eric Rahm ee8cbfef96 Bug 1382001 - Part 1: Handle gperf-like preamble in make_dafsa. r=froydnj
This updates make_dafsa.py to include anything preceding the first '%%' in the
generated header.

For example:

> #include <stdint.h>
> const uint64_t kExpiration = UINT64_C(12345);
> %%
> foo.bar.com, 1
> %%

Would generate:

> #include <stdint.h>
> const uint64_t kExpiration = UINT64_C(12345);
>
> const unsigned char kDafsa[] = {
>   ...
> };

MozReview-Commit-ID: 1oR3ssnlUyA
2017-08-11 14:12:03 -07:00
Emilio Cobos Álvarez 9f02c96781 Bug 1362338: Make nsIAtom::AddRef and nsIAtom::Release final. r=froydnj
MozReview-Commit-ID: CFWcSNocGIm

--HG--
extra : rebase_source : 6b8e28f76e2d4fff13f3a89ac68388a0b090bf74
2017-08-09 14:20:17 +02:00
Ryan VanderMeulen 64905fbd5a Backed out changesets 19b8d672b55d and 2980183d98fb (bug 1362338) for hazard analysis failures. 2017-08-09 21:12:28 -04:00
Emilio Cobos Álvarez ea4858c92f Bug 1362338: followup: Tentatively fix windows build bustage. r=me
Windows apparently uses __stdcall for this, so need to use the ugly macros...

MozReview-Commit-ID: 4J27sCYwdHg
2017-08-09 14:45:37 +02:00
Emilio Cobos Álvarez 300ebe9ee1 Bug 1362338: Make nsIAtom::AddRef and nsIAtom::Release final. r=froydnj
MozReview-Commit-ID: CFWcSNocGIm
2017-08-09 14:20:17 +02:00
Emilio Cobos Álvarez e99fdbe52e Bug 1362338: Take a bit from the atom's length to store a tristate. r=froydnj
MozReview-Commit-ID: Elu9EioSDXk
2017-08-09 14:19:30 +02:00
Emilio Cobos Álvarez a7d696a18f Bug 1362338: Preliminary whitespace cleanup in nsIAtom.idl. r=froydnj
MozReview-Commit-ID: DN2tN0OMWEk
2017-08-09 14:18:15 +02:00
Eric Rahm a750d8eb22 Bug 1380154 - Part 2: Generate a DAFSA and use it for eTLDs. r=jduell
This replaces our giant sorted array of eTLD names with a more compact DAFSA.

MozReview-Commit-ID: 3zMBzUM9QUg
2017-07-17 16:10:18 -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
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
Sebastian Hengst d83f1e2d58 Backed out changeset 13cc447a7fde (bug 1380154) 2017-08-07 21:42:14 +02:00
Eric Rahm f5b13e0ecb Bug 1380154 - Part 2: Generate a DAFSA and use it for eTLDs. r=jduell
This replaces our giant sorted array of eTLD names with a more compact DAFSA.

MozReview-Commit-ID: 3zMBzUM9QUg
2017-07-17 16:10:18 -07: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
Cameron McCormack a3c755c590 Bug 1381731 - Remove gUnusedAtomCount assertions since they're hard to get right given OMT atom refcounting. r=bholley
MozReview-Commit-ID: ByM6mzL1IgF

--HG--
extra : rebase_source : efa2f0e3c353a316c8035bf28868e0a321e1dfa2
2017-07-29 11:57:32 +08:00
Sebastian Hengst d883695275 Backed out changeset aee8226f7f98 (bug 1380154) for failing OS X and Linux static at xpcom/ds/Dafsa.h:35 with 'constexpr constructor never produces a constant expression'. r=backout on a CLOSED TREE 2017-08-03 09:18:21 +02:00
Eric Rahm 09ade48fd7 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
Nathan Froyd 84951ded23 Bug 1386476 - avoid unnecessary checks in nsTArray::AppendElement; r=erahm
nsTArray::AppendElement{,s} uses an IncrementLength method to adjust the
length of the array after appending elements.  There are checks in
IncrementLength to ensure that we're not incrementing the length stored
in the static empty header object; these checks are necessary in cases
such as appending a zero-length array to another zero-length array.

But we do not need this check when we're calling AppendElement: we know
the header is obviously not the empty header, because we increased the
length of the array by one for the newly appended element.  Incrementing
the length can therefore be inlined, saving ~90K of codesize on x86-64
Linux.
2017-08-02 19:21:23 -04:00
Ehsan Akhgari 50fd0b7a62 Bug 1385533 - Reserve space for one pointer in the mMutationObservers array on node slots; r=smaug
This helps avoid allocations for the first mutation observer (for example, Range)
created by a caller.
2017-07-31 17:12:38 -04:00
Nicholas Nethercote 49eb219ff5 Bug 1383982 (attempt 2) - Introduce a general mechanism for measuring memory usage of graph-like structures. r=erahm.
--HG--
extra : rebase_source : 7075f9570a4262158351ce9ac3ca8360ea4d5394
2017-07-28 20:10:04 +10:00
Sebastian Hengst 9077ac8886 Backed out changeset a57d8f30d1bf (bug 1383982) for build bustage at nsGlobalWindow.cpp:13826: 'class nsWindowSizes' has no member named 'mMallocSizeOf'. r=backout 2017-07-28 09:50:48 +02:00
Nicholas Nethercote 5c3abe8aab Bug 1383982 - Introduce a general mechanism for measuring memory usage of graph-like structures. r=erahm.
All the SizeOf{In,Ex}cludingThis() functions take a MallocSizeOf function
which measures memory blocks. This patch introduces a new type, SizeOfState,
which includes a MallocSizeOf function *and* a table of already-measured
pointers, called SeenPtrs. This gives us a general mechanism to measure
graph-like data structures, by recording which nodes have already been
measured. (This approach is used in a number of existing reporters, but not in
a uniform fashion.)

The patch also converts the window memory reporting to use SizeOfState in a lot
of places, all the way through to the measurement of Elements. This is a
precursor for bug 1383977 which will measure Stylo elements, which involve
Arcs.

The patch also converts the existing mAlreadyMeasuredOrphanTrees table in the
OrphanReporter to use the new mechanism.

--HG--
extra : rebase_source : 2c23285f8b6c3b667560a9d14014efc4633aed51
2017-07-28 15:03:44 +10:00
Ehsan Akhgari 43091e2839 Bug 1379282 - Improve XPCOM's pointer hashing functions for pointers to neighboring memory locations; r=erahm
The simplistic shift-based hashing function creates a lot of collisions
for pointers pointing to arrays as it doesn't do a great job at distributing
the data randomly based on the input bytes.
2017-07-19 14:16:35 -04:00
Ehsan Akhgari 3df4db262f Backout changeset 06f92d065a85 (bug 1377333) because we don't need keys that are that big 2017-07-18 23:06:00 -04:00
Andrew McCreight d6f0453414 Bug 1350729 - Implement fake refcount logging for nsFakeStringBuffer. r=dbaron
Running with XPCOM_MEM_LOG_CLASSES=nsStringBuffer triggers an
assertion in refcount logging for nsFakeStringBuffers. These are given
an initial refcount of 1, without calling NS_LOG_ADDREF. Then,
AddRef() is called on these objects in StaticAtom::StaticAtom(), and
we tell the refcount logging system about the fake buffer, and that it
has a refcount of 0, triggering the assertion.

The first part of the fix is to call NS_LOG_ADDREF for this initial
refcount, in StaticAtom().

This first fix causes refcount logging to start reporting that the
fake string buffers leak, when XPCOM_MEM_LOG_CLASSES is not set. This
is because refcount logging is now getting told about these objects
being AddRefed at 1, which it takes to mean that an object is created.

To work around this issue, I add an array gFakeBuffers that contains
every fake string buffer we create, and tell the refcount logging
system that these objects are all being destroyed, when the atom table
is being shut down. This could result in some bogosity if the fake
buffers are "leaked" but hopefully this is still an improvement over
the current state.

MozReview-Commit-ID: 5AxoBYAlYRU

--HG--
extra : rebase_source : ba0763cb494894918141774025db525cea9f9c75
2017-07-14 10:20:23 -07:00
Wes Kocher 4ff7648fb6 Backed out changeset 9033647b9a51 (bug 1350729) for build failures in nsAtomTable.cpp a=backout CLOSED TREE
MozReview-Commit-ID: 9wb9Z6tlEar
2017-07-17 11:47:50 -07:00
Andrew McCreight e762779c3b Bug 1350729 - Implement fake refcount logging for nsFakeStringBuffer. r=dbaron
Running with XPCOM_MEM_LOG_CLASSES=nsStringBuffer triggers an
assertion in refcount logging for nsFakeStringBuffers. These are given
an initial refcount of 1, without calling NS_LOG_ADDREF. Then,
AddRef() is called on these objects in StaticAtom::StaticAtom(), and
we tell the refcount logging system about the fake buffer, and that it
has a refcount of 0, triggering the assertion.

The first part of the fix is to call NS_LOG_ADDREF for this initial
refcount, in StaticAtom().

This first fix causes refcount logging to start reporting that the
fake string buffers leak, when XPCOM_MEM_LOG_CLASSES is not set. This
is because refcount logging is now getting told about these objects
being AddRefed at 1, which it takes to mean that an object is created.

To work around this issue, I add an array gFakeBuffers that contains
every fake string buffer we create, and tell the refcount logging
system that these objects are all being destroyed, when the atom table
is being shut down. This could result in some bogosity if the fake
buffers are "leaked" but hopefully this is still an improvement over
the current state.

MozReview-Commit-ID: 5AxoBYAlYRU

--HG--
extra : rebase_source : 967520e825d26c369a11acc478d223d190137a43
2017-07-14 10:20:23 -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 9a66affd7f Bug 1376498 part 5 - Remove nsClassHashtable::RemoveAndForget(). r=froydnj
MozReview-Commit-ID: 2VVgViNhruj
2017-07-05 02:01:45 +02:00
Mats Palmgren fae81013c9 Bug 1376498 part 3 - Make nsClassHashtable inherit Remove() for API consistency with ns[Base|Interface|RefPtr]Hashtable. r=froydnj
MozReview-Commit-ID: LQMaamZhkM4
2017-07-05 02:01:44 +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
Mats Palmgren f88bb52a9e Bug 1376498 part 1 - Unify the ns[Base|Interface|RefPtr]Hashtable::Remove() signatures for consistency. Make it return true if an entry was removed, with an optional out param to move the value. r=froydnj
MozReview-Commit-ID: JVciibiSPL5
2017-07-05 02:01:44 +02:00
Ehsan Akhgari ec3d589e4f Bug 1377333 - Make PLDHashNumber 64-bit on x86-64; r=froydnj 2017-07-04 11:05:21 -04:00
Sebastian Hengst 51f7ac9c81 Backed out changeset 3009a0b538da (bug 1377333) on suspicion of causing frequent failures in test_general.html. r=backout 2017-07-04 00:37:24 +02:00
Ehsan Akhgari de718c51ec Bug 1377333 - Make PLDHashNumber 64-bit on x86-64; r=froydnj 2017-07-03 13:21:11 -04:00
Mats Palmgren 30c6d6295a Bug 1376477 - Use Lookup instead of Get+Remove to avoid unnecessary hashtable lookups. Replace Get with Contains to avoid ref-counting. r=froydnj
MozReview-Commit-ID: G4F2pAnNA73
2017-06-28 01:03:17 +02:00
Mats Palmgren 59d3163a68 Bug 1376473 - Use Lookup instead of Get+Remove to avoid unnecessary hashtable lookups. r=froydnj
MozReview-Commit-ID: lWNPPBDNh7
2017-06-28 01:03:17 +02:00
Ehsan Akhgari 04f49b5fc2 Bug 1376563 - Improve the hash key generation for hashtables containing pointers on 64-bit platforms by using 2 more bits of the original pointer in calculating the hash key; r=froydnj 2017-06-27 18:18:32 -04: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
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
Ehsan Akhgari c342914631 Bug 1373996 - Make nsTObserverArray::RemoveElementsBy() take a template argument; r=froydnj
This avoids a dynamic allocation in EventListenerManager::HandleEventInternal().
2017-06-19 14:27:39 -04:00
Ehsan Akhgari 5ad8772be5 Bug 1374033 - Remove double bounds checking from the next accessors of the iterator classes of nsTObserverArray; r=froydnj 2017-06-19 14:13:32 -04: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
Mats Palmgren a57cd6c138 Bug 1372317 part 1 - Introduce a nsBaseHashtable::Lookup() method that allows modifying the value and optionally remove the entry. r=froydnj
MozReview-Commit-ID: AcNBQvTMnX8
2017-06-18 17:07:54 +02:00
Mats Palmgren 95f7896de5 Bug 1371928 - Add a new EnsureInserted() method that return true if a new entry was created, and EnsureRemoved() that return true if an existing entry was removed. r=froydnj
As opposed to PutEntry/RemoveEntry which do not indicate what happened.

MozReview-Commit-ID: LeNKDqpSksR
2017-06-17 00:06:04 +02:00
Florian Quèze 65e6947718 Bug 1373053 - nsObserverService::NotifyObservers should add a pseudo stack frame showing the topic of the notification, r=mstange. 2017-06-15 00:58:25 +02:00
Mats Palmgren a4d601d6c4 Bug 1371094 part 1 - Move the nsClassHashtable::LookupForAdd() method to nsBaseHashtable. r=froydnj
Also change nsClassHashtable::LookupOrAdd to not regard existing entries with
a nullptr value as non-existent.  This is to make it consistent with
nsBaseHashtable::LookupForAdd() and other methods.

MozReview-Commit-ID: 1wYqK8XQbyW
2017-06-14 01:03:38 +02: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
Michael Layzell e8c6bd15df Bug 1368524 - Add a telemetry probe for how long we spend processing NotifyObservers callbacks, dr=bsmedberg, r=ehsan
MozReview-Commit-ID: KWypjvFscVu
2017-06-08 13:58:31 -04:00
Mats Palmgren c4730f96bb Bug 1371061 - Optimize nsBaseHashtable::GetOrInsert() to only do a single hashtable lookup. r=froydnj
MozReview-Commit-ID: 6muOorLplG1
2017-06-08 12:48:32 +02:00
Mats Palmgren 6467c38383 Bug 1370632 - Move LookupRemoveIf() to nsBaseHashtable instead so that it can be used on more hashtables types. r=froydnj
MozReview-Commit-ID: 9kQSytPWok5
2017-06-07 15:22:41 +02:00
Mats Palmgren 0630f5b2bf Bug 1367207 part 3 - Introduce nsClassHashtable::LookupRemoveIf() for consumers that wants to do a Get() then inspect/modify the value then, maybe, Remove() the entry. This is to avoid a second hashtable lookup for the Remove(). r=froydnj
Also, make RemoveAndForget() use RemoveEntry(), not Remove(), to remove
the entry to avoid a second hashtable lookup.

MozReview-Commit-ID: Bj5Heo8YLFJ
2017-06-07 15:22:41 +02:00
Nathan Froyd cee39716e5 Bug 1370606 - fix fallible nsRefPtrHashtable::Put to really be fallible; r=erahm
Calling the infallible PutEntry effectively makes this function
infallible, despite Put taking a fallible_t argument.
2017-06-06 21:06:17 -04:00
Nathan Froyd cb5ef308b6 Bug 1370593 - avoid redundant lookups in nsRefPtrHashtable::Remove; r=mats
We already have a handle to the entry in the hashtable, we can remove
that directly, rather than implicitly looking up the entry to remove in
Remove().
2017-06-06 21:06:17 -04:00
Daniel Holbert 4564af3454 Bug 1368326: Don't bother calling Clear() in destructor for empty nsTArrays. r=froydnj
MozReview-Commit-ID: 7mi2Os52JfJ

--HG--
extra : rebase_source : 4c7296fd84509f71b680a55f513574285e754481
2017-06-01 14:38:13 -07:00
L. David Baron 07c2f2dc49 Bug 1352889 - Ensure that PLDHashTable's second hash doesn't have padding with 0 bits for tables with capacity larger than 2^16. r=njn
PLDHashTable takes the result of the hash function and multiplies it by
kGoldenRatio to ensure that it has a good distribution of bits across
the 32-bit hash value, and then zeroes out the low bit so that it can be
used for the collision flag.  This result is called hash0.  From hash0
it computes two different numbers used to find entries in the table
storage:  hash1 is used to find an initial position in the table to
begin searching for an entry; hash2 is then used to repeatedly offset
that position (mod the size of the table) to build a chain of positions
to search.

In a table with capacity 2^c entries, hash1 is simply the upper c bits
of hash0.  This patch does not change this.

Prior to this patch, hash2 was the c bits below hash1, padded at the low
end with zeroes when c > 16.  (Note that bug 927705, changeset
1a02bec165e16f370cace3da21bb2b377a0a7242, increased the maximum capacity
from 2^23 to 2^26 since 2^23 was sometimes insufficient!)  This manner
of computing hash2 is problematic because it increases the risk of long
chains for very large tables, since there is less variation in the hash2
result due to the zero padding.

So this patch changes the hash2 computation by using the low bits of
hash0 instead of shifting it around, thus avoiding 0 bits in parts of
the hash2 value that are significant.

Note that this changes what hash2 is in all cases except when the table
capacity is exactly 2^16, so it does change our hashing characteristics.
For tables with capacity less than 2^16, it should be using a different
second hash, but with the same amount of random-ish data.  For tables
with capacity greater than 2^16, it should be using more random-ish
data.

Note that this patch depends on the patch for bug 1353458 in order to
avoid causing test failures.

MozReview-Commit-ID: JvnxAMBY711

--HG--
extra : transplant_source : 2%D2%C2%CE%E1%92%C8%F8H%D7%15%A4%86%5B%3Ac%0B%08%3DA
2017-05-31 13:44:02 -07:00
L. David Baron f22aab91c2 Bug 1352888 - Don't set the collision flag when adding to PLDHashTable if we've already found the entry we're going to add. r=njn
PLDHashTable's entry store has two types of unoccupied entries:  free
entries and removed entries.  The search of a chain of entries
(determined by the hash value) in the entry store to search for an entry
can stop at free entries, but it continues across removed entries,
because removed entries are entries that may have been skipped over when
we were adding the value we're searching for to the hash, but have since
been removed.  For live entries, we also maintain this distinction by
using one bit of storage for a collision flag, which notes that if the
hashtable entry is removed, its place in the entry store must become a
removed entry rather than a free entry.

When we add a new entry to the table, Add's semantics require that we
return an existing entry if there is one, and only create a new entry if
no existing entry exists.  (Bug 1352198 suggests the possibility of a
faster alternative Add API where the caller guarantees that the key is
not already in the hashtable.)  When we search for the existing entry,
we must thus continue the search across removed entries, even though we
record the first removed entry found to return if the search for an
existing entry fails.

The existing code adds the collision flag through the entire table
search during an Add.  This patch changes that behavior so that we only
add the collision flag prior to finding the first removed entry.  Adding
it after we find the first removed entry is unnecessary, since we are
not making that entry part of a path to a new entry.  If it is part of a
path to an existing entry, it will already have the collision flag set.

This patch effectively puts an if (!firstRemoved) around the else branch
of the if (MOZ_UNLIKELY(EntryIsRemoved(entry))), and then refactors that
condition outwards since it is now around the contents of both the if
and else branches.

MozReview-Commit-ID: CsXnMYttHVy

--HG--
extra : transplant_source : %80%9E%83%EC%CCY%B4%B0%86%86%18%99%B6U%21o%5D%29%AD%04
2017-05-31 13:44:02 -07:00
Andreas Farre 1cf93d7962 Bug 1311425 - Avoid expiration timers when scheduling idle runnables, r=froydnj
--HG--
extra : rebase_source : b20edf82a69a24965b4bb6300ff9b1be39ad7b8a
2017-05-24 21:17:06 -04:00
Samael Wang ecbe18e933 Bug 1363036 - Part 1: Remove MOZ_DIAGNOSTIC_ASSERTs previously added for bug hunting. r=smaug
MozReview-Commit-ID: BAkuRlHtMcP

--HG--
extra : rebase_source : 5e708d0dacec9a673851d689d1f5274a0f1b69aa
2017-05-22 11:25:54 +08:00
L. David Baron f2c24eea94 Backed out changeset e4ac2148c920 (bug 1352888) to see if it is responsible for input latency regression bug 1362094.
--HG--
extra : rebase_source : bfb451e911058496c2a6498d658cb6ab777da8e6
2017-05-24 11:42:19 -04:00
L. David Baron 34315c4eee Backed out changeset 52fff3b1e209 (bug 1352889) to see if it is responsible for input latency regressions in bug 1365334 or bug 1366156.
--HG--
extra : rebase_source : 387401d1417a29c19e5dbc1ee7413d9d6f810d23
2017-05-24 11:41:02 -04:00
Samael Wang da20faa46e Bug 1363036 - Add MOZ_DIAGNOSTIC_ASSERTs for bug hunting. r=smaug
MozReview-Commit-ID: JPnkkJlkwDY
2017-05-16 10:54:01 +08:00
Ehsan Akhgari 5de2ecd325 Bug 1361745 - Part 1: Improve the nsClassHashtable::LookupForAdd() API; r=froydnj
The OrInsert() method adds the new entry to the hashtable if needed, and
returns the newly added entry or the pre-existing one.  It allows for a
more concise syntax at the call site.
2017-05-08 10:02:04 -04:00
L. David Baron 5191ef7b3b Bug 1352889 - Ensure that PLDHashTable's second hash doesn't have padding with 0 bits for tables with capacity larger than 2^16. r=njn
PLDHashTable takes the result of the hash function and multiplies it by
kGoldenRatio to ensure that it has a good distribution of bits across
the 32-bit hash value, and then zeroes out the low bit so that it can be
used for the collision flag.  This result is called hash0.  From hash0
it computes two different numbers used to find entries in the table
storage:  hash1 is used to find an initial position in the table to
begin searching for an entry; hash2 is then used to repeatedly offset
that position (mod the size of the table) to build a chain of positions
to search.

In a table with capacity 2^c entries, hash1 is simply the upper c bits
of hash0.  This patch does not change this.

Prior to this patch, hash2 was the c bits below hash1, padded at the low
end with zeroes when c > 16.  (Note that bug 927705, changeset
1a02bec165e16f370cace3da21bb2b377a0a7242, increased the maximum capacity
from 2^23 to 2^26 since 2^23 was sometimes insufficient!)  This manner
of computing hash2 is problematic because it increases the risk of long
chains for very large tables, since there is less variation in the hash2
result due to the zero padding.

So this patch changes the hash2 computation by using the low bits of
hash0 instead of shifting it around, thus avoiding 0 bits in parts of
the hash2 value that are significant.

Note that this changes what hash2 is in all cases except when the table
capacity is exactly 2^16, so it does change our hashing characteristics.
For tables with capacity less than 2^16, it should be using a different
second hash, but with the same amount of random-ish data.  For tables
with capacity greater than 2^16, it should be using more random-ish
data.

Note that this patch depends on the patch for bug 1353458 in order to
avoid causing test failures.

MozReview-Commit-ID: JvnxAMBY711

--HG--
extra : rebase_source : dbde93b9312dd10fb3a549ee4098b57e1df5cadf
2017-05-04 15:17:50 -07:00
Ehsan Akhgari 49ea4e277a Bug 1359848 - Part 1: Add the nsClassHashtable::LookupForAdd() API to allow consumers to lookup and add an entry to a class hashtable if it doesn't exist already with a single lookup; r=froydnj 2017-05-03 08:59:48 -04:00
Tom Tromey bd012d9546 Bug 1334318 - remove last uses of PR_smprintf; r=froydnj
This removes the last uses of PR_smprintf from the tree (excluding the
security and nsprpub directories).  It also fixes a related latent bug
in nsAppRunner.cpp (which was incorrectly freeing the pointer passed to
PR_SetEnv).

MozReview-Commit-ID: GynP2PhuWWO

--HG--
extra : rebase_source : c3b83c7bd08b1c222e137a00323caf5481352845
2017-04-28 10:13:26 -06:00
Michael Layzell 8b7ba021a4 Bug 1339537 - Part 6: Pass std::function values tree by const reference instead of by value, r=ehsan
MozReview-Commit-ID: PVAqU2DPs2
2017-04-27 12:44:57 -04:00
Petr Sumbera 0e17adee7c Bug 1354510 - Firefox build should recognize Solaris. r=glandium
--HG--
extra : rebase_source : 2bec2709a26a5295e723b0ecc424b0d648715bb7
2017-04-11 00:01:32 -07:00
Florian Queze b5916a37c7 Bug 1355216 - Mark last parameters that are almost always falsy as optional, r=froydnj. 2017-04-12 00:07:30 +02:00
Carsten "Tomcat" Book 207b516e89 merge mozilla-inbound to mozilla-central a=merge 2017-04-06 12:50:50 +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
Daniel Holbert 2a33c81425 Bug 1353941: Convert a MOZ_RELEASE_ASSERT() expression to "if" + MOZ_CRASH(), to work around clang 3.8 segfault. r=froydnj
MozReview-Commit-ID: Bq2DM61YvQ3

--HG--
extra : rebase_source : 2d546cbabd71f17ac0d9d8b3a98271d57ffc428c
2017-04-05 18:24:56 -07:00
Bevis Tseng 5daae11f33 Bug 1345464 - Add an optional EventTarget to nsExpirationTracker to support Labeling for Quantum-DOM. r=froydnj
--HG--
extra : rebase_source : f05d3a31543ea8ed35a756a1721adc272c792a08
2017-03-30 09:23:36 -04:00
Bevis Tseng eb452e8278 Bug 1350177 - Part 1: Define ExpirationTrackerImpl as a Thread-Safe Tracker. r=froydnj
1. Define ExpirationTrackerImpl which requires AutoLock before calling Tracker APIs.
2. Move expiration logic from nsExpirationTracker to ExpirationTrackerImpl.
3. Keep nsExprationTracker un-thread-safe with fake Lock acquired.

--HG--
extra : rebase_source : 536876ce2c64240f5470180aa633264d8e5de664
2017-03-27 19:37:29 +08:00
L. David Baron 443904b36a Bug 1352888 - Don't set the collision flag when adding to PLDHashTable if we've already found the entry we're going to add. r=njn
PLDHashTable's entry store has two types of unoccupied entries:  free
entries and removed entries.  The search of a chain of entries
(determined by the hash value) in the entry store to search for an entry
can stop at free entries, but it continues across removed entries,
because removed entries are entries that may have been skipped over when
we were adding the value we're searching for to the hash, but have since
been removed.  For live entries, we also maintain this distinction by
using one bit of storage for a collision flag, which notes that if the
hashtable entry is removed, its place in the entry store must become a
removed entry rather than a free entry.

When we add a new entry to the table, Add's semantics require that we
return an existing entry if there is one, and only create a new entry if
no existing entry exists.  (Bug 1352198 suggests the possibility of a
faster alternative Add API where the caller guarantees that the key is
not already in the hashtable.)  When we search for the existing entry,
we must thus continue the search across removed entries, even though we
record the first removed entry found to return if the search for an
existing entry fails.

The existing code adds the collision flag through the entire table
search during an Add.  This patch changes that behavior so that we only
add the collision flag prior to finding the first removed entry.  Adding
it after we find the first removed entry is unnecessary, since we are
not making that entry part of a path to a new entry.  If it is part of a
path to an existing entry, it will already have the collision flag set.

This patch effectively puts an if (!firstRemoved) around the else branch
of the if (MOZ_UNLIKELY(EntryIsRemoved(entry))), and then refactors that
condition outwards since it is now around the contents of both the if
and else branches.

MozReview-Commit-ID: CsXnMYttHVy

--HG--
extra : transplant_source : W4%B8%BA%D5p%102%1B%8D%83%23%E0s%B3%B0f%0D%05%AE
2017-04-04 20:59:21 -07:00
Nathan Froyd 564e8d046e Bug 1353660 - proxy destruction of nsHashPropertyBag's hash table to the main thread; r=mccr8
We need this because the stored values in the hash table may themselves
be main-thread only objects, and destroying them off the main thread
will cause crashes.
2017-04-05 15:31:20 -04:00
Carsten "Tomcat" Book 92b960417c Backed out changeset 8f8e8cd713ad (bug 1352888) 2017-04-04 09:54:55 +02:00
Carsten "Tomcat" Book 6fa4a7de2c Backed out changeset dfdb5742823a (bug 1352889) 2017-04-04 09:54:53 +02:00
L. David Baron 4d700b54f1 Bug 1352889 - Ensure that PLDHashTable's second hash doesn't have padding with 0 bits for tables with capacity larger than 2^16. r=njn
PLDHashTable takes the result of the hash function and multiplies it by
kGoldenRatio to ensure that it has a good distribution of bits across
the 32-bit hash value, and then zeroes out the low bit so that it can be
used for the collision flag.  This result is called hash0.  From hash0
it computes two different numbers used to find entries in the table
storage:  hash1 is used to find an initial position in the table to
begin searching for an entry; hash2 is then used to repeatedly offset
that position (mod the size of the table) to build a chain of positions
to search.

In a table with capacity 2^c entries, hash1 is simply the upper c bits
of hash0.  This patch does not change this.

Prior to this patch, hash2 was the c bits below hash1, padded at the low
end with zeroes when c > 16.  (Note that bug 927705, changeset
1a02bec165e16f370cace3da21bb2b377a0a7242, increased the maximum capacity
from 2^23 to 2^26 since 2^23 was sometimes insufficient!)  This manner
of computing hash2 is problematic because it increases the risk of long
chains for very large tables, since there is less variation in the hash2
result due to the zero padding.

So this patch changes the hash2 computation by using the low bits of
hash0 instead of shifting it around, thus avoiding 0 bits in parts of
the hash2 value that are significant.

Note that this changes what hash2 is in all cases except when the table
capacity is exactly 2^16, so it does change our hashing characteristics.
For tables with capacity less than 2^16, it should be using a different
second hash, but with the same amount of random-ish data.  For tables
with capacity greater than 2^16, it should be using more random-ish
data.

MozReview-Commit-ID: JvnxAMBY711

--HG--
extra : transplant_source : %8A%25%FB%E3H%B8_%F1G%F6%3E%0B%29%DF%20%FF%D8%E1%AEw
2017-04-03 20:43:30 -07:00
L. David Baron db2f1da78f Bug 1352888 - Don't set the collision flag when adding to PLDHashTable if we've already found the entry we're going to add. r=njn
PLDHashTable's entry store has two types of unoccupied entries:  free
entries and removed entries.  The search of a chain of entries
(determined by the hash value) in the entry store to search for an entry
can stop at free entries, but it continues across removed entries,
because removed entries are entries that may have been skipped over when
we were adding the value we're searching for to the hash, but have since
been removed.  For live entries, we also maintain this distinction by
using one bit of storage for a collision flag, which notes that if the
hashtable entry is removed, its place in the entry store must become a
removed entry rather than a free entry.

When we add a new entry to the table, Add's semantics require that we
return an existing entry if there is one, and only create a new entry if
no existing entry exists.  (Bug 1352198 suggests the possibility of a
faster alternative Add API where the caller guarantees that the key is
not already in the hashtable.)  When we search for the existing entry,
we must thus continue the search across removed entries, even though we
record the first removed entry found to return if the search for an
existing entry fails.

The existing code adds the collision flag through the entire table
search during an Add.  This patch changes that behavior so that we only
add the collision flag prior to finding the first removed entry.  Adding
it after we find the first removed entry is unnecessary, since we are
not making that entry part of a path to a new entry.  If it is part of a
path to an existing entry, it will already have the collision flag set.

This patch effectively puts an if (!firstRemoved) around the else branch
of the if (MOZ_UNLIKELY(EntryIsRemoved(entry))), and then refactors that
condition outwards since it is now around the contents of both the if
and else branches.

MozReview-Commit-ID: CsXnMYttHVy

--HG--
extra : transplant_source : 0T%B0%FA%C0%85v%8B%16%E7%81%03p%F5K%97%B1%9E%92%27
2017-04-03 20:43:29 -07:00
Olli Pettay 98fff73826 Bug 1351303, add main thread only cache for nsIAtoms to speed up atomization, r=froydnj
--HG--
extra : rebase_source : 9c67cd71c0721329eaeaaa96a295e90abc480042
2017-04-03 23:13:18 +03:00
Olli Pettay ac0ae74439 Bug 1352734, use memcmp for nsIAtom Equals to improve performance, r=hsivonen
--HG--
extra : rebase_source : 1a78863c52f088609a6edcb6b32bf16bc02a4118
2017-04-02 22:40:06 +03:00
Henri Sivonen c514501f1a Bug 1295611 - Add mozilla::Span. r=froydnj,gerv.
MozReview-Commit-ID: HGNDClVctbE
2017-03-31 13:32:18 +03:00
Eric Rahm 478755933a Bug 1351732 - Part 2: Replace use of PLArena with ArenaAllocator in xpcom. r=froydnj
This swaps xpcom's plarena usage to ArenaAllocator. The new ArenaStrdup
extensions are used as well.

MozReview-Commit-ID: DHDfl6IkGJL
2017-03-30 16:46:58 -07: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
Eric Rahm 9379e75d2f Bug 1350423 - Remove unused PL_ARENA macro in nsStaticNameTable. r=froydnj
MozReview-Commit-ID: 48qPrN7IOnf
2017-03-27 09:15:38 -07:00
Eric Rahm b8b8dd4a0c Bug 1348123 - Add release bounds checking when inserting and replacing. r=froydnj
This adds release bounds checking to ReplaceElementsAt, InsertElementAt, and
InsertElementsAt to make sure the insertion point is within the current array
bounds.

MozReview-Commit-ID: 1pFr8LuOROI
2017-03-17 16:40:53 -07:00
Xidorn Quan cf27123d34 Bug 1345804 part 1 - Constify several stuff in nsIAtom. r=erahm
MozReview-Commit-ID: Izzu0MpcKMr

--HG--
extra : rebase_source : 4c44fc79f5d0c4fd34f77c8c14e0888186e2a4f0
2017-03-10 11:38:49 +11:00
Eric Rahm 3bec954d62 Bug 792209 - Remove nsISupportsArray. r=froydnj
MozReview-Commit-ID: G28VUoYj9Wj
2016-11-17 11:45:41 -08:00
Andrew McCreight 2971fabfd4 Bug 1344848 - Don't check for atom leaks unless we're checking for other leaks. r=erahm
MozReview-Commit-ID: H5x8cLv0YGk
2017-03-06 22:27:08 -05:00
Xidorn Quan 01addcd50e Bug 1342303 part 6 - Remove nsCOMArray::Enumerate{Forwards,Backwards}. r=erahm
MozReview-Commit-ID: GLappWGZdtz

--HG--
extra : rebase_source : 0c191193ff5a6040a809d17ac234b5e9e733656e
2017-02-24 21:37:07 +11:00
Xidorn Quan 5068cf4922 Bug 1342303 part 2 - Add range-based for loop support to nsCOMArray. r=erahm
MozReview-Commit-ID: 7T8Z0PVg2ex

--HG--
extra : rebase_source : 8108344d6607145b231e20d82cf2b3792ce5a4bd
2017-02-24 21:31:15 +11:00
Xidorn Quan 63753595c2 Bug 1342303 part 1 - Make nsTArrayIterator an independent class. r=erahm
MozReview-Commit-ID: LbkIGEH0Irl

--HG--
extra : rebase_source : d5782ab4cc9c0f0570ecba490bec989ce55bb654
2017-02-24 16:14:06 +11:00
Wes Kocher 5bb9a497ef Backed out 6 changesets (bug 1342303) for build bustage a=backout
Backed out changeset 89137679a68c (bug 1342303)
Backed out changeset 20a1bcb47c33 (bug 1342303)
Backed out changeset bc3b2e7a383b (bug 1342303)
Backed out changeset bdc491b9ebde (bug 1342303)
Backed out changeset 5c6042dee665 (bug 1342303)
Backed out changeset b5de1dfff82f (bug 1342303)

MozReview-Commit-ID: BjlVAX480jI
2017-03-02 16:35:43 -08:00
Xidorn Quan 1297589623 Bug 1342303 part 6 - Remove nsCOMArray::Enumerate{Forwards,Backwards}. r=erahm
MozReview-Commit-ID: GLappWGZdtz

--HG--
extra : rebase_source : 72ebafcbf89b8fce123101d23c3d65bbc8c3bdff
2017-02-24 21:37:07 +11:00
Xidorn Quan 9fba97cea0 Bug 1342303 part 2 - Add range-based for loop support to nsCOMArray. r=erahm
MozReview-Commit-ID: 7T8Z0PVg2ex

--HG--
extra : rebase_source : 8108344d6607145b231e20d82cf2b3792ce5a4bd
2017-02-24 21:31:15 +11:00
Xidorn Quan d21a17fac7 Bug 1342303 part 1 - Make nsTArrayIterator an independent class. r=erahm
MozReview-Commit-ID: LbkIGEH0Irl

--HG--
extra : rebase_source : d5782ab4cc9c0f0570ecba490bec989ce55bb654
2017-02-24 16:14:06 +11:00
Ehsan Akhgari 116c304388 Bug 1342560 - Guarantee that the empty string atom is always static; r=froydnj 2017-02-27 10:51:43 -05:00
Honza Bambas 5aaba51ccb Bug 1340581 - Add some release-grade assertions to mozilla::Tokenizer to catch string overflows. r=froydnj
--HG--
extra : rebase_source : 2c2553e08061c5b3db915b2edcb19716aeac1cce
2017-02-22 06:53:00 -05:00
Emanuel Hoogeveen 23c68657e0 Bug 1338574 - Part 7: Use MOZ_CRASH_UNSAFE_PRINTF in XPCOM. r=froydnj
--HG--
extra : rebase_source : 472e0aa151692bda55b7bf3f8d98cf7bb4488481
2017-02-21 18:02:03 +01: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
Boris Zbarsky 9d04143631 Bug 1330699 part 1. Add a ClearElementAt API to nsTArray. r=froydnj 2017-02-14 23:59:59 -05: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
Gerald Squelart dade4b9e6e Bug 1336215 - Make nsDeque::ConstIterator resistant to size changes - r=froydnj
Note that iterators stay at the same index if the deque size changes
(including end-iterators staying at the end).
This means that after front operations, iterators will effectively point at
different elements! (Possibly skipping or re-visiting some.)
But this is consistent with ForEach and hand-crafted index-based for loops.

MozReview-Commit-ID: 5IvazJR68dG

--HG--
extra : rebase_source : c574fd2d2642d784482698c0fc861269200d1059
2017-02-03 09:19:47 +11:00
Gerald Squelart d109b21181 Bug 1336215 - More complete and consistent nsDeque doc, deleted special copy members - r=froydnj
MozReview-Commit-ID: GvjFPiX6lii

--HG--
extra : rebase_source : 1ffc8392106757743f0718aa5cf68d03aa16e384
2017-02-03 12:43:13 +11:00
Gerald Squelart d5ce43788f Bug 1322700 - Enable range-for with nsDeque - r=froydnj
It's now possible to write:
  for (void* item : deque) { ... }

MozReview-Commit-ID: FLoczCZd77y

--HG--
extra : rebase_source : 237293e94b478beb2bf352c1179d42c289dda145
2017-02-02 12:28:35 +11:00
Jorg K 22cddce9af Bug 1335854 - Tone down non-zero refcount message for dynamic atoms. r=froydnj
--HG--
extra : rebase_source : 31bef82b308fc5f7bd4eebbf898820e0b10640c0
2017-02-01 11:47:00 -05:00
Nathan Froyd f5c90c28e1 Bug 1276669 - part 11 - strengthen assertions for atom table shutdown GC; r=erahm
This could have been done more simply, but the small amount of
refactoring that takes place in this comment enables better error
messages in the case where something does go wrong.
2017-01-26 16:43:38 -04:00
Nathan Froyd ad51ed8360 Bug 1276669 - part 10 - remove dynamic->static atom transmutation code; r=erahm
Good riddance to some sketchy code.
2017-01-26 15:43:38 -05:00
Nathan Froyd 141f9b249d Bug 1276669 - part 9 - forbid transmutation of dynamic atoms; r=erahm
We can do this now that we've shuffled static atom initialization around
appropriately.
2017-01-26 15:43:38 -05:00
Nathan Froyd b9192afdae Bug 1276669 - part 7 - don't register static atoms after the table has been sealed; r=erahm
This change seems like an obvious thing we should have been doing, but
we weren't.
2017-01-26 15:43:38 -05:00
Julian Seward 8a908912d3 Bug 1232696 - Remove NS_DECL_AND_IMPL_ZEROING_OPERATOR_NEW as it causes segfaulting for GCC 6 builds (5 of 5, fixes for docshell/). r=bzbarsky. 2017-01-24 17:12:10 +01:00
Benjamin Smedberg 2b3617b084 Bug 1332631 part C - file moves from xpcom/glue to xpcom/ds, r=froydnj
MozReview-Commit-ID: 9ZhC5bROWdO

--HG--
rename : xpcom/glue/Observer.h => xpcom/ds/Observer.h
rename : xpcom/glue/PLDHashTable.cpp => xpcom/ds/PLDHashTable.cpp
rename : xpcom/glue/PLDHashTable.h => xpcom/ds/PLDHashTable.h
rename : xpcom/glue/nsArrayEnumerator.cpp => xpcom/ds/nsArrayEnumerator.cpp
rename : xpcom/glue/nsArrayEnumerator.h => xpcom/ds/nsArrayEnumerator.h
rename : xpcom/glue/nsArrayUtils.cpp => xpcom/ds/nsArrayUtils.cpp
rename : xpcom/glue/nsArrayUtils.h => xpcom/ds/nsArrayUtils.h
rename : xpcom/glue/nsBaseHashtable.h => xpcom/ds/nsBaseHashtable.h
rename : xpcom/glue/nsCOMArray.cpp => xpcom/ds/nsCOMArray.cpp
rename : xpcom/glue/nsCOMArray.h => xpcom/ds/nsCOMArray.h
rename : xpcom/glue/nsClassHashtable.h => xpcom/ds/nsClassHashtable.h
rename : xpcom/glue/nsDataHashtable.h => xpcom/ds/nsDataHashtable.h
rename : xpcom/glue/nsDeque.cpp => xpcom/ds/nsDeque.cpp
rename : xpcom/glue/nsDeque.h => xpcom/ds/nsDeque.h
rename : xpcom/glue/nsEnumeratorUtils.cpp => xpcom/ds/nsEnumeratorUtils.cpp
rename : xpcom/glue/nsEnumeratorUtils.h => xpcom/ds/nsEnumeratorUtils.h
rename : xpcom/glue/nsHashKeys.h => xpcom/ds/nsHashKeys.h
rename : xpcom/glue/nsInterfaceHashtable.h => xpcom/ds/nsInterfaceHashtable.h
rename : xpcom/glue/nsJSThingHashtable.h => xpcom/ds/nsJSThingHashtable.h
rename : xpcom/glue/nsPointerHashKeys.h => xpcom/ds/nsPointerHashKeys.h
rename : xpcom/glue/nsQuickSort.cpp => xpcom/ds/nsQuickSort.cpp
rename : xpcom/glue/nsQuickSort.h => xpcom/ds/nsQuickSort.h
rename : xpcom/glue/nsRefPtrHashtable.h => xpcom/ds/nsRefPtrHashtable.h
rename : xpcom/glue/nsTArray-inl.h => xpcom/ds/nsTArray-inl.h
rename : xpcom/glue/nsTArray.cpp => xpcom/ds/nsTArray.cpp
rename : xpcom/glue/nsTArray.h => xpcom/ds/nsTArray.h
rename : xpcom/glue/nsTArrayForwardDeclare.h => xpcom/ds/nsTArrayForwardDeclare.h
rename : xpcom/glue/nsTHashtable.h => xpcom/ds/nsTHashtable.h
rename : xpcom/glue/nsTObserverArray.cpp => xpcom/ds/nsTObserverArray.cpp
rename : xpcom/glue/nsTObserverArray.h => xpcom/ds/nsTObserverArray.h
rename : xpcom/glue/nsTPriorityQueue.h => xpcom/ds/nsTPriorityQueue.h
extra : rebase_source : 5f0638e3268acb932e1a8d3f499d283bc1922acd
extra : histedit_source : dcea9485885877bb02f95a1ecc627465a507f757
2017-01-20 13:59:21 -05:00
Nathan Froyd ec503a0996 Bug 1329718 - remove nsISupportsVoid and associated machinery; r=erahm
Nothing uses it, it's virtually impossible to use from script, and there
are better ways to pass a |void*| around in C++.
2017-01-10 16:31:48 -05:00