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

Side by Side Diff: sandbox/win/src/handle_closer.h

Issue 1106203002: sandbox/win: Fix warnings found by clang chromium-style plugin on Windows. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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 unified diff | Download patch
« no previous file with comments | « sandbox/win/src/crosscall_server.cc ('k') | sandbox/win/src/handle_closer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef SANDBOX_SRC_HANDLE_CLOSER_H_ 5 #ifndef SANDBOX_SRC_HANDLE_CLOSER_H_
6 #define SANDBOX_SRC_HANDLE_CLOSER_H_ 6 #define SANDBOX_SRC_HANDLE_CLOSER_H_
7 7
8 #include <map> 8 #include <map>
9 #include <set> 9 #include <set>
10 10
(...skipping 24 matching lines...) Expand all
35 size_t num_handle_types; 35 size_t num_handle_types;
36 struct HandleListEntry handle_entries[1]; 36 struct HandleListEntry handle_entries[1];
37 }; 37 };
38 38
39 SANDBOX_INTERCEPT HandleCloserInfo* g_handle_closer_info; 39 SANDBOX_INTERCEPT HandleCloserInfo* g_handle_closer_info;
40 40
41 // Adds handles to close after lockdown. 41 // Adds handles to close after lockdown.
42 class HandleCloser { 42 class HandleCloser {
43 public: 43 public:
44 HandleCloser(); 44 HandleCloser();
45 ~HandleCloser();
45 46
46 // Adds a handle that will be closed in the target process after lockdown. 47 // Adds a handle that will be closed in the target process after lockdown.
47 // A NULL value for handle_name indicates all handles of the specified type. 48 // A NULL value for handle_name indicates all handles of the specified type.
48 // An empty string for handle_name indicates the handle is unnamed. 49 // An empty string for handle_name indicates the handle is unnamed.
49 ResultCode AddHandle(const base::char16* handle_type, 50 ResultCode AddHandle(const base::char16* handle_type,
50 const base::char16* handle_name); 51 const base::char16* handle_name);
51 52
52 // Serializes and copies the closer table into the target process. 53 // Serializes and copies the closer table into the target process.
53 bool InitializeTargetHandles(TargetProcess* target); 54 bool InitializeTargetHandles(TargetProcess* target);
54 55
55 private: 56 private:
56 // Calculates the memory needed to copy the serialized handles list (rounded 57 // Calculates the memory needed to copy the serialized handles list (rounded
57 // to the nearest machine-word size). 58 // to the nearest machine-word size).
58 size_t GetBufferSize(); 59 size_t GetBufferSize();
59 60
60 // Serializes the handle list into the target process. 61 // Serializes the handle list into the target process.
61 bool SetupHandleList(void* buffer, size_t buffer_bytes); 62 bool SetupHandleList(void* buffer, size_t buffer_bytes);
62 63
63 HandleMap handles_to_close_; 64 HandleMap handles_to_close_;
64 65
65 DISALLOW_COPY_AND_ASSIGN(HandleCloser); 66 DISALLOW_COPY_AND_ASSIGN(HandleCloser);
66 }; 67 };
67 68
68 // Returns the object manager's name associated with a handle 69 // Returns the object manager's name associated with a handle
69 bool GetHandleName(HANDLE handle, base::string16* handle_name); 70 bool GetHandleName(HANDLE handle, base::string16* handle_name);
70 71
71 } // namespace sandbox 72 } // namespace sandbox
72 73
73 #endif // SANDBOX_SRC_HANDLE_CLOSER_H_ 74 #endif // SANDBOX_SRC_HANDLE_CLOSER_H_
OLDNEW
« no previous file with comments | « sandbox/win/src/crosscall_server.cc ('k') | sandbox/win/src/handle_closer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698