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

Side by Side Diff: sandbox/win/src/handle_closer_agent.cc

Issue 93903011: Remove 'using base::string16;' from base/strings/string16.h and remove temporary (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: asdf Created 6 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « content/common/view_messages.h ('k') | ui/base/cocoa/menu_controller.h » ('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 #include "sandbox/win/src/handle_closer_agent.h" 5 #include "sandbox/win/src/handle_closer_agent.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "sandbox/win/src/nt_internals.h" 8 #include "sandbox/win/src/nt_internals.h"
9 #include "sandbox/win/src/win_utils.h" 9 #include "sandbox/win/src/win_utils.h"
10 10
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 const size_t kHandleOffset = sizeof(HANDLE); 81 const size_t kHandleOffset = sizeof(HANDLE);
82 82
83 if (!::GetProcessHandleCount(::GetCurrentProcess(), &handle_count)) 83 if (!::GetProcessHandleCount(::GetCurrentProcess(), &handle_count))
84 return false; 84 return false;
85 85
86 // Set up buffers for the type info and the name. 86 // Set up buffers for the type info and the name.
87 std::vector<BYTE> type_info_buffer(sizeof(OBJECT_TYPE_INFORMATION) + 87 std::vector<BYTE> type_info_buffer(sizeof(OBJECT_TYPE_INFORMATION) +
88 32 * sizeof(wchar_t)); 88 32 * sizeof(wchar_t));
89 OBJECT_TYPE_INFORMATION* type_info = 89 OBJECT_TYPE_INFORMATION* type_info =
90 reinterpret_cast<OBJECT_TYPE_INFORMATION*>(&(type_info_buffer[0])); 90 reinterpret_cast<OBJECT_TYPE_INFORMATION*>(&(type_info_buffer[0]));
91 string16 handle_name; 91 base::string16 handle_name;
92 HANDLE handle = NULL; 92 HANDLE handle = NULL;
93 int invalid_count = 0; 93 int invalid_count = 0;
94 94
95 // Keep incrementing until we hit the number of handles reported by 95 // Keep incrementing until we hit the number of handles reported by
96 // GetProcessHandleCount(). If we hit a very long sequence of invalid 96 // GetProcessHandleCount(). If we hit a very long sequence of invalid
97 // handles we assume that we've run past the end of the table. 97 // handles we assume that we've run past the end of the table.
98 while (handle_count && invalid_count < kInvalidHandleThreshold) { 98 while (handle_count && invalid_count < kInvalidHandleThreshold) {
99 reinterpret_cast<size_t&>(handle) += kHandleOffset; 99 reinterpret_cast<size_t&>(handle) += kHandleOffset;
100 NTSTATUS rc; 100 NTSTATUS rc;
101 101
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 return false; 136 return false;
137 if (!::CloseHandle(handle)) 137 if (!::CloseHandle(handle))
138 return false; 138 return false;
139 } 139 }
140 } 140 }
141 141
142 return true; 142 return true;
143 } 143 }
144 144
145 } // namespace sandbox 145 } // namespace sandbox
OLDNEW
« no previous file with comments | « content/common/view_messages.h ('k') | ui/base/cocoa/menu_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698