Commit 7e7213da authored by dcheng's avatar dcheng Committed by Commit bot

Apply automated fixits for Chrome clang plugin to sandbox.

Working on trimming down plugin warnings on the Windows clang build.

BUG=467287
TBR=cpu@chromium.org

Review URL: https://codereview.chromium.org/1118473005

Cr-Commit-Position: refs/heads/master@{#327558}
parent 7eb5cd9c
......@@ -18,12 +18,12 @@ namespace sandbox {
class AddressSanitizerTests : public ::testing::Test {
public:
void SetUp() {
void SetUp() override {
env_.reset(base::Environment::Create());
had_asan_options_ = env_->GetVar("ASAN_OPTIONS", &old_asan_options_);
}
void TearDown() {
void TearDown() override {
if (had_asan_options_)
ASSERT_TRUE(env_->SetVar("ASAN_OPTIONS", old_asan_options_));
else
......
......@@ -15,25 +15,25 @@ namespace sandbox {
class EatResolverThunk : public ResolverThunk {
public:
EatResolverThunk() : eat_entry_(NULL) {}
virtual ~EatResolverThunk() {}
~EatResolverThunk() override {}
// Implementation of Resolver::Setup.
virtual NTSTATUS Setup(const void* target_module,
const void* interceptor_module,
const char* target_name,
const char* interceptor_name,
const void* interceptor_entry_point,
void* thunk_storage,
size_t storage_bytes,
size_t* storage_used);
NTSTATUS Setup(const void* target_module,
const void* interceptor_module,
const char* target_name,
const char* interceptor_name,
const void* interceptor_entry_point,
void* thunk_storage,
size_t storage_bytes,
size_t* storage_used) override;
// Implementation of Resolver::ResolveTarget.
virtual NTSTATUS ResolveTarget(const void* module,
const char* function_name,
void** address);
NTSTATUS ResolveTarget(const void* module,
const char* function_name,
void** address) override;
// Implementation of Resolver::GetThunkSize.
virtual size_t GetThunkSize() const;
size_t GetThunkSize() const override;
private:
// The entry to patch.
......
......@@ -16,10 +16,10 @@ namespace sandbox {
class FilesystemDispatcher : public Dispatcher {
public:
explicit FilesystemDispatcher(PolicyBase* policy_base);
~FilesystemDispatcher() {}
~FilesystemDispatcher() override {}
// Dispatcher interface.
virtual bool SetupService(InterceptionManager* manager, int service);
bool SetupService(InterceptionManager* manager, int service) override;
private:
// Processes IPC requests coming from calls to NtCreateFile in the target.
......
......@@ -15,10 +15,10 @@ namespace sandbox {
class HandleDispatcher : public Dispatcher {
public:
explicit HandleDispatcher(PolicyBase* policy_base);
~HandleDispatcher() {}
~HandleDispatcher() override {}
// Dispatcher interface.
virtual bool SetupService(InterceptionManager* manager, int service);
bool SetupService(InterceptionManager* manager, int service) override;
private:
// Processes IPC requests coming from calls to
......
......@@ -565,9 +565,9 @@ class UnitTestIPCDispatcher : public Dispatcher {
};
UnitTestIPCDispatcher();
~UnitTestIPCDispatcher() {};
~UnitTestIPCDispatcher() override{};
virtual bool SetupService(InterceptionManager* manager, int service) {
bool SetupService(InterceptionManager* manager, int service) override {
return true;
}
......
......@@ -16,10 +16,10 @@ namespace sandbox {
class NamedPipeDispatcher : public Dispatcher {
public:
explicit NamedPipeDispatcher(PolicyBase* policy_base);
~NamedPipeDispatcher() {}
~NamedPipeDispatcher() override {}
// Dispatcher interface.
virtual bool SetupService(InterceptionManager* manager, int service);
bool SetupService(InterceptionManager* manager, int service) override;
private:
// Processes IPC requests coming from calls to CreateNamedPipeW() in the
......
......@@ -15,10 +15,10 @@ namespace sandbox {
class ProcessMitigationsWin32KDispatcher : public Dispatcher {
public:
explicit ProcessMitigationsWin32KDispatcher(PolicyBase* policy_base);
~ProcessMitigationsWin32KDispatcher() {}
~ProcessMitigationsWin32KDispatcher() override {}
// Dispatcher interface.
virtual bool SetupService(InterceptionManager* manager, int service);
bool SetupService(InterceptionManager* manager, int service) override;
private:
PolicyBase* policy_base_;
......
......@@ -16,10 +16,10 @@ namespace sandbox {
class ThreadProcessDispatcher : public Dispatcher {
public:
explicit ThreadProcessDispatcher(PolicyBase* policy_base);
~ThreadProcessDispatcher() {}
~ThreadProcessDispatcher() override {}
// Dispatcher interface.
virtual bool SetupService(InterceptionManager* manager, int service);
bool SetupService(InterceptionManager* manager, int service) override;
private:
// Processes IPC requests coming from calls to NtOpenThread() in the target.
......
......@@ -16,10 +16,10 @@ namespace sandbox {
class RegistryDispatcher : public Dispatcher {
public:
explicit RegistryDispatcher(PolicyBase* policy_base);
~RegistryDispatcher() {}
~RegistryDispatcher() override {}
// Dispatcher interface.
virtual bool SetupService(InterceptionManager* manager, int service);
bool SetupService(InterceptionManager* manager, int service) override;
private:
// Processes IPC requests coming from calls to NtCreateKey in the target.
......
......@@ -18,30 +18,30 @@ class ServiceResolverThunk : public ResolverThunk {
ServiceResolverThunk(HANDLE process, bool relaxed)
: process_(process), ntdll_base_(NULL),
relaxed_(relaxed), relative_jump_(0) {}
virtual ~ServiceResolverThunk() {}
~ServiceResolverThunk() override {}
// Implementation of Resolver::Setup.
virtual NTSTATUS Setup(const void* target_module,
const void* interceptor_module,
const char* target_name,
const char* interceptor_name,
const void* interceptor_entry_point,
void* thunk_storage,
size_t storage_bytes,
size_t* storage_used);
NTSTATUS Setup(const void* target_module,
const void* interceptor_module,
const char* target_name,
const char* interceptor_name,
const void* interceptor_entry_point,
void* thunk_storage,
size_t storage_bytes,
size_t* storage_used) override;
// Implementation of Resolver::ResolveInterceptor.
virtual NTSTATUS ResolveInterceptor(const void* module,
const char* function_name,
const void** address);
NTSTATUS ResolveInterceptor(const void* module,
const char* function_name,
const void** address) override;
// Implementation of Resolver::ResolveTarget.
virtual NTSTATUS ResolveTarget(const void* module,
const char* function_name,
void** address);
NTSTATUS ResolveTarget(const void* module,
const char* function_name,
void** address) override;
// Implementation of Resolver::GetThunkSize.
virtual size_t GetThunkSize() const;
size_t GetThunkSize() const override;
// Call this to set up ntdll_base_ which will allow for local patches.
virtual void AllowLocalPatches();
......@@ -95,10 +95,10 @@ class Wow64ResolverThunk : public ServiceResolverThunk {
// The service resolver needs a child process to write to.
Wow64ResolverThunk(HANDLE process, bool relaxed)
: ServiceResolverThunk(process, relaxed) {}
virtual ~Wow64ResolverThunk() {}
~Wow64ResolverThunk() override {}
private:
virtual bool IsFunctionAService(void* local_thunk) const;
bool IsFunctionAService(void* local_thunk) const override;
DISALLOW_COPY_AND_ASSIGN(Wow64ResolverThunk);
};
......@@ -110,10 +110,10 @@ class Wow64W8ResolverThunk : public ServiceResolverThunk {
// The service resolver needs a child process to write to.
Wow64W8ResolverThunk(HANDLE process, bool relaxed)
: ServiceResolverThunk(process, relaxed) {}
virtual ~Wow64W8ResolverThunk() {}
~Wow64W8ResolverThunk() override {}
private:
virtual bool IsFunctionAService(void* local_thunk) const;
bool IsFunctionAService(void* local_thunk) const override;
DISALLOW_COPY_AND_ASSIGN(Wow64W8ResolverThunk);
};
......@@ -125,10 +125,10 @@ class Win8ResolverThunk : public ServiceResolverThunk {
// The service resolver needs a child process to write to.
Win8ResolverThunk(HANDLE process, bool relaxed)
: ServiceResolverThunk(process, relaxed) {}
virtual ~Win8ResolverThunk() {}
~Win8ResolverThunk() override {}
private:
virtual bool IsFunctionAService(void* local_thunk) const;
bool IsFunctionAService(void* local_thunk) const override;
DISALLOW_COPY_AND_ASSIGN(Win8ResolverThunk);
};
......
......@@ -15,20 +15,20 @@ namespace sandbox {
class SidestepResolverThunk : public ResolverThunk {
public:
SidestepResolverThunk() {}
virtual ~SidestepResolverThunk() {}
~SidestepResolverThunk() override {}
// Implementation of Resolver::Setup.
virtual NTSTATUS Setup(const void* target_module,
const void* interceptor_module,
const char* target_name,
const char* interceptor_name,
const void* interceptor_entry_point,
void* thunk_storage,
size_t storage_bytes,
size_t* storage_used);
NTSTATUS Setup(const void* target_module,
const void* interceptor_module,
const char* target_name,
const char* interceptor_name,
const void* interceptor_entry_point,
void* thunk_storage,
size_t storage_bytes,
size_t* storage_used) override;
// Implementation of Resolver::GetThunkSize.
virtual size_t GetThunkSize() const;
size_t GetThunkSize() const override;
private:
DISALLOW_COPY_AND_ASSIGN(SidestepResolverThunk);
......@@ -41,20 +41,20 @@ class SidestepResolverThunk : public ResolverThunk {
class SmartSidestepResolverThunk : public SidestepResolverThunk {
public:
SmartSidestepResolverThunk() {}
virtual ~SmartSidestepResolverThunk() {}
~SmartSidestepResolverThunk() override {}
// Implementation of Resolver::Setup.
virtual NTSTATUS Setup(const void* target_module,
const void* interceptor_module,
const char* target_name,
const char* interceptor_name,
const void* interceptor_entry_point,
void* thunk_storage,
size_t storage_bytes,
size_t* storage_used);
NTSTATUS Setup(const void* target_module,
const void* interceptor_module,
const char* target_name,
const char* interceptor_name,
const void* interceptor_entry_point,
void* thunk_storage,
size_t storage_bytes,
size_t* storage_used) override;
// Implementation of Resolver::GetThunkSize.
virtual size_t GetThunkSize() const;
size_t GetThunkSize() const override;
private:
// Performs the actual call to the interceptor if the conditions are correct
......
......@@ -16,10 +16,10 @@ namespace sandbox {
class SyncDispatcher : public Dispatcher {
public:
explicit SyncDispatcher(PolicyBase* policy_base);
~SyncDispatcher() {}
~SyncDispatcher() override {}
// Dispatcher interface.
virtual bool SetupService(InterceptionManager* manager, int service);
bool SetupService(InterceptionManager* manager, int service) override;
private:
// Processes IPC requests coming from calls to CreateEvent in the target.
......
......@@ -43,14 +43,14 @@ class TargetServicesBase : public TargetServices {
TargetServicesBase();
// Public interface of TargetServices.
virtual ResultCode Init();
virtual void LowerToken();
virtual ProcessState* GetState();
virtual ResultCode DuplicateHandle(HANDLE source_handle,
DWORD target_process_id,
HANDLE* target_handle,
DWORD desired_access,
DWORD options);
ResultCode Init() override;
void LowerToken() override;
ProcessState* GetState() override;
ResultCode DuplicateHandle(HANDLE source_handle,
DWORD target_process_id,
HANDLE* target_handle,
DWORD desired_access,
DWORD options) override;
// Factory method.
static TargetServicesBase* GetInstance();
......
......@@ -25,13 +25,14 @@ namespace sandbox {
class Win2kThreadPool : public ThreadProvider {
public:
Win2kThreadPool();
virtual ~Win2kThreadPool();
~Win2kThreadPool() override;
virtual bool RegisterWait(const void* cookie, HANDLE waitable_object,
CrossCallIPCCallback callback,
void* context);
bool RegisterWait(const void* cookie,
HANDLE waitable_object,
CrossCallIPCCallback callback,
void* context) override;
virtual bool UnRegisterWaits(void* cookie);
bool UnRegisterWaits(void* cookie) override;
// Returns the total number of wait objects associated with
// the thread pool.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment