Bug 1298676 - part 1 - add IOInterposer::Enable(); r=aklotz

In some parts of the crash reporter, we need to disable I/O
interposition, then turn it back on.  We didn't have a function for
re-enabling the I/O interposer...until now.
This commit is contained in:
Nathan Froyd 2017-01-10 16:31:25 -05:00
parent ab64f4b67c
commit 9d007ffa3e
2 changed files with 16 additions and 0 deletions

View File

@ -186,6 +186,7 @@ public:
}
inline void Disable() { mIsEnabled = false; }
inline void Enable() { mIsEnabled = true; }
void Register(IOInterposeObserver::Operation aOp,
IOInterposeObserver* aObserver)
@ -481,6 +482,15 @@ IOInterposer::Disable()
sMasterList->Disable();
}
void
IOInterposer::Enable()
{
if (!sMasterList) {
return;
}
sMasterList->Enable();
}
void
IOInterposer::Report(IOInterposeObserver::Observation& aObservation)
{

View File

@ -171,6 +171,12 @@ void Clear();
*/
void Disable();
/**
* This function re-enables IOInterposer functionality in a fast, thread-safe
* manner. Primarily for use by the crash reporter.
*/
void Enable();
/**
* Report IO to registered observers.
* Notice that the reported operation must be either OpRead, OpWrite or