#include "components/devtools/devtools_pipe/devtools_pipe.h"
#include "build/build_config.h"
#include "content/public/browser/devtools_agent_host.h"
#if BUILDFLAG(IS_WIN)
#include <io.h>
#include <stddef.h>
#include <stdlib.h>
#include "base/win/windows_types.h"
#else
#include <errno.h>
#include <fcntl.h>
#endif
namespace devtools_pipe {
namespace {
#if BUILDFLAG(IS_WIN)
class ScopedInvalidParameterHandlerOverride {
public:
ScopedInvalidParameterHandlerOverride()
: prev_invalid_parameter_handler_(
_set_thread_local_invalid_parameter_handler(
InvalidParameterHandler)) {}
ScopedInvalidParameterHandlerOverride(
const ScopedInvalidParameterHandlerOverride&) = delete;
ScopedInvalidParameterHandlerOverride& operator=(
const ScopedInvalidParameterHandlerOverride&) = delete;
~ScopedInvalidParameterHandlerOverride() {
_set_thread_local_invalid_parameter_handler(
prev_invalid_parameter_handler_);
}
private:
static void InvalidParameterHandler(const wchar_t* expression,
const wchar_t* function,
const wchar_t* file,
unsigned int line,
uintptr_t reserved) {}
const _invalid_parameter_handler prev_invalid_parameter_handler_;
};
#endif
}
bool AreFileDescriptorsOpen() { … }
}