| OLD | NEW |
| 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 <limits.h> | 7 #include <limits.h> |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 if (dup_dummy != closed_handle) | 79 if (dup_dummy != closed_handle) |
| 80 to_close.push_back(dup_dummy); | 80 to_close.push_back(dup_dummy); |
| 81 } while (count-- && | 81 } while (count-- && |
| 82 reinterpret_cast<uintptr_t>(dup_dummy) < | 82 reinterpret_cast<uintptr_t>(dup_dummy) < |
| 83 reinterpret_cast<uintptr_t>(closed_handle)); | 83 reinterpret_cast<uintptr_t>(closed_handle)); |
| 84 | 84 |
| 85 for (HANDLE h : to_close) | 85 for (HANDLE h : to_close) |
| 86 ::CloseHandle(h); | 86 ::CloseHandle(h); |
| 87 | 87 |
| 88 // Useful to know when we're not able to stuff handles. | 88 // Useful to know when we're not able to stuff handles. |
| 89 DCHECK(dup_dummy == closed_handle); | 89 // TODO(wfh): Investigate DCHECK fails on Win7 Intel GPU.FYI crbug.com/649904 |
| 90 | 90 // DCHECK(dup_dummy == closed_handle); |
| 91 return dup_dummy == closed_handle; | 91 // return dup_dummy == closed_handle; |
| 92 return true; |
| 92 } | 93 } |
| 93 | 94 |
| 94 // Reads g_handles_to_close and creates the lookup map. | 95 // Reads g_handles_to_close and creates the lookup map. |
| 95 void HandleCloserAgent::InitializeHandlesToClose(bool* is_csrss_connected) { | 96 void HandleCloserAgent::InitializeHandlesToClose(bool* is_csrss_connected) { |
| 96 CHECK(g_handles_to_close != NULL); | 97 CHECK(g_handles_to_close != NULL); |
| 97 | 98 |
| 98 // Default to connected state | 99 // Default to connected state |
| 99 *is_csrss_connected = true; | 100 *is_csrss_connected = true; |
| 100 | 101 |
| 101 // Grab the header. | 102 // Grab the header. |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 return false; | 195 return false; |
| 195 // Attempt to stuff this handle with a new dummy Event. | 196 // Attempt to stuff this handle with a new dummy Event. |
| 196 AttemptToStuffHandleSlot(handle, result->first); | 197 AttemptToStuffHandleSlot(handle, result->first); |
| 197 } | 198 } |
| 198 } | 199 } |
| 199 | 200 |
| 200 return true; | 201 return true; |
| 201 } | 202 } |
| 202 | 203 |
| 203 } // namespace sandbox | 204 } // namespace sandbox |
| OLD | NEW |