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

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

Issue 10824033: Coverity: Fix several pass-by-values. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Win build fix. Created 8 years, 4 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
OLDNEW
1 // Copyright (c) 2006-2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2010 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_dispatcher.h" 5 #include "sandbox/win/src/process_thread_dispatcher.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "sandbox/win/src/crosscall_client.h" 9 #include "sandbox/win/src/crosscall_client.h"
10 #include "sandbox/win/src/interception.h" 10 #include "sandbox/win/src/interception.h"
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 // absolute. 57 // absolute.
58 bool IsPathRelative(const std::wstring &path) { 58 bool IsPathRelative(const std::wstring &path) {
59 // A path is Relative if it's not a UNC path beginnning with \\ or a 59 // A path is Relative if it's not a UNC path beginnning with \\ or a
60 // path beginning with a drive. (i.e. X:\) 60 // path beginning with a drive. (i.e. X:\)
61 if (path.find(L"\\\\") == 0 || path.find(L":\\") == 1) 61 if (path.find(L"\\\\") == 0 || path.find(L":\\") == 1)
62 return false; 62 return false;
63 return true; 63 return true;
64 } 64 }
65 65
66 // Converts a relative path to an absolute path. 66 // Converts a relative path to an absolute path.
67 bool ConvertToAbsolutePath(const std::wstring child_current_directory, 67 bool ConvertToAbsolutePath(const std::wstring& child_current_directory,
68 bool use_env_path, std::wstring *path) { 68 bool use_env_path, std::wstring *path) {
69 wchar_t file_buffer[MAX_PATH]; 69 wchar_t file_buffer[MAX_PATH];
70 wchar_t *file_part = NULL; 70 wchar_t *file_part = NULL;
71 71
72 // Here we should start by looking at the path where the child application was 72 // Here we should start by looking at the path where the child application was
73 // started. We don't have this information yet. 73 // started. We don't have this information yet.
74 DWORD result = 0; 74 DWORD result = 0;
75 if (use_env_path) { 75 if (use_env_path) {
76 // Try with the complete path 76 // Try with the complete path
77 result = ::SearchPath(NULL, path->c_str(), NULL, MAX_PATH, file_buffer, 77 result = ::SearchPath(NULL, path->c_str(), NULL, MAX_PATH, file_buffer,
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 // If our logic was wrong, at least we wont allow create a random process. 236 // If our logic was wrong, at least we wont allow create a random process.
237 DWORD ret = ProcessPolicy::CreateProcessWAction(eval, *ipc->client_info, 237 DWORD ret = ProcessPolicy::CreateProcessWAction(eval, *ipc->client_info,
238 exe_name, *cmd_line, 238 exe_name, *cmd_line,
239 proc_info); 239 proc_info);
240 240
241 ipc->return_info.win32_result = ret; 241 ipc->return_info.win32_result = ret;
242 return true; 242 return true;
243 } 243 }
244 244
245 } // namespace sandbox 245 } // namespace sandbox
OLDNEW
« no previous file with comments | « ppapi/native_client/src/trusted/plugin/service_runtime.cc ('k') | skia/ext/skia_sandbox_support_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698