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

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

Issue 1115293002: win: Fix remaining plugin warnings in ash, device, printing, sandbox. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 5 years, 7 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/handle_closer_agent.h ('k') | sandbox/win/src/interception.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 27 matching lines...) Expand all
38 SANDBOX_INTERCEPT HandleCloserInfo* g_handles_to_close = NULL; 38 SANDBOX_INTERCEPT HandleCloserInfo* g_handles_to_close = NULL;
39 39
40 bool HandleCloserAgent::NeedsHandlesClosed() { 40 bool HandleCloserAgent::NeedsHandlesClosed() {
41 return g_handles_to_close != NULL; 41 return g_handles_to_close != NULL;
42 } 42 }
43 43
44 HandleCloserAgent::HandleCloserAgent() 44 HandleCloserAgent::HandleCloserAgent()
45 : dummy_handle_(::CreateEvent(NULL, FALSE, FALSE, NULL)) { 45 : dummy_handle_(::CreateEvent(NULL, FALSE, FALSE, NULL)) {
46 } 46 }
47 47
48 HandleCloserAgent::~HandleCloserAgent() {
49 }
50
48 // Attempts to stuff |closed_handle| with a duplicated handle for a dummy Event 51 // Attempts to stuff |closed_handle| with a duplicated handle for a dummy Event
49 // with no access. This should allow the handle to be closed, to avoid 52 // with no access. This should allow the handle to be closed, to avoid
50 // generating EXCEPTION_INVALID_HANDLE on shutdown, but nothing else. For now 53 // generating EXCEPTION_INVALID_HANDLE on shutdown, but nothing else. For now
51 // the only supported |type| is Event or File. 54 // the only supported |type| is Event or File.
52 bool HandleCloserAgent::AttemptToStuffHandleSlot(HANDLE closed_handle, 55 bool HandleCloserAgent::AttemptToStuffHandleSlot(HANDLE closed_handle,
53 const base::string16& type) { 56 const base::string16& type) {
54 // Only attempt to stuff Files and Events at the moment. 57 // Only attempt to stuff Files and Events at the moment.
55 if (type != L"Event" && type != L"File") { 58 if (type != L"Event" && type != L"File") {
56 return true; 59 return true;
57 } 60 }
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 return false; 185 return false;
183 // Attempt to stuff this handle with a new dummy Event. 186 // Attempt to stuff this handle with a new dummy Event.
184 AttemptToStuffHandleSlot(handle, result->first); 187 AttemptToStuffHandleSlot(handle, result->first);
185 } 188 }
186 } 189 }
187 190
188 return true; 191 return true;
189 } 192 }
190 193
191 } // namespace sandbox 194 } // namespace sandbox
OLDNEW
« no previous file with comments | « sandbox/win/src/handle_closer_agent.h ('k') | sandbox/win/src/interception.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698