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

194 Коммитов

Автор SHA1 Сообщение Дата
Simon Giesecke 8730386ad9 Bug 1688833 - Migrate LookupForAdd to WithEntryHandle in xpcom. r=xpcom-reviewers,kmag
Differential Revision: https://phabricator.services.mozilla.com/D104195
2021-02-09 18:19:37 +00:00
Simon Giesecke e3c223da3e Bug 1648010 - Fix uses of NS_LITERAL_STRING with C string literals. r=geckoview-reviewers,agi,froydnj
Differential Revision: https://phabricator.services.mozilla.com/D80861
2020-07-01 08:34:12 +00:00
Eric Rahm 2bd348aaf4 Bug 1627390 - Add missing includes and namespaces to xpcom/io. r=xpcom-reviewers,sg
Differential Revision: https://phabricator.services.mozilla.com/D69656

--HG--
extra : moz-landing-system : lando
2020-04-07 19:09:47 +00:00
Simon Giesecke 30984f7bab Bug 1613985 - Use default for equivalent-to-default constructors/destructors in xpcom. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D62543

--HG--
extra : moz-landing-system : lando
2020-02-12 11:13:33 +00:00
Eric Rahm 6d75492859 Bug 1241518 - Part 1: Remove unused nsAutoPtr.h includes in xpcom/ r=kmag
This removes various unused `#include "nsAutoPtr.h"` in `xpcom/`. Additionally
adds a few includes to the media stack.

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

--HG--
extra : moz-landing-system : lando
2020-01-07 00:06:01 +00:00
Emilio Cobos Álvarez d11fea7f89 Bug 1599614 - nsDirectoryService::SetCurrentProcessDirectory is infallible. r=froydnj
Depends on D54829

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

--HG--
extra : moz-landing-system : lando
2019-12-02 13:56:14 +00:00
Gijs Kruitbosch 81785d9cb9 Bug 1163021 - add debug assert that directory service usage happens only on the main thread, r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D45832

--HG--
extra : moz-landing-system : lando
2019-09-13 16:08:48 +00:00
Gijs Kruitbosch e3898f89a1 Bug 1163079 - ensure we fetch app/profile dir information on the main thread in GeckoChildProcessHost r=jld,bryce,haik
Differential Revision: https://phabricator.services.mozilla.com/D42860

--HG--
extra : moz-landing-system : lando
2019-09-04 12:04:52 +00:00
Boris Zbarsky d24853373a Bug 1551647. Stop using [array] in nsIProperties. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D31110

--HG--
extra : moz-landing-system : lando
2019-05-14 18:46:13 +00:00
Alex Gaynor 177fb00eba Bug 1375863 - fold MOZ_CONTENT_SANDBOX and MOZ_GMP_SANDBOX into MOZ_SANDBOX; r=jld,firefox-build-system-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D22975

--HG--
extra : moz-landing-system : lando
2019-03-18 22:31:59 +00:00
Ehsan Akhgari e5e885ae31 Bug 1521000 - Part 2: Adjust our clang-format rules to include spaces after the hash for nested preprocessor directives r=sylvestre
# ignore-this-changeset

--HG--
extra : amend_source : 7221c8d15a765df71171099468e7c7faa648f37c
extra : histedit_source : a0cce6015636202bff09e35a13f72e03257a7695
2019-01-18 10:16:18 +01:00
Sylvestre Ledru 265e672179 Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
# ignore-this-changeset

--HG--
extra : amend_source : 4d301d3b0b8711c4692392aa76088ba7fd7d1022
2018-11-30 11:46:48 +01:00
Kris Maglione 7c4ecc33ad Bug 1486182: Follow-up: Fix straggler nsIUTF8StringEnumerator references. r=bustage CLOSED TREE
--HG--
extra : amend_source : 78712fd8de524cb047e6e398c47333bacfcd85db
2018-08-28 14:29:16 -07:00
Cameron McCormack 1cbfafaeb7 Bug 1482782 - Part 2: Move directory service atoms into nsGkAtoms. r=njn
Summary: Depends On D3280

Reviewers: njn!

Tags: #secure-revision

Bug #: 1482782

Differential Revision: https://phabricator.services.mozilla.com/D3281
2018-08-15 15:46:00 +10:00
Narcis Beleuzu d20e8e7674 Backed out 8 changesets (bug 1483121, bug 1482782) for build bustages on nsDirectoryService.cpp. CLOSED TREE
Backed out changeset 0a8334bbcf45 (bug 1483121)
Backed out changeset cb2dcb859071 (bug 1482782)
Backed out changeset c834d4ca2eef (bug 1482782)
Backed out changeset 887de0efbb67 (bug 1482782)
Backed out changeset 018fdb50a6be (bug 1482782)
Backed out changeset 33a8aa8096c9 (bug 1482782)
Backed out changeset e3632354f16e (bug 1482782)
Backed out changeset 46f8319bee82 (bug 1482782)
2018-08-15 09:14:41 +03:00
Cameron McCormack ae87156cab Bug 1482782 - Part 2: Move directory service atoms into nsGkAtoms. r=njn
Summary: Depends On D3280

Reviewers: njn!

Tags: #secure-revision

Bug #: 1482782

Differential Revision: https://phabricator.services.mozilla.com/D3281
2018-08-15 15:46:00 +10:00
Kris Maglione 7aa3564a28 Bug 1477579: Part 3 - Avoid duplicating static strings in category manager entries. r=froydnj
Much like the component manager, many of the strings that we use for category
manager entries are statically allocated. There's no need to duplicate these
strings.

This patch changes the category manager APIs to take nsACStrings rather than
raw pointers, and to pass literal nsCStrings when we know we have a literal
string to begin with. When adding the category entry, it then skips making
copies of any strings with the LITERAL flag.

MozReview-Commit-ID: EJEcYSdNMWs
***
amend-catman

--HG--
extra : source : aa9a8f18e98f930a3d8359565eef02f3f6efc5f9
extra : absorb_source : 81a22ab26ee8017ac43321ff2c987d8096182d37
2018-07-23 17:41:06 -07:00
Brindusan Cristian 91a3707d5f Backed out 3 changesets (bug 1477579) for build bustages on xpcshell\selftest.py and crashtest failures on /components/nsComponentManager.cpp. CLOSED TREE
Backed out changeset aa9a8f18e98f (bug 1477579)
Backed out changeset 5fb0b7746a5d (bug 1477579)
Backed out changeset 8359f8fe4184 (bug 1477579)
2018-07-24 04:55:03 +03:00
Kris Maglione dfd38a6ac3 Bug 1477579: Part 3 - Avoid duplicating static strings in category manager entries. r=froydnj
Much like the component manager, many of the strings that we use for category
manager entries are statically allocated. There's no need to duplicate these
strings.

This patch changes the category manager APIs to take nsACStrings rather than
raw pointers, and to pass literal nsCStrings when we know we have a literal
string to begin with. When adding the category entry, it then skips making
copies of any strings with the LITERAL flag.

MozReview-Commit-ID: EJEcYSdNMWs
***
amend-catman

--HG--
extra : rebase_source : 4f70e7b296ecf3b52a4892c92155c7c163d424d2
2018-07-23 17:41:06 -07: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
Josh Aas e70eb1edef Bug 1449686 - Remove most XPCOM special directories as they are unused. r=froydnj 2018-06-25 09:55:00 +03:00
Nicholas Nethercote 9ea93c4f7b Bug 1449395 - Remove nsStaticAtomSetup. r=froydnj
Each nsStaticAtomSetup contains a pointer to a static atom, and also a pointer
to the canonical pointer to that static atom. Which is pretty weird! The
notable thing thing about it is that these structs are in an array, and that
gives us the only way to iterate over all static atoms in a single class, for
registration and lookups.

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

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

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

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

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

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

Other notable things in the patch:

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

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

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

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

MozReview-Commit-ID: 1GmfKidLjaU

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

MozReview-Commit-ID: IpMmbXwZHhu

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

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

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

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

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

MozReview-Commit-ID: 9Yx6M0VUaH4

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

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

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

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

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

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

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

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

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

MozReview-Commit-ID: 4AxPv05ngZy
2018-03-26 11:18:31 +02:00
Nicholas Nethercote d81eb773d4 Bug 1445892 - Remove nsDirectoryService::sOS_HomeDirectory atom. r=froydnj
nsGkAtoms::Home and nsDirectoryAtoms::sOS_HomeDirectory are duplicate static
atoms. This patch comments out the latter to remove the duplication.

MozReview-Commit-ID: LGkjZn0zaoz
2018-03-22 19:07:40 +11:00
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
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
Mike Hommey 3af63f59c0 Bug 1403366 - When NS_XPCOM_INIT_CURRENT_PROCESS_DIR is not already set, fallback to BinaryPath's parent. r=froydnj
The Windows and OSX code paths were essentially doing the same thing,
and the Unix fallback was using an old convention that is pretty much
outdated.

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

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

--HG--
extra : rebase_source : 32f5080ecb8165cffd601799e72d278b482b0871
2017-09-28 08:46:43 +09:00
Sebastian Hengst 91443682cd Backed out changeset bc7ca663b817 (bug 1403366) because it depended on backed out bug 1405174. r=backout 2017-10-04 01:27:50 +02:00
Sebastian Hengst 2d086eadde Backed out changeset 207925bbf88d (bug 1403366) 2017-10-04 01:27:02 +02:00
Mike Hommey 863d6e0695 Bug 1403366 - When NS_XPCOM_INIT_CURRENT_PROCESS_DIR is not already set, fallback to BinaryPath's parent. r=froydnj
The Windows and OSX code paths were essentially doing the same thing,
and the Unix fallback was using an old convention that is pretty much
outdated.

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

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

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

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

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

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

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

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

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

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

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

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

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

MozReview-Commit-ID: DykOl8aEnUJ

--HG--
extra : rebase_source : 254404e318e94b4c93ec8d4081ff0f0fda8aa7d1
2017-09-26 08:33:21 +10:00
Nicholas Nethercote 780a2e4aec Bug 1390428 (part 4) - Remove still more nsXPIDLCString local variables. r=erahm.
These are all easy cases where an nsXPIDLCString local variable is set via
getter_Copies() and then is null checked. The patch uses IsVoid() to replace
the null checks (and get() and EqualsLiteral() calls to replace any implicit
conversions).

--HG--
extra : rebase_source : 484ad42a7816b34b86afbe072e04ba131c1619c6
2017-08-16 13:58:55 +10:00
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 e0fc464fa9 Bug 1376476 - Use Lookup instead of Get+Remove, and LookupForAdd instead of Get+Put, to avoid unnecessary hashtable lookups. r=froydnj
MozReview-Commit-ID: FpFNg0vJXc5
2017-06-28 01:03:17 +02:00
Andrew McCreight 4f63d0eaf2 Bug 1287623, part 2 - Use StaticRefPtr for nsDirectoryService::gService. r=froydnj 2016-07-21 09:54:16 -07:00
Wes Kocher 3bba9b339e Backed out 5 changesets (bug 1287623) for static build bustage CLOSED TREE
Backed out changeset a48daec87ec9 (bug 1287623)
Backed out changeset 248153344e15 (bug 1287623)
Backed out changeset 8aa409c9b1ce (bug 1287623)
Backed out changeset 602d4d88e806 (bug 1287623)
Backed out changeset 114da8bdc0b0 (bug 1287623)
2016-07-20 15:40:33 -07:00
Andrew McCreight 07f2ce5ee2 Bug 1287623, part 2 - Use StaticRefPtr for nsDirectoryService::gService. r=froydnj 2016-07-20 15:19:00 -07:00
Nicholas Nethercote d376f9f82e Bug 1260871 - Remove do_GetAtom() and rename NS_NewAtom() as NS_Atomize(). r=erahm.
do_GetAtom() is currently just a synonym for NS_NewAtom().

--HG--
extra : rebase_source : f4409784f931616cbc300591e6b843d30805c273
2016-03-29 10:09:43 +11:00
Nathan Froyd 01583602a9 Bug 1207245 - part 6 - rename nsRefPtr<T> to RefPtr<T>; r=ehsan; a=Tomcat
The bulk of this commit was generated with a script, executed at the top
level of a typical source code checkout.  The only non-machine-generated
part was modifying MFBT's moz.build to reflect the new naming.

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

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

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

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

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

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

--HG--
rename : mfbt/nsRefPtr.h => mfbt/RefPtr.h
2015-10-18 01:24:48 -04:00
Nathan Froyd 3b0a318c70 Bug 1192230 - clean up reference-counting in xpcom/; r=erahm 2015-07-01 12:27:43 -04:00