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

Unified Diff: sandbox/src/broker_services.cc

Issue 9838083: Add a sandbox API for broker handle duplication (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sandbox/src/broker_services.h ('k') | sandbox/src/handle_dispatcher.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sandbox/src/broker_services.cc
===================================================================
--- sandbox/src/broker_services.cc (revision 129865)
+++ sandbox/src/broker_services.cc (working copy)
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2009 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -184,6 +184,10 @@
case JOB_OBJECT_MSG_EXIT_PROCESS:
case JOB_OBJECT_MSG_ABNORMAL_EXIT_PROCESS: {
+ {
+ AutoLock lock(&broker->lock_);
+ broker->child_process_ids_.erase(reinterpret_cast<DWORD>(ovl));
+ }
--target_counter;
if (0 == target_counter)
::SetEvent(no_targets);
@@ -292,6 +296,7 @@
// Save the tracker because in cleanup we might need to force closing
// the Jobs.
tracker_list_.push_back(tracker);
+ child_process_ids_.insert(process_info.dwProcessId);
// We return the caller a duplicate of the process handle so they
// can close it at will.
@@ -312,4 +317,9 @@
return SBOX_ALL_OK;
}
+bool BrokerServicesBase::IsActiveTarget(DWORD process_id) {
+ AutoLock lock(&lock_);
+ return child_process_ids_.find(process_id) != child_process_ids_.end();
+}
+
} // namespace sandbox
« no previous file with comments | « sandbox/src/broker_services.h ('k') | sandbox/src/handle_dispatcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698