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

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

Issue 169193002: Convert scoped_ptr_malloc -> scoped_ptr, part 2. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « sandbox/win/src/acl.cc ('k') | 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/process_thread_policy.h" 5 #include "sandbox/win/src/process_thread_policy.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "sandbox/win/src/ipc_tags.h" 10 #include "sandbox/win/src/ipc_tags.h"
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 const base::string16 &app_name, 220 const base::string16 &app_name,
221 const base::string16 &command_line, 221 const base::string16 &command_line,
222 PROCESS_INFORMATION* process_info) { 222 PROCESS_INFORMATION* process_info) {
223 // The only action supported is ASK_BROKER which means create the process. 223 // The only action supported is ASK_BROKER which means create the process.
224 if (GIVE_ALLACCESS != eval_result && GIVE_READONLY != eval_result) { 224 if (GIVE_ALLACCESS != eval_result && GIVE_READONLY != eval_result) {
225 return ERROR_ACCESS_DENIED; 225 return ERROR_ACCESS_DENIED;
226 } 226 }
227 227
228 STARTUPINFO startup_info = {0}; 228 STARTUPINFO startup_info = {0};
229 startup_info.cb = sizeof(startup_info); 229 startup_info.cb = sizeof(startup_info);
230 scoped_ptr_malloc<wchar_t> cmd_line(_wcsdup(command_line.c_str())); 230 scoped_ptr<wchar_t, base::FreeDeleter>
231 cmd_line(_wcsdup(command_line.c_str()));
231 232
232 BOOL should_give_full_access = (GIVE_ALLACCESS == eval_result); 233 BOOL should_give_full_access = (GIVE_ALLACCESS == eval_result);
233 if (!CreateProcessExWHelper(client_info.process, should_give_full_access, 234 if (!CreateProcessExWHelper(client_info.process, should_give_full_access,
234 app_name.c_str(), cmd_line.get(), NULL, NULL, 235 app_name.c_str(), cmd_line.get(), NULL, NULL,
235 FALSE, 0, NULL, NULL, &startup_info, 236 FALSE, 0, NULL, NULL, &startup_info,
236 process_info)) { 237 process_info)) {
237 return ERROR_ACCESS_DENIED; 238 return ERROR_ACCESS_DENIED;
238 } 239 }
239 return ERROR_SUCCESS; 240 return ERROR_SUCCESS;
240 } 241 }
241 242
242 } // namespace sandbox 243 } // namespace sandbox
OLDNEW
« no previous file with comments | « sandbox/win/src/acl.cc ('k') | sandbox/win/src/target_process.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698