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