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

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

Issue 1231673005: Sandbox: Update the constructor of TargetProcess to receive ScopedHandles. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 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 | « no previous file | sandbox/win/src/target_process.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/broker_services.h" 5 #include "sandbox/win/src/broker_services.h"
6 6
7 #include <AclAPI.h> 7 #include <AclAPI.h>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after
489 } 489 }
490 490
491 // Construct the thread pool here in case it is expensive. 491 // Construct the thread pool here in case it is expensive.
492 // The thread pool is shared by all the targets 492 // The thread pool is shared by all the targets
493 if (NULL == thread_pool_) 493 if (NULL == thread_pool_)
494 thread_pool_ = new Win2kThreadPool(); 494 thread_pool_ = new Win2kThreadPool();
495 495
496 // Create the TargetProces object and spawn the target suspended. Note that 496 // Create the TargetProces object and spawn the target suspended. Note that
497 // Brokerservices does not own the target object. It is owned by the Policy. 497 // Brokerservices does not own the target object. It is owned by the Policy.
498 base::win::ScopedProcessInformation process_info; 498 base::win::ScopedProcessInformation process_info;
499 TargetProcess* target = new TargetProcess(initial_token.Take(), 499 TargetProcess* target = new TargetProcess(initial_token.Pass(),
500 lockdown_token.Take(), 500 lockdown_token.Pass(),
501 job.Get(), 501 job.Get(),
502 thread_pool_); 502 thread_pool_);
503 503
504 DWORD win_result = target->Create(exe_path, command_line, inherit_handles, 504 DWORD win_result = target->Create(exe_path, command_line, inherit_handles,
505 policy_base->GetLowBoxSid() ? true : false, 505 policy_base->GetLowBoxSid() ? true : false,
506 startup_info, &process_info); 506 startup_info, &process_info);
507 507
508 policy_base->ClearSharedHandles(); 508 policy_base->ClearSharedHandles();
509 509
510 if (ERROR_SUCCESS != win_result) { 510 if (ERROR_SUCCESS != win_result) {
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
619 return SBOX_ERROR_UNSUPPORTED; 619 return SBOX_ERROR_UNSUPPORTED;
620 620
621 base::string16 name = LookupAppContainer(sid); 621 base::string16 name = LookupAppContainer(sid);
622 if (name.empty()) 622 if (name.empty())
623 return SBOX_ERROR_INVALID_APP_CONTAINER; 623 return SBOX_ERROR_INVALID_APP_CONTAINER;
624 624
625 return DeleteAppContainer(sid); 625 return DeleteAppContainer(sid);
626 } 626 }
627 627
628 } // namespace sandbox 628 } // namespace sandbox
OLDNEW
« no previous file with comments | « no previous file | sandbox/win/src/target_process.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698