diff options
author | tfarina <tfarina@chromium.org> | 2015-04-27 11:06:14 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-04-27 18:06:29 +0000 |
commit | 25f1faa117156fcf67dc910d551e8225c50bfe75 (patch) | |
tree | 4e46d2911df8c401bd9dd7bdcdae8d66f7d0ff1b | |
parent | a7a4ff82f6f78186faf446e1db4d1443c8496371 (diff) | |
download | chromium_src-25f1faa117156fcf67dc910d551e8225c50bfe75.zip chromium_src-25f1faa117156fcf67dc910d551e8225c50bfe75.tar.gz chromium_src-25f1faa117156fcf67dc910d551e8225c50bfe75.tar.bz2 |
sanbox/win: Fix warnings found by clang chromium-style plugin on Windows.
http://build.chromium.org/p/chromium.fyi/builders/CrWinClang/builds/605/steps/compile/logs/stdio
This fixes the following kind or warnings:
warning(clang): [chromium-style] Complex constructor has an inline body.
warning(clang): [chromium-style] Complex destructor has an inline body.
warning(clang): [chromium-style] complex class/struct needs an explicit out-of-line constructor.
warning(clang): [chromium-style] complex class/struct needs an explicit out-of-line destructor.
BUG=467287
R=thakis@chromium.org,cpu@chromium.org
Review URL: https://codereview.chromium.org/1106203002
Cr-Commit-Position: refs/heads/master@{#327069}
-rw-r--r-- | sandbox/win/src/crosscall_server.cc | 9 | ||||
-rw-r--r-- | sandbox/win/src/crosscall_server.h | 3 | ||||
-rw-r--r-- | sandbox/win/src/handle_closer.cc | 6 | ||||
-rw-r--r-- | sandbox/win/src/handle_closer.h | 1 | ||||
-rw-r--r-- | sandbox/win/src/handle_table.cc | 6 | ||||
-rw-r--r-- | sandbox/win/src/handle_table.h | 3 | ||||
-rw-r--r-- | sandbox/win/src/policy_low_level.cc | 7 | ||||
-rw-r--r-- | sandbox/win/src/policy_low_level.h | 4 | ||||
-rw-r--r-- | sandbox/win/src/restricted_token.cc | 12 | ||||
-rw-r--r-- | sandbox/win/src/restricted_token.h | 10 | ||||
-rw-r--r-- | sandbox/win/src/win2k_threadpool.cc | 4 | ||||
-rw-r--r-- | sandbox/win/src/win2k_threadpool.h | 5 |
12 files changed, 51 insertions, 19 deletions
diff --git a/sandbox/win/src/crosscall_server.cc b/sandbox/win/src/crosscall_server.cc index a01af66..6f8bd74 100644 --- a/sandbox/win/src/crosscall_server.cc +++ b/sandbox/win/src/crosscall_server.cc @@ -2,10 +2,11 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "sandbox/win/src/crosscall_server.h" + #include <string> #include <vector> -#include "sandbox/win/src/crosscall_server.h" #include "sandbox/win/src/crosscall_params.h" #include "sandbox/win/src/crosscall_client.h" #include "base/logging.h" @@ -297,4 +298,10 @@ Dispatcher* Dispatcher::OnMessageReady(IPCParams* ipc, return NULL; } +Dispatcher::Dispatcher() { +} + +Dispatcher::~Dispatcher() { +} + } // namespace sandbox diff --git a/sandbox/win/src/crosscall_server.h b/sandbox/win/src/crosscall_server.h index e754006..41888c1 100644 --- a/sandbox/win/src/crosscall_server.h +++ b/sandbox/win/src/crosscall_server.h @@ -207,7 +207,8 @@ class Dispatcher { // with the given service (IPC). virtual bool SetupService(InterceptionManager* manager, int service) = 0; - virtual ~Dispatcher() {} + Dispatcher(); + virtual ~Dispatcher(); protected: // Structure that defines an IPC Call with all the parameters and the handler. diff --git a/sandbox/win/src/handle_closer.cc b/sandbox/win/src/handle_closer.cc index 4111623..2e3a782 100644 --- a/sandbox/win/src/handle_closer.cc +++ b/sandbox/win/src/handle_closer.cc @@ -32,7 +32,11 @@ namespace sandbox { // Memory buffer mapped from the parent, with the list of handles. SANDBOX_INTERCEPT HandleCloserInfo* g_handles_to_close; -HandleCloser::HandleCloser() {} +HandleCloser::HandleCloser() { +} + +HandleCloser::~HandleCloser() { +} ResultCode HandleCloser::AddHandle(const base::char16* handle_type, const base::char16* handle_name) { diff --git a/sandbox/win/src/handle_closer.h b/sandbox/win/src/handle_closer.h index fa65695..2b43a6e 100644 --- a/sandbox/win/src/handle_closer.h +++ b/sandbox/win/src/handle_closer.h @@ -42,6 +42,7 @@ SANDBOX_INTERCEPT HandleCloserInfo* g_handle_closer_info; class HandleCloser { public: HandleCloser(); + ~HandleCloser(); // Adds a handle that will be closed in the target process after lockdown. // A NULL value for handle_name indicates all handles of the specified type. diff --git a/sandbox/win/src/handle_table.cc b/sandbox/win/src/handle_table.cc index 5575dc0..5ebcf99 100644 --- a/sandbox/win/src/handle_table.cc +++ b/sandbox/win/src/handle_table.cc @@ -64,6 +64,9 @@ HandleTable::HandleTable() { handle_info_internal()->NumberOfHandles, CompareHandleEntries); } +HandleTable::~HandleTable() { +} + HandleTable::Iterator HandleTable::HandlesForProcess(ULONG process_id) const { SYSTEM_HANDLE_INFORMATION key; key.ProcessId = static_cast<USHORT>(process_id); @@ -84,6 +87,9 @@ HandleTable::HandleEntry::HandleEntry( : handle_entry_(handle_info_entry), last_entry_(0) { } +HandleTable::HandleEntry::~HandleEntry() { +} + void HandleTable::HandleEntry::UpdateInfo(UpdateType flag) { static NtQueryObject QueryObject = NULL; if (!QueryObject) diff --git a/sandbox/win/src/handle_table.h b/sandbox/win/src/handle_table.h index 1b553fa..47f625d 100644 --- a/sandbox/win/src/handle_table.h +++ b/sandbox/win/src/handle_table.h @@ -40,6 +40,8 @@ class HandleTable { // Used by the iterator to provide simple caching accessors to handle data. class HandleEntry { public: + ~HandleEntry(); + bool operator==(const HandleEntry& rhs) const { return handle_entry_ == rhs.handle_entry_; } @@ -126,6 +128,7 @@ class HandleTable { }; HandleTable(); + ~HandleTable(); Iterator begin() const { return Iterator(*this, handle_info()->Information, diff --git a/sandbox/win/src/policy_low_level.cc b/sandbox/win/src/policy_low_level.cc index ef9b4e1..739321c 100644 --- a/sandbox/win/src/policy_low_level.cc +++ b/sandbox/win/src/policy_low_level.cc @@ -2,10 +2,11 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "sandbox/win/src/policy_low_level.h" + #include <string> #include <map> -#include "sandbox/win/src/policy_low_level.h" #include "base/basictypes.h" namespace { @@ -31,6 +32,10 @@ namespace { namespace sandbox { +LowLevelPolicy::LowLevelPolicy(PolicyGlobal* policy_store) + : policy_store_(policy_store) { +} + // Adding a rule is nothing more than pushing it into an stl container. Done() // is called for the rule in case the code that made the rule in the first // place has not done it. diff --git a/sandbox/win/src/policy_low_level.h b/sandbox/win/src/policy_low_level.h index 7abc0ef..6a62631 100644 --- a/sandbox/win/src/policy_low_level.h +++ b/sandbox/win/src/policy_low_level.h @@ -82,9 +82,7 @@ class LowLevelPolicy { public: // policy_store: must contain allocated memory and the internal // size fields set to correct values. - explicit LowLevelPolicy(PolicyGlobal* policy_store) - : policy_store_(policy_store) { - } + explicit LowLevelPolicy(PolicyGlobal* policy_store); // Destroys all the policy rules. ~LowLevelPolicy(); diff --git a/sandbox/win/src/restricted_token.cc b/sandbox/win/src/restricted_token.cc index 3960926..7ebef3d 100644 --- a/sandbox/win/src/restricted_token.cc +++ b/sandbox/win/src/restricted_token.cc @@ -10,9 +10,19 @@ #include "sandbox/win/src/acl.h" #include "sandbox/win/src/win_utils.h" - namespace sandbox { +RestrictedToken::RestrictedToken() + : init_(false), + effective_token_(NULL), + integrity_level_(INTEGRITY_LEVEL_LAST) { +} + +RestrictedToken::~RestrictedToken() { + if (effective_token_) + CloseHandle(effective_token_); +} + unsigned RestrictedToken::Init(const HANDLE effective_token) { if (init_) return ERROR_ALREADY_INITIALIZED; diff --git a/sandbox/win/src/restricted_token.h b/sandbox/win/src/restricted_token.h index 6d8e550..565880e 100644 --- a/sandbox/win/src/restricted_token.h +++ b/sandbox/win/src/restricted_token.h @@ -45,14 +45,8 @@ namespace sandbox { class RestrictedToken { public: // Init() has to be called before calling any other method in the class. - RestrictedToken() - : init_(false), effective_token_(NULL), - integrity_level_(INTEGRITY_LEVEL_LAST) { } - - ~RestrictedToken() { - if (effective_token_) - CloseHandle(effective_token_); - } + RestrictedToken(); + ~RestrictedToken(); // Initializes the RestrictedToken object with effective_token. // If effective_token is NULL, it initializes the RestrictedToken object with diff --git a/sandbox/win/src/win2k_threadpool.cc b/sandbox/win/src/win2k_threadpool.cc index 24cbacf..051cfc1 100644 --- a/sandbox/win/src/win2k_threadpool.cc +++ b/sandbox/win/src/win2k_threadpool.cc @@ -8,6 +8,10 @@ namespace sandbox { +Win2kThreadPool::Win2kThreadPool() { + ::InitializeCriticalSection(&lock_); +} + bool Win2kThreadPool::RegisterWait(const void* cookie, HANDLE waitable_object, CrossCallIPCCallback callback, void* context) { diff --git a/sandbox/win/src/win2k_threadpool.h b/sandbox/win/src/win2k_threadpool.h index 0abb358..41cd5f1 100644 --- a/sandbox/win/src/win2k_threadpool.h +++ b/sandbox/win/src/win2k_threadpool.h @@ -24,9 +24,7 @@ namespace sandbox { // This implementation simply thunks to the nice thread pool API of win2k. class Win2kThreadPool : public ThreadProvider { public: - Win2kThreadPool() { - ::InitializeCriticalSection(&lock_); - } + Win2kThreadPool(); virtual ~Win2kThreadPool(); virtual bool RegisterWait(const void* cookie, HANDLE waitable_object, @@ -50,6 +48,7 @@ class Win2kThreadPool : public ThreadProvider { PoolObjects pool_objects_; // This lock protects the list of pool wait objects. CRITICAL_SECTION lock_; + DISALLOW_COPY_AND_ASSIGN(Win2kThreadPool); }; |