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

28 Коммитов

Автор SHA1 Сообщение Дата
Sylvestre Ledru e226046cb8 Bug 1547143 - Format the tree: Be prescriptive with the pointer style (left) r=Ehsan
# ignore-this-changeset

Depends on D28954

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

--HG--
extra : moz-landing-system : lando
2019-05-01 08:47:10 +00: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 257d9118dc Bug 1409249: Require singleton constructors to return explicit already_AddRefed. r=froydnj
Right now, NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR expects singleton
constructors to return already-addrefed raw pointers, and while it accepts
constructors that return already_AddRefed, most existing don't do so.

Meanwhile, the convention elsewhere is that a raw pointer return value is
owned by the callee, and that the caller needs to addref it if it wants to
keep its own reference to it.

The difference in convention makes it easy to leak (I've definitely caused
more than one shutdown leak this way), so it would be better if we required
the singleton getters to return an explicit already_AddRefed, which would
behave the same for all callers.


This also cleans up several singleton constructors that left a dangling
pointer to their singletons when their initialization methods failed, when
they released their references without clearing their global raw pointers.

MozReview-Commit-ID: 9peyG4pRYcr

--HG--
extra : rebase_source : 2f5bd89c17cb554541be38444672a827c1392f3f
2017-10-16 21:08:42 -07:00
Benjamin Smedberg 9b43ba6de7 Bug 1332631 part G - file moves from xpcom/glue to xpcom/components, and remove GenericModule which is no longer useful, r=froydnj
MozReview-Commit-ID: 5NvfKRAlZqs

--HG--
rename : xpcom/glue/GenericFactory.cpp => xpcom/components/GenericFactory.cpp
rename : xpcom/glue/GenericFactory.h => xpcom/components/GenericFactory.h
rename : xpcom/glue/nsCategoryCache.cpp => xpcom/components/nsCategoryCache.cpp
rename : xpcom/glue/nsCategoryCache.h => xpcom/components/nsCategoryCache.h
rename : xpcom/glue/nsComponentManagerUtils.cpp => xpcom/components/nsComponentManagerUtils.cpp
rename : xpcom/glue/nsComponentManagerUtils.h => xpcom/components/nsComponentManagerUtils.h
rename : xpcom/glue/nsServiceManagerUtils.h => xpcom/components/nsServiceManagerUtils.h
extra : rebase_source : 2f9e4b8de99c2835c4322282b0227ed3f833c285
extra : histedit_source : 45033773c304696050a649e3fbde1ecb33ec1fea
2017-01-20 14:41:10 -05:00
Andrew McCreight 21bb33df87 Bug 1273190, part 1 - Fix indentation and mode lines for various xpcom/ files. r=froydnj 2016-05-24 14:45:44 -07: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
Andrew McCreight 7cbb87eb31 Bug 1210463 - part 3 - Remove the very obsolete NS_IMPL_MOZILLA192_NSGETMODULE. r=froydnj 2015-10-01 15:53:38 -07:00
Andrew McCreight 637dbab1bc Bug 1210463 - part 2 - Use some smart pointers in ModuleUtils.h. r=froydnj 2015-10-01 15:53:38 -07:00
Andrew McCreight 12128fc9ad Bug 1210463 - part 1 - Remove some unneeded null checks on new in ModuleUtils. r=froydnj 2015-10-01 15:53:38 -07:00
Ehsan Akhgari 883849ee32 Bug 1145631 - Part 1: Replace MOZ_OVERRIDE and MOZ_FINAL with override and final in the tree; r=froydnj
This patch was automatically generated using the following script:

function convert() {
echo "Converting $1 to $2..."
find . \
       ! -wholename "*/.git*" \
       ! -wholename "obj-ff-dbg*" \
         -type f \
      \( -iname "*.cpp" \
         -o -iname "*.h" \
         -o -iname "*.c" \
         -o -iname "*.cc" \
         -o -iname "*.idl" \
         -o -iname "*.ipdl" \
         -o -iname "*.ipdlh" \
         -o -iname "*.mm" \) | \
    xargs -n 1 sed -i -e "s/\b$1\b/$2/g"
}

convert MOZ_OVERRIDE override
convert MOZ_FINAL final
2015-03-21 12:28:04 -04:00
Birunthan Mohanathas be57fcc677 Bug 1046841 - Convert xpcom/components/ to Gecko style. r=froydnj 2014-08-02 13:44:06 -07:00
Ryan VanderMeulen f78709c176 Backed out changeset ce357b802532 (bug 1046841) for merge conflicts with bug 977026. 2014-08-01 16:00:35 -04:00
Birunthan Mohanathas c838b087ed Bug 1046841 - Convert xpcom/components/ to Gecko style. r=froydnj 2014-08-01 09:43:23 -07:00
Ehsan Akhgari 3fa82c9346 Bug 1045436 - Fix more bad implicit constructors in XPCOM; r=froydnj 2014-07-29 20:43:56 -04:00
Benoit Jacob 81effa4bca Bug 1028588 - Fix dangerous public destructors in xpcom/ - r=bsmedberg,khuey,nfroyd 2014-06-30 18:11:53 -04:00
Wes Kocher 03da42e8b1 Backed out 4 changesets (bug 1028588) for build bustage
Backed out changeset 13a8bae671ca (bug 1028588)
Backed out changeset 19a19833f1d6 (bug 1028588)
Backed out changeset d5fae80054de (bug 1028588)
Backed out changeset 5942ad3859b8 (bug 1028588)
2014-06-30 15:50:19 -07:00
Benoit Jacob 522e4724cc Bug 1028588 - Fix dangerous public destructors in xpcom/ - r=bsmedberg,khuey,nfroyd 2014-06-30 18:11:53 -04:00
Kyle Huey fe6c4e28d6 Bug 967364: Rename already_AddRefed::get to take. r=bsmedberg 2014-03-15 12:00:15 -07:00
Birunthan Mohanathas 0244dd58be Bug 784739 - Switch from NULL to nullptr in xpcom/ (1/3); r=ehsan 2013-10-10 16:41:00 -04:00
Joshua Cranmer 1a6dffc73f Bug 884061 - Part 3y: Use NS_DECL_THREADSAFE_ISUPPORTS in xpcom/, r=bsmedberg
--HG--
extra : rebase_source : d54f6973e3ff859207115013e8361781769ffc76
2013-07-18 21:31:26 -05:00
Gervase Markham 82ff7027aa Bug 716478 - update licence to MPL 2. 2012-05-21 12:12:37 +01:00
Jeff Walden 55d623be48 Bug 711799 - Add MOZ_FINAL a bunch of places to silence Clang warnings. r=dbaron
--HG--
extra : rebase_source : e87978380d0821746e7df78dfacc7e381aefccb3
2011-12-17 22:47:45 -05:00
Matt Brubeck 347ae519fe Back out bcf9ce858829 and a3bade82ac92 (bug 711799) for build failures 2011-12-19 10:43:08 -08:00
Jeff Walden d6fa425c6b Bug 711799 - Add MOZ_FINAL a bunch of places to silence Clang warnings. r=dbaron
--HG--
extra : rebase_source : 8ca811fe7427626e39f677a672986a27829b0feb
2011-12-17 22:47:45 -05:00
Saint Wesonga 4bd9280674 Bug 562387 - Convert NS_NEWXPCOM/NS_DELETEXPCOM to new/delete. r=bsmedberg 2010-07-05 11:42:18 +02:00
Benjamin Smedberg a677e5bf91 Merge mozilla-central, including the Electrolysis changes, into the branch for bug 568691. 2010-07-01 11:55:57 -04:00
Benjamin Smedberg 1feb3e5e7d Implement compatibility wrapper so that binary components can be compatible with both Firefox 3.6 and Firefox 4, as a result of registration changes from bug 568691.
--HG--
rename : xpcom/components/GenericFactory.cpp => xpcom/glue/GenericFactory.cpp
rename : xpcom/components/GenericFactory.h => xpcom/glue/GenericFactory.h
2010-06-24 16:36:27 -04:00
Benjamin Smedberg c611ebcd81 Bug 568691 part A - register static and binary components using data tables rather than programmatic nsIComponentRegistrar methods. This part contains the important needs-review bits of the change: part B contains the mechanical changes to each module in order to actually get a working build. Part C will contain changes necessary to register JS components from .manifest files 2010-06-10 14:11:11 -04:00