summaryrefslogtreecommitdiffstats
path: root/sandbox/src/handle_closer_agent.h
diff options
context:
space:
mode:
authorjschuh@chromium.org <jschuh@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-07-20 23:03:41 +0000
committerjschuh@chromium.org <jschuh@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-07-20 23:03:41 +0000
commite4876b29d769e62971fc67fe0ab0efab7512e3d1 (patch)
tree786b019c83b25a1eb481d6d2f46bce0d4cb8e283 /sandbox/src/handle_closer_agent.h
parentd1f594543972abf64a46bf32c23a924301ccb11e (diff)
downloadchromium_src-e4876b29d769e62971fc67fe0ab0efab7512e3d1.zip
chromium_src-e4876b29d769e62971fc67fe0ab0efab7512e3d1.tar.gz
chromium_src-e4876b29d769e62971fc67fe0ab0efab7512e3d1.tar.bz2
Add a sandbox API to allow closing open handles at lockdown.
BUG=58069 BUG=74242 TEST=sbox_integration_tests --gtest_filter=HandleCloserTests.* Review URL: http://codereview.chromium.org/7253054 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@93274 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sandbox/src/handle_closer_agent.h')
-rw-r--r--sandbox/src/handle_closer_agent.h37
1 files changed, 37 insertions, 0 deletions
diff --git a/sandbox/src/handle_closer_agent.h b/sandbox/src/handle_closer_agent.h
new file mode 100644
index 0000000..c74987c
--- /dev/null
+++ b/sandbox/src/handle_closer_agent.h
@@ -0,0 +1,37 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef SANDBOX_SRC_HANDLE_CLOSER_AGENT_H_
+#define SANDBOX_SRC_HANDLE_CLOSER_AGENT_H_
+
+#include "base/basictypes.h"
+#include "base/string16.h"
+#include "sandbox/src/handle_closer.h"
+#include "sandbox/src/sandbox_types.h"
+
+namespace sandbox {
+
+// Target process code to close the handle list copied over from the broker.
+class HandleCloserAgent {
+ public:
+ HandleCloserAgent() {}
+
+ // Reads the serialized list from the broker and creates the lookup map.
+ void InitializeHandlesToClose();
+
+ // Closes any handles matching those in the lookup map.
+ bool CloseHandles();
+
+ // True if we have handles waiting to be closed
+ static bool NeedsHandlesClosed();
+
+ private:
+ HandleMap handles_to_close_;
+
+ DISALLOW_COPY_AND_ASSIGN(HandleCloserAgent);
+};
+
+} // namespace sandbox
+
+#endif // SANDBOX_SRC_HANDLE_CLOSER_AGENT_H_