michael@0: // Copyright (c) 2011 The Chromium Authors. All rights reserved. michael@0: // Use of this source code is governed by a BSD-style license that can be michael@0: // found in the LICENSE file. michael@0: michael@0: #ifndef SANDBOX_SRC_HANDLE_CLOSER_AGENT_H_ michael@0: #define SANDBOX_SRC_HANDLE_CLOSER_AGENT_H_ michael@0: michael@0: #include "base/basictypes.h" michael@0: #include "base/strings/string16.h" michael@0: #include "sandbox/win/src/handle_closer.h" michael@0: #include "sandbox/win/src/sandbox_types.h" michael@0: michael@0: namespace sandbox { michael@0: michael@0: // Target process code to close the handle list copied over from the broker. michael@0: class HandleCloserAgent { michael@0: public: michael@0: HandleCloserAgent() {} michael@0: michael@0: // Reads the serialized list from the broker and creates the lookup map. michael@0: void InitializeHandlesToClose(); michael@0: michael@0: // Closes any handles matching those in the lookup map. michael@0: bool CloseHandles(); michael@0: michael@0: // True if we have handles waiting to be closed michael@0: static bool NeedsHandlesClosed(); michael@0: michael@0: private: michael@0: HandleMap handles_to_close_; michael@0: michael@0: DISALLOW_COPY_AND_ASSIGN(HandleCloserAgent); michael@0: }; michael@0: michael@0: } // namespace sandbox michael@0: michael@0: #endif // SANDBOX_SRC_HANDLE_CLOSER_AGENT_H_