Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1675)

Unified Diff: sandbox/win/src/handle_closer.h

Issue 1851213002: Remove sandbox on Windows. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix nacl compile issues Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sandbox/win/src/filesystem_policy.cc ('k') | sandbox/win/src/handle_closer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sandbox/win/src/handle_closer.h
diff --git a/sandbox/win/src/handle_closer.h b/sandbox/win/src/handle_closer.h
deleted file mode 100644
index 9592230a06c1f2ee37b0dcc83f9409afd3e5dbad..0000000000000000000000000000000000000000
--- a/sandbox/win/src/handle_closer.h
+++ /dev/null
@@ -1,76 +0,0 @@
-// Copyright (c) 2012 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_H_
-#define SANDBOX_SRC_HANDLE_CLOSER_H_
-
-#include <stddef.h>
-
-#include <map>
-#include <set>
-
-#include "base/macros.h"
-#include "base/strings/string16.h"
-#include "sandbox/win/src/interception.h"
-#include "sandbox/win/src/sandbox_types.h"
-#include "sandbox/win/src/target_process.h"
-
-namespace sandbox {
-
-// This is a map of handle-types to names that we need to close in the
-// target process. A null set means we need to close all handles of the
-// given type.
-typedef std::map<const base::string16, std::set<base::string16> > HandleMap;
-
-// Type and set of corresponding handle names to close.
-struct HandleListEntry {
- size_t record_bytes; // Rounded to sizeof(size_t) bytes.
- size_t offset_to_names; // Nul terminated strings of name_count names.
- size_t name_count;
- base::char16 handle_type[1];
-};
-
-// Global parameters and a pointer to the list of entries.
-struct HandleCloserInfo {
- size_t record_bytes; // Rounded to sizeof(size_t) bytes.
- size_t num_handle_types;
- struct HandleListEntry handle_entries[1];
-};
-
-SANDBOX_INTERCEPT HandleCloserInfo* g_handle_closer_info;
-
-// Adds handles to close after lockdown.
-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.
- // An empty string for handle_name indicates the handle is unnamed.
- ResultCode AddHandle(const base::char16* handle_type,
- const base::char16* handle_name);
-
- // Serializes and copies the closer table into the target process.
- bool InitializeTargetHandles(TargetProcess* target);
-
- private:
- // Calculates the memory needed to copy the serialized handles list (rounded
- // to the nearest machine-word size).
- size_t GetBufferSize();
-
- // Serializes the handle list into the target process.
- bool SetupHandleList(void* buffer, size_t buffer_bytes);
-
- HandleMap handles_to_close_;
-
- DISALLOW_COPY_AND_ASSIGN(HandleCloser);
-};
-
-// Returns the object manager's name associated with a handle
-bool GetHandleName(HANDLE handle, base::string16* handle_name);
-
-} // namespace sandbox
-
-#endif // SANDBOX_SRC_HANDLE_CLOSER_H_
« no previous file with comments | « sandbox/win/src/filesystem_policy.cc ('k') | sandbox/win/src/handle_closer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698