author | Chris Peterson <cpeterson@mozilla.com> |
Wed, 07 Jun 2017 00:56:55 -0700 | |
changeset 414160 | 6ad111c8d77e537c432b6be11547026557c83dc8 |
parent 414159 | 4b539ebbed3429f6e809a26cb978cab03b673925 |
child 414161 | 2b84935584befd2f613d161678537c1832c2ed5a |
push id | 7566 |
push user | mtabara@mozilla.com |
push date | Wed, 02 Aug 2017 08:25:16 +0000 |
treeherder | mozilla-beta@86913f512c3c [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | froydnj |
bugs | 1373525 |
milestone | 56.0a1 |
first release with | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
--- a/xpcom/build/PoisonIOInterposerBase.cpp +++ b/xpcom/build/PoisonIOInterposerBase.cpp @@ -32,29 +32,29 @@ FileDescriptorToHandle(int aFd) { return aFd; } #endif /* if not XP_WIN32 */ using namespace mozilla; namespace { + struct DebugFilesAutoLockTraits { typedef PRLock* type; typedef const PRLock* const_type; static const_type empty() { return nullptr; } static void release(type aL) { PR_Unlock(aL); } }; class DebugFilesAutoLock : public Scoped<DebugFilesAutoLockTraits> { static PRLock* Lock; public: - static void Clear(); static PRLock* getDebugFileIDsLock() { // On windows this static is not thread safe, but we know that the first // call is from // * An early registration of a debug FD or // * The call to InitWritePoisoning. // Since the early debug FDs are logs created early in the main thread // and no writes are trapped before InitWritePoisoning, we are safe. @@ -70,22 +70,16 @@ public: DebugFilesAutoLock() : Scoped<DebugFilesAutoLockTraits>(getDebugFileIDsLock()) { PR_Lock(get()); } }; PRLock* DebugFilesAutoLock::Lock; -void -DebugFilesAutoLock::Clear() -{ - MOZ_ASSERT(Lock != nullptr); - Lock = nullptr; -} // The ChunkedList<T> class implements, at the high level, a non-iterable // list of instances of T. Its goal is to be somehow minimalist for the // use case of storing the debug files handles here, with the property of // not requiring a lock to look up whether it contains a specific value. // It is also chunked in blocks of chunk_size bytes so that its // initialization doesn't require a memory allocation, while keeping the // possibility to increase its size as necessary. Note that chunks are @@ -203,17 +197,16 @@ typedef ChunkedList<intptr_t> FdList; // an ID is a file descriptor. On Windows it is a file HANDLE. FdList& getDebugFileIDs() { static FdList DebugFileIDs; return DebugFileIDs; } - } // namespace namespace mozilla { // Auxiliary Method to test if a file descriptor is registered to be ignored // by the poisoning IO interposer bool IsDebugFile(intptr_t aFileID)