зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1298676 - part 2 - add an AutoIOInterposerDisable RAII class; r=aklotz
This will ensure the I/O Interposer is re-enabled after temporarily disabling it.
This commit is contained in:
Родитель
9d007ffa3e
Коммит
0ac6ef352e
|
@ -8,6 +8,7 @@
|
||||||
#define mozilla_IOInterposer_h
|
#define mozilla_IOInterposer_h
|
||||||
|
|
||||||
#include "mozilla/Attributes.h"
|
#include "mozilla/Attributes.h"
|
||||||
|
#include "mozilla/GuardObjects.h"
|
||||||
#include "mozilla/TimeStamp.h"
|
#include "mozilla/TimeStamp.h"
|
||||||
|
|
||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
|
@ -272,6 +273,23 @@ public:
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class MOZ_RAII AutoIOInterposerDisable final
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
explicit AutoIOInterposerDisable(MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM)
|
||||||
|
{
|
||||||
|
MOZ_GUARD_OBJECT_NOTIFIER_INIT;
|
||||||
|
IOInterposer::Disable();
|
||||||
|
}
|
||||||
|
~AutoIOInterposerDisable()
|
||||||
|
{
|
||||||
|
IOInterposer::Enable();
|
||||||
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER
|
||||||
|
};
|
||||||
|
|
||||||
} // namespace mozilla
|
} // namespace mozilla
|
||||||
|
|
||||||
#endif // mozilla_IOInterposer_h
|
#endif // mozilla_IOInterposer_h
|
||||||
|
|
Загрузка…
Ссылка в новой задаче