diff options
author | brettw@google.com <brettw@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-12-31 20:39:02 +0000 |
---|---|---|
committer | brettw@google.com <brettw@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-12-31 20:39:02 +0000 |
commit | fd85ad650d68309b965dbc9f3d6823cf2754349c (patch) | |
tree | 28b98629e02b2e05ec74272146f249ca62a164da /chrome/common/sandbox_policy.cc | |
parent | ce072a7181ea5d58133e33654133236f5d9f5551 (diff) | |
download | chromium_src-fd85ad650d68309b965dbc9f3d6823cf2754349c.zip chromium_src-fd85ad650d68309b965dbc9f3d6823cf2754349c.tar.gz chromium_src-fd85ad650d68309b965dbc9f3d6823cf2754349c.tar.bz2 |
Move app/win_util to app/win and fix the namespace usage.
Split out the two classes: ScopedComInitializer and ScopedCOMem (which I renamed) to separate files.
I removed the win_util_path file which had one function in it and moved the function to win_util.
Somehow, this was getting picked up by the nacl64 build and the call in sandbox_policy was then not being
defined. I just implemented the function in-plcae since it's just a simple wrapper around a Windows API call.
TEST=it compiles
BUG=none
Review URL: http://codereview.chromium.org/6013009
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@70343 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/sandbox_policy.cc')
-rw-r--r-- | chrome/common/sandbox_policy.cc | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/chrome/common/sandbox_policy.cc b/chrome/common/sandbox_policy.cc index 2667cf9..be6cc3b 100644 --- a/chrome/common/sandbox_policy.cc +++ b/chrome/common/sandbox_policy.cc @@ -6,7 +6,7 @@ #include <string> -#include "app/win_util.h" +#include "app/win/win_util.h" #include "base/command_line.h" #include "base/debug/debugger.h" #include "base/debug/trace_event.h" @@ -200,9 +200,15 @@ bool AddGenericPolicy(sandbox::TargetPolicy* policy) { FilePath app_dir; if (!PathService::Get(chrome::DIR_APP, &app_dir)) return false; - std::wstring debug_message; - if (!win_util::ConvertToLongPath(app_dir.value(), &debug_message)) + + wchar_t long_path_buf[MAX_PATH]; + DWORD long_path_return_value = GetLongPathName(app_dir.value().c_str(), + long_path_buf, + MAX_PATH); + if (long_path_return_value == 0 || long_path_return_value >= MAX_PATH) return false; + + string16 debug_message(long_path_buf); file_util::AppendToPath(&debug_message, L"debug_message.exe"); result = policy->AddRule(sandbox::TargetPolicy::SUBSYS_PROCESS, sandbox::TargetPolicy::PROCESS_MIN_EXEC, |