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

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

Issue 1513043002: clang/win: Let remaining chromium_code targets build with -Wextra. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 5 years 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
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 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 CHECK(name.second); 113 CHECK(name.second);
114 input += name.first->size() + 1; 114 input += name.first->size() + 1;
115 } 115 }
116 116
117 // Move on to the next entry. 117 // Move on to the next entry.
118 entry = reinterpret_cast<HandleListEntry*>(reinterpret_cast<char*>(entry) 118 entry = reinterpret_cast<HandleListEntry*>(reinterpret_cast<char*>(entry)
119 + entry->record_bytes); 119 + entry->record_bytes);
120 120
121 DCHECK(reinterpret_cast<base::char16*>(entry) >= input); 121 DCHECK(reinterpret_cast<base::char16*>(entry) >= input);
122 DCHECK(reinterpret_cast<base::char16*>(entry) - input < 122 DCHECK(reinterpret_cast<base::char16*>(entry) - input <
123 sizeof(size_t) / sizeof(base::char16)); 123 static_cast<ptrdiff_t>(sizeof(size_t) / sizeof(base::char16)));
124 } 124 }
125 125
126 // Clean up the memory we copied over. 126 // Clean up the memory we copied over.
127 ::VirtualFree(g_handles_to_close, 0, MEM_RELEASE); 127 ::VirtualFree(g_handles_to_close, 0, MEM_RELEASE);
128 g_handles_to_close = NULL; 128 g_handles_to_close = NULL;
129 } 129 }
130 130
131 bool HandleCloserAgent::CloseHandles() { 131 bool HandleCloserAgent::CloseHandles() {
132 DWORD handle_count = UINT_MAX; 132 DWORD handle_count = UINT_MAX;
133 const int kInvalidHandleThreshold = 100; 133 const int kInvalidHandleThreshold = 100;
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 return false; 191 return false;
192 // Attempt to stuff this handle with a new dummy Event. 192 // Attempt to stuff this handle with a new dummy Event.
193 AttemptToStuffHandleSlot(handle, result->first); 193 AttemptToStuffHandleSlot(handle, result->first);
194 } 194 }
195 } 195 }
196 196
197 return true; 197 return true;
198 } 198 }
199 199
200 } // namespace sandbox 200 } // namespace sandbox
OLDNEW
« no previous file with comments | « rlz/win/lib/rlz_value_store_registry.cc ('k') | ui/base/dragdrop/os_exchange_data_win_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698