OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "content/common/handle_enumerator_win.h" | 5 #include "content/common/handle_enumerator_win.h" |
6 | 6 |
7 #include <windows.h> | 7 #include <windows.h> |
8 #include <map> | 8 #include <map> |
9 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 return handle_types; | 45 return handle_types; |
46 } | 46 } |
47 | 47 |
48 } // namespace | 48 } // namespace |
49 | 49 |
50 const size_t kMaxHandleNameLength = 1024; | 50 const size_t kMaxHandleNameLength = 1024; |
51 | 51 |
52 void HandleEnumerator::EnumerateHandles() { | 52 void HandleEnumerator::EnumerateHandles() { |
53 sandbox::HandleTable handles; | 53 sandbox::HandleTable handles; |
54 std::string process_type = | 54 std::string process_type = |
55 CommandLine::ForCurrentProcess()->GetSwitchValueASCII( | 55 base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( |
56 switches::kProcessType); | 56 switches::kProcessType); |
57 base::string16 output = ASCIIToUTF16(process_type); | 57 base::string16 output = ASCIIToUTF16(process_type); |
58 output.append(ASCIIToUTF16(" process - Handles at shutdown:\n")); | 58 output.append(ASCIIToUTF16(" process - Handles at shutdown:\n")); |
59 for (sandbox::HandleTable::Iterator sys_handle | 59 for (sandbox::HandleTable::Iterator sys_handle |
60 = handles.HandlesForProcess(::GetCurrentProcessId()); | 60 = handles.HandlesForProcess(::GetCurrentProcessId()); |
61 sys_handle != handles.end(); ++sys_handle) { | 61 sys_handle != handles.end(); ++sys_handle) { |
62 HandleType current_type = StringToHandleType(sys_handle->Type()); | 62 HandleType current_type = StringToHandleType(sys_handle->Type()); |
63 if (!all_handles_ && (current_type != ProcessHandle && | 63 if (!all_handles_ && (current_type != ProcessHandle && |
64 current_type != FileHandle && | 64 current_type != FileHandle && |
65 current_type != DirectoryHandle && | 65 current_type != DirectoryHandle && |
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
313 if (access & FILE_MAP_READ) | 313 if (access & FILE_MAP_READ) |
314 output.append(ASCIIToUTF16("\tFILE_MAP_READ\n")); | 314 output.append(ASCIIToUTF16("\tFILE_MAP_READ\n")); |
315 if (access & FILE_MAP_WRITE) | 315 if (access & FILE_MAP_WRITE) |
316 output.append(ASCIIToUTF16("\tFILE_MAP_WRITE\n")); | 316 output.append(ASCIIToUTF16("\tFILE_MAP_WRITE\n")); |
317 break; | 317 break; |
318 } | 318 } |
319 return output; | 319 return output; |
320 } | 320 } |
321 | 321 |
322 } // namespace content | 322 } // namespace content |
OLD | NEW |