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

59 Коммитов

Автор SHA1 Сообщение Дата
David Keeler 05acf3850b bug 1334694 - remove token arguments from nsIX509CertDB.importPKCS12File and exportPKCS12File r=Cykesiopka
MozReview-Commit-ID: Ceo48mcF38I

--HG--
extra : rebase_source : c2738fa9c9bc178059831e9460209bde954fdc84
2017-01-27 15:26:20 -08:00
David Keeler 4b4f5adfbc bug 1329360 - avoid some NSS functions that internally use PK11_GetInternalKeySlot r=Cykesiopka
CERT_AddTempCertToPerm and CERT_ImportCerts (when called with keepCerts=true)
internally use PK11_GetInternalKeySlot. The current plan for making NSS always
available involves initializing it in memory-only mode and later opening the
user's certificate and key databases. Doing so means that
PK11_GetInternalKeySlot will not return the right token, so we can't rely on
functions that make use of it internally. For now we'll simply use equivalent
functions that take an explicit PK11SlotInfo argument and pass in the current
internal token. A later patch will change all places where PSM and Gecko use the
internal token to use the correct token.

MozReview-Commit-ID: CpSo5dIkyVW

--HG--
extra : rebase_source : 4f6e1707b34cb8dcf5e89cf3620c2d76fea39c82
2017-01-06 16:29:12 -08:00
Andrea Marchesini 359ae91eac Bug 1328653 - Merging all the various *OriginAttributes to just one, r=huseby 2017-01-12 17:38:48 +01:00
Cykesiopka 24448ba752 Bug 1325107 - Stop using NS_ASSERTION() in PSM. r=mgoodwin
MOZ_ASSERT() is basically equivalent to NS_ASSERTION().
PSM already uses MOZ_ASSERT() for new code, so there's no need to use
NS_ASSERTION() as well.

MozReview-Commit-ID: JHDsbDkYvHf

--HG--
extra : rebase_source : e9830af8d4355c2a2831a4565c3ba6024056f6d3
2017-01-02 14:11:39 +08:00
David Keeler ca5083ce4d bug 857627 - 4/4: remove nickname-related APIs from nsIX509CertDB r=Cykesiopka,jcj
This removes findCertByNickname, findEmailEncryptionCert, and
findEmailSigningCert.

MozReview-Commit-ID: KOxWHJm3GNX

--HG--
extra : rebase_source : c67a65ce71b25c6502bad012c48aa1c30e71f334
2016-11-18 16:35:27 -08:00
David Keeler 05e56a2501 bug 857627 - 3/4: have nsIX509CertDB.addCert* functions return the added certificate r=Cykesiopka,jcj
This obviates some uses of nsIX509CertDB.findCertByNickname. Other uses are
replaced by equivalent functionality.

MozReview-Commit-ID: 5NCy9mww560

--HG--
extra : rebase_source : cc8506da86e86ae2edef1309e3eb2fddbf8f757e
2016-11-18 15:32:58 -08:00
Jonathan Hao 88a5aac5aa Bug 1315143 - Make OCSP use Origin Attribute framework (PSM). r=Cykesiopka,keeler
--HG--
extra : rebase_source : 6ee53f5f4ce6a0cc842eb27c6890bdfde9563237
2016-11-14 18:26:15 +08:00
Carsten "Tomcat" Book 788a6efc4c Backed out changeset 81a11a25d25d (bug 1315143) 2016-11-14 12:52:16 +01:00
Jonathan Hao 06ffb1f775 Bug 1315143 - Make OCSP use Origin Attribute framework (PSM). r=mayhemer
--HG--
extra : rebase_source : 5047ebd0245729109635ba5ad99dc3f6a18b57ae
2016-11-14 18:26:15 +08:00
David Keeler b3a0669843 bug 1227638 - deterministically load EV information r=Cykesiopka,mgoodwin
Previously PSM would load EV information on-demand (i.e. just before verifying a
certificate). This simplifies this operation, removes a dubious optimization
(loading the EV information on another thread while opening a network
connection), and relocates the loading operation to when we are likely to have
good disk locality (i.e. when we've just loaded the built-in roots module).

This also removes the now-unused MOZ_NO_EV_CERTS build flag.

MozReview-Commit-ID: 8Rnl4ozF95V

--HG--
extra : rebase_source : 5b2e76079c256f7e3c55b1d4ec0d9f654fec44f6
2016-09-30 18:08:08 -07:00
Jonathan Hao d9e14ecf6a Bug 1264562 - Part 4: Instantiates an NSSCertDBTrustDomain containing the first party domain (adapted from Tor Browser patch #13670) r=keeler
--HG--
extra : rebase_source : c43aa11ae06a3281219d1c70c0ec274c258e43c8
2016-10-04 16:49:55 +08:00
Wes Kocher 13054d32fc Backed out changeset 003ec40aa484 (bug 1227638) for android Cpp failures a=backout 2016-10-17 15:08:41 -07:00
David Keeler ec181af1f7 bug 1227638 - deterministically load EV information r=Cykesiopka,mgoodwin
Previously PSM would load EV information on-demand (i.e. just before verifying a
certificate). This simplifies this operation, removes a dubious optimization
(loading the EV information on another thread while opening a network
connection), and relocates the loading operation to when we are likely to have
good disk locality (i.e. when we've just loaded the built-in roots module).

This also removes the now-unused MOZ_NO_EV_CERTS build flag.

MozReview-Commit-ID: 8Rnl4ozF95V

--HG--
extra : rebase_source : 344b68c81af1ed3fb038e4e96c3c50e939d32c3d
2016-09-30 18:08:08 -07:00
Cykesiopka 275d94abd0 Bug 1296317 - Stop calling PR_SetError() in VerifyCert() and VerifySSLServerCert(). r=keeler
The PR_SetError() + PR_GetError() pattern currently used is error prone and
unnecessary. The functions involved can instead return mozilla::pkix::Result,
which is equally expressive and more robust.

MozReview-Commit-ID: Hkd39eqTvds

--HG--
extra : rebase_source : f09e37c6a3a930c30cce003139df86bc84d771ee
2016-10-10 15:44:41 +08:00
Sergei Chernov 976d5c3f1d Bug 1293231 - Certificate Transparency - basic telemetry reports; r=Cykesiopka,keeler
MozReview-Commit-ID: EGvuZADObJo

--HG--
extra : rebase_source : 9a059c9f8e2fdf9bfc693b0b5649808b1beeb67b
2016-08-11 13:41:50 +03:00
Cykesiopka 80c7f24081 Bug 1274135 - Replace char_ptr_cast() and uint8_t_ptr_cast() with mozilla::BitwiseCast. r=keeler,valentin
The functions aren't necessary now that we have BitwiseCast.

MozReview-Commit-ID: 2nzOuwAop4Y

--HG--
extra : rebase_source : 0cb2c16f484a81b2e77384564973b58ac2d10fb9
2016-09-08 20:46:26 +08:00
Ryan VanderMeulen 57d3c61d9b Backed out changeset db5d2a3899c0 (bug 1274135) for bustage. 2016-09-07 20:52:18 -04:00
Cykesiopka 0193f94d53 Bug 1274135 - Replace char_ptr_cast() and uint8_t_ptr_cast() with mozilla::BitwiseCast. r=keeler,valentin
The functions aren't necessary now that we have BitwiseCast.

MozReview-Commit-ID: 2nzOuwAop4Y

--HG--
extra : rebase_source : 196449249eec75b8eb10e59662231c3f4e83c268
2016-09-01 15:58:51 +08:00
David Keeler abc60241f8 bug 1290613 - test_ev_certs.js cleanup r=Cykesiopka,mgoodwin
MozReview-Commit-ID: KcCV161J3qV

--HG--
rename : security/manager/ssl/tests/unit/test_ev_certs/ev-valid-anypolicy-int.pem => security/manager/ssl/tests/unit/test_ev_certs/anyPolicy-int-path-ee.pem
rename : security/manager/ssl/tests/unit/test_ev_certs/ev-valid-anypolicy-int.pem.certspec => security/manager/ssl/tests/unit/test_ev_certs/anyPolicy-int-path-ee.pem.certspec
rename : security/manager/ssl/tests/unit/test_ev_certs/int-ev-valid-anypolicy-int.pem => security/manager/ssl/tests/unit/test_ev_certs/anyPolicy-int-path-int.pem
rename : security/manager/ssl/tests/unit/test_ev_certs/int-ev-valid-anypolicy-int.pem.certspec => security/manager/ssl/tests/unit/test_ev_certs/anyPolicy-int-path-int.pem.certspec
rename : security/manager/ssl/tests/unit/test_ev_certs/no-ocsp-url-cert.pem => security/manager/ssl/tests/unit/test_ev_certs/no-ocsp-ee-path-ee.pem
rename : security/manager/ssl/tests/unit/test_ev_certs/no-ocsp-url-cert.pem.certspec => security/manager/ssl/tests/unit/test_ev_certs/no-ocsp-ee-path-ee.pem.certspec
rename : security/manager/ssl/tests/unit/test_ev_certs/non-ev-root.pem => security/manager/ssl/tests/unit/test_ev_certs/non-ev-root-path-ee.pem
rename : security/manager/ssl/tests/unit/test_ev_certs/non-ev-root.pem.certspec => security/manager/ssl/tests/unit/test_ev_certs/non-ev-root-path-ee.pem.certspec
rename : security/manager/ssl/tests/unit/test_ev_certs/int-non-ev-root.pem => security/manager/ssl/tests/unit/test_ev_certs/non-ev-root-path-int.pem
rename : security/manager/ssl/tests/unit/test_ev_certs/int-non-ev-root.pem.certspec => security/manager/ssl/tests/unit/test_ev_certs/non-ev-root-path-int.pem.certspec
rename : security/manager/ssl/tests/unit/test_ev_certs/ev-valid.pem => security/manager/ssl/tests/unit/test_ev_certs/test-oid-path-ee.pem
rename : security/manager/ssl/tests/unit/test_ev_certs/ev-valid.pem.certspec => security/manager/ssl/tests/unit/test_ev_certs/test-oid-path-ee.pem.certspec
rename : security/manager/ssl/tests/unit/test_ev_certs/int-ev-valid.key => security/manager/ssl/tests/unit/test_ev_certs/test-oid-path-int.key
rename : security/manager/ssl/tests/unit/test_ev_certs/int-ev-valid.key.keyspec => security/manager/ssl/tests/unit/test_ev_certs/test-oid-path-int.key.keyspec
rename : security/manager/ssl/tests/unit/test_ev_certs/int-ev-valid.pem => security/manager/ssl/tests/unit/test_ev_certs/test-oid-path-int.pem
rename : security/manager/ssl/tests/unit/test_ev_certs/int-ev-valid.pem.certspec => security/manager/ssl/tests/unit/test_ev_certs/test-oid-path-int.pem.certspec
extra : rebase_source : 4a84a44616a396ae484550fcfcaf0df5e533dd51
2016-08-01 17:01:27 -07:00
Ryan VanderMeulen 69113163cf Merge m-c to inbound. a=merge 2016-08-24 09:09:05 -04:00
Cykesiopka ba96e52654 Bug 1296219 - Use the Mozilla Base64 functions instead of the NSPR ones in PSM. r=keeler
NSPR should generally be avoided in favour of modern C++ code.

This patch does not convert uses of the NSS Base64 functions. It does however
take the opportunity to switch over some IDL functions to use the safer Mozilla
string classes, and fixes Bug 1251050 along the way.

MozReview-Commit-ID: CM8g9DzIcnC

--HG--
extra : rebase_source : 9d07db1bcefc9d9ed6a1f7e102f5c01bd9caa522
2016-08-23 13:29:15 +08:00
Cykesiopka a16f7b0f6a Bug 1296316 - Convert nsNSSShutDownObject::CalledFromType to an enum class. r=mgoodwin
enum classes are in general safer than plain enums, and as such should be
preferred.

MozReview-Commit-ID: 1FK89SNhdk4

--HG--
extra : rebase_source : 764c4855026c02d8c9e33ca33637fec54ea5ca31
2016-08-20 23:00:19 +08:00
Kan-Ru Chen b6d880aca1 Bug 1297276 - Rename mfbt/unused.h to mfbt/Unused.h for consistency. r=froydnj
The patch is generated from following command:

  rgrep -l unused.h|xargs sed -i -e s,mozilla/unused.h,mozilla/Unused.h,

MozReview-Commit-ID: AtLcWApZfES


--HG--
rename : mfbt/unused.h => mfbt/Unused.h
2016-08-24 14:47:04 +08:00
Cykesiopka 54a22335cb Bug 1281569 - Remove unnecessary step of converting nsIX509Certs to Raw DER just to create a CERTCertificate in nsNSSCertificateDB. r=keeler
There are a few places in nsNSSCertificateDB.cpp where the following is done:
1. GetRawDER() is called on a nsIX509Cert to obtain the DER representation of
   the cert.
2. The DER is used to construct a CERTCertificate for use with NSS functions.

This step of converting to the DER is unnecessary, since GetCert() will provide
an already constructed CERTCertificate.

MozReview-Commit-ID: 35KMYI7dCXc

--HG--
extra : transplant_source : %CA%ED%AC/%E3%29D%BB%8D%0F%A9Y%19%B2%E7a%1B%BE%ADv
2016-07-05 02:59:18 -07:00
David Keeler 0b291c778a bug 1023621 - add asynchronous certificate verification API r=Cykesiopka
This API (nsIX509CertDB.asyncVerifyCertAtTime) will eventually replace
nsIX509Cert.getUsagesArray, nsIX509Cert.requestUsagesArrayAsync, and
nsIX509Cert.getUsagesString because those APIs are architecturally problematic
and don't give very precise information in any case.

MozReview-Commit-ID: OzQaBnDRIo

--HG--
extra : rebase_source : 270de8dfa5ed5221a1e012661161842c0afb3e70
2016-06-30 14:09:18 -07:00
Cykesiopka 90d2c0d630 Bug 1281955 - Don't Adopt() NSS allocated strings in PSM to avoid using the wrong deallocator. r=dkeeler
There are a few places in PSM where the result of an NSS function returning
char* is adopted by e.g. an nsXPIDLCString, which will use the wrong deallocator
when the string eventually gets destroyed.

This is basically Bug 1281564, but the free() call is buried within the Mozilla
string code instead.

MozReview-Commit-ID: HVSMyRpLnjS

--HG--
extra : transplant_source : Msmc%DB%16%23%87%00%A1%05%ABB%0BD%97%3B%A1%E7x
2016-06-29 18:42:37 -07:00
David Keeler 8ba29d1473 bug 1265113 - implement platform support for enterprise roots r=Cykesiopka,mhowell,rbarnes
MozReview-Commit-ID: JKxwCjoH0Oa

--HG--
extra : rebase_source : 9eaf3f1c5371e7b4b4df304bc6ce132ade5775da
2016-04-13 15:36:22 -07:00
Cykesiopka 6b12fc8650 Bug 1271501 - Use mozilla::BitwiseCast instead of reinterpret_cast in PSM. r=keeler
mozilla::BitwiseCast does the same thing, but provides static asserts that
mitigate some of the risk of using reinterpret_cast.

MozReview-Commit-ID: ENQ8QC6Nl9o

--HG--
extra : rebase_source : c1725c8363c0f7f9877601de5ab5f152ef4d0439
2016-05-18 21:20:56 -07:00
Cykesiopka 5e0c49ff77 Bug 1271501 - Remove unnecessary uses of reinterpret_cast in PSM. r=keeler
These uses of reinterpret_cast are either pointless, or can be removed via
refactoring.

MozReview-Commit-ID: Aw2rlJfrT6J

--HG--
extra : rebase_source : 243d6c38eedc086c59d47c93d4a57cb6a922910a
2016-05-18 18:58:40 -07:00
Cykesiopka 8f7bebaa5c Bug 160122 - Stop using PR_smprintf in PSM. r=keeler
The (more) modern Mozilla string classes can be used instead, which at the very
least provide built in automatic memory management and performance improvements.

MozReview-Commit-ID: 4l2Er5rkeI0

--HG--
extra : transplant_source : %A1%16%AB%02m%CA%25HfW%40%96Mq%0D%F0%91%9C%99%29
2016-05-10 23:38:55 -07:00
Cykesiopka 391584fd9d Bug 1270005 - Replace uses of ScopedPK11SlotInfo with UniquePK11SlotInfo in PSM. r=keeler
ScopedPK11SlotInfo is based on Scoped.h, which is deprecated in favour of the
standardised UniquePtr.

Also changes PK11SlotInfo parameters of various functions to make ownership more
explicit, and replaces some manual management of PK11SlotInfo pointers.

MozReview-Commit-ID: JtNH2lJsjwx

--HG--
extra : rebase_source : 9d764e0dd3a1f2df14c16f8f14a3c5392770c9a1
2016-05-09 18:02:40 -07:00
Cykesiopka 128f004a1f Bug 1267905 - Replace uses of ScopedCERTCertList with UniqueCERTCertList. r=keeler
ScopedCERTCertList is based on Scoped.h, which is deprecated in favour of the
standardised UniquePtr.

Also changes CERTCertList parameters of various functions to make ownership more
explicit.

MozReview-Commit-ID: EXqxTK6inqy

--HG--
extra : transplant_source : %9B%A9a%94%D1%7E%2BTa%9E%9Fu%9F%02%B3%1AT%1B%F1%F6
2016-05-05 14:56:36 -07:00
Cykesiopka 372fe1a598 Bug 1260643 - Convert most uses of ScopedCERTCertificate in PSM to UniqueCERTCertificate. r=keeler
MozReview-Commit-ID: JnjoUd7d2M0

--HG--
extra : transplant_source : %99x%B6%F5%09%97%E6%60%B6%3C%3C%C2%D5vt%27%0C-%96%1B
2016-04-20 01:14:22 -07:00
David Keeler b2887661d5 bug 1263221 - improve how PSM handles the visibility of __CERT_AddTempCertToPerm r=chmanchester,mgoodwin
MozReview-Commit-ID: GXiXANNa6Op

--HG--
extra : rebase_source : ffb96a89aabd933f200e39d528d6f5f41e035d7e
2016-04-08 10:30:32 -07:00
Cykesiopka b883b2533f Bug 1259909 - Obviate char PORT_Free() calls in PSM. r=keeler
Also converts the longer |UniquePtr<char, void(&)(void*)> foo(..., PORT_Free)|
to the shorter and equivalent |UniquePORTString foo(...)|.

MozReview-Commit-ID: LlrTNUYBP4V

--HG--
extra : transplant_source : afU%FB%0EC%3E%E0pm%A3-%0E%C8%83%CF%0A%B1%9E%ED
2016-04-09 01:03:59 -07:00
David Keeler 9825c57bc3 bug 1239166 - platform work to support Microsoft Family Safety functionality r=froydnj,mgoodwin,mhowell,rbarnes,vladan
MozReview-Commit-ID: GhpJqJB97r9

--HG--
extra : rebase_source : e943c1e4d0f008ffd6b6bb4bb63e1daf27ae2c96
2016-01-12 15:39:43 -08:00
Nathan Froyd 0e58a8d0a5 Bug 1255438 - create nsI{Mutable,}Array directly; r=keeler 2016-03-25 09:36:25 -04:00
Cykesiopka 301ab6716b Bug 1250258 - Partially clean up nsNSSCertificateDB.cpp import methods. r=keeler
MozReview-Commit-ID: Dbk5N1FwdWB

--HG--
extra : rebase_source : d97d4802af2f41218be2d210a8ecdb9bf1885122
2016-03-16 03:54:26 -07:00
sajitk 25babf4ea8 Bug 1219482: Replace PRLogModuleInfo with LazyLogModule in security subdirectory.r=nfroyd 2016-01-28 10:36:00 -08:00
David Keeler 51a37ae665 bug 1241650 - remove nsIX509CertDB.findCertNicknames r=mgoodwin
MozReview-Commit-ID: JtU7H5qGvge

--HG--
extra : rebase_source : fae856a160e5cc987702794f805030b2d1cc3533
2016-01-21 15:14:31 -08:00
Cykesiopka 6a5e8155c8 Bug 1064402 - Part 2: Remove nsIX509CertDB.importServerCertificate() and nsIX509Cert::SERVER_CERT support in importCertsFromFile(). r=keeler 2016-02-06 20:41:11 -08:00
simplyblue addf646a4c Bug 1241646 - remove unused token arguments from nsIX509CertDB r=keeler 2016-01-30 13:50:58 +05:30
Wes Kocher a40af4aa59 Backed out changeset 7ec471c99263 (bug 1219482) to hopefully fix the intermittent hazard failures CLOSED TREE
--HG--
extra : commitid : B8zmd9Xadpz
2016-01-29 10:15:34 -08:00
sajitk 1b0525a9d3 Bug 1219482 - Replace PRLogModuleInfo with LazyLogModule in security subdirectory. r=froydnj
--HG--
extra : rebase_source : 7aed4d8669dccd1270a88a0cacfa254e3b9f5950
2016-01-28 10:36:00 -05:00
David Keeler 2af33cad3c bug 1240173 - improve nsIX509Cert.dbKey r=Cykesiopka
--HG--
extra : rebase_source : 43ceae97c5188fff16e18a66d25a9fdba320bcc8
2016-01-15 14:33:56 -08:00
David Keeler 113252b726 bug 1239455 - rework telemetry for SHA-1 certificates to reflect possible policy states r=Cykesiopka,mgoodwin,rbarnes
Before this patch, we were measuring where SHA-1 was being used in TLS
certificates: nowhere, in end-entities, in intermediates, or in both. However,
the possible SHA-1 policies don't differentiate between end-entities and
intermediates and instead depended on whether or not each certificate has a
notBefore value after 2015 (i.e. >= 0:00:00 1 January 2016 UTC). We need to
gather telemetry on the possible policy configurations.

--HG--
extra : rebase_source : 301c821c8de16ffb924cd198dd0a4d3139536019
2016-01-13 12:50:42 -08:00
Birunthan Mohanathas 44936aabb2 Bug 1217320 - Remove more XPIDL signature comments in .cpp files. r=froydnj
Comment-only, DONTBUILD.
2015-10-27 06:54:25 +02:00
David Keeler 23a0cee1a8 bug 1215690 - remove nsPSMUITracker r=Cykesiopka r=mgoodwin
nsPSMUITracker was problematic. Apparently it was originally intended to prevent
NSS shutdown while NSS-related UI operations were going on (such as choosing a
client certificate). However, when nsNSSComponent would receive the event that
told it to shutdown NSS, it would attempt to call
mShutdownObjectList->evaporateAllNSSResources(), which would call
mActivityState.restrictActivityToCurrentThread(), which failed if such a UI
operation was in progress. This actually prevented the important part of
evaporateAllNSSResources, which is the releasing of all NSS objects in use by
PSM objects. Importantly, nsNSSComponent didn't check for or handle this failure
and proceeded to call NSS_Shutdown(), leaving PSM in an inconsistent state where
it thought it was okay to keep using the NSS objects it had when in fact it
wasn't.
In any case, nsPSMUITracker isn't really necessary as long as we have the
nsNSSShutDownPreventionLock mechanism, which mostly works and is what we should
use instead (or not at all, if no such lock is needed for the operation being
performed (for example, if no NSS functions are being called)).
2015-10-16 14:31:57 -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
Nathan Froyd 583afa0965 Bug 1207245 - part 3 - switch all uses of mozilla::RefPtr<T> to nsRefPtr<T>; r=ehsan
This commit was generated using the following script, executed at the
top level of a typical source code checkout.

 # Don't modify select files in mfbt/ because it's not worth trying to
 # tease out the dependencies currently.
 #
 # Don't modify anything in media/gmp-clearkey/0.1/ because those files
 # use their own RefPtr, defined in their own RefCounted.h.
find . -name '*.cpp' -o -name '*.h' -o -name '*.mm' -o -name '*.idl'| \
    grep -v 'mfbt/RefPtr.h' | \
    grep -v 'mfbt/nsRefPtr.h' | \
    grep -v 'mfbt/RefCounted.h' | \
    grep -v 'media/gmp-clearkey/0.1/' | \
    xargs perl -p -i -e '
 s/mozilla::RefPtr/nsRefPtr/g; # handle declarations in headers
 s/\bRefPtr</nsRefPtr</g; # handle local variables in functions
 s#mozilla/RefPtr.h#mozilla/nsRefPtr.h#; # handle #includes
 s#mfbt/RefPtr.h#mfbt/nsRefPtr.h#;       # handle strange #includes
'

 # |using mozilla::RefPtr;| is OK; |using nsRefPtr;| is invalid syntax.
find . -name '*.cpp' -o -name '*.mm' | xargs sed -i -e '/using nsRefPtr/d'

 # RefPtr.h used |byRef| for dealing with COM-style outparams.
 # nsRefPtr.h uses |getter_AddRefs|.
 # Fixup that mismatch.
find . -name '*.cpp' -o -name '*.h'| \
    xargs perl -p -i -e 's/byRef/getter_AddRefs/g'
2015-10-18 00:40:10 -04:00