summaryrefslogtreecommitdiffstats
path: root/chrome/common/sandbox_policy.cc
diff options
context:
space:
mode:
authorevan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-30 23:56:18 +0000
committerevan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-30 23:56:18 +0000
commitb969648e443de8c767d7e2f6b34861b4a1ee3eec (patch)
treeb41dea85b620d7664038e2583614745bc4be6fae /chrome/common/sandbox_policy.cc
parentf0a94b593178cfe95dd16424cca6a0144de0d440 (diff)
downloadchromium_src-b969648e443de8c767d7e2f6b34861b4a1ee3eec.zip
chromium_src-b969648e443de8c767d7e2f6b34861b4a1ee3eec.tar.gz
chromium_src-b969648e443de8c767d7e2f6b34861b4a1ee3eec.tar.bz2
windows: remove PathService::Get() that uses wstrings
This just required fixing the remaining callers. BUG=24672 Review URL: http://codereview.chromium.org/5356008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@67783 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/sandbox_policy.cc')
-rw-r--r--chrome/common/sandbox_policy.cc22
1 files changed, 11 insertions, 11 deletions
diff --git a/chrome/common/sandbox_policy.cc b/chrome/common/sandbox_policy.cc
index 7adf2b9..2b932d0 100644
--- a/chrome/common/sandbox_policy.cc
+++ b/chrome/common/sandbox_policy.cc
@@ -116,29 +116,28 @@ PluginPolicyCategory GetPolicyCategoryForPlugin(
bool AddDirectory(int path, const wchar_t* sub_dir, bool children,
sandbox::TargetPolicy::Semantics access,
sandbox::TargetPolicy* policy) {
- std::wstring directory;
+ FilePath directory;
if (!PathService::Get(path, &directory))
return false;
if (sub_dir) {
- file_util::AppendToPath(&directory, sub_dir);
+ directory = directory.Append(sub_dir);
file_util::AbsolutePath(&directory);
}
sandbox::ResultCode result;
result = policy->AddRule(sandbox::TargetPolicy::SUBSYS_FILES, access,
- directory.c_str());
+ directory.value().c_str());
if (result != sandbox::SBOX_ALL_OK)
return false;
+ std::wstring directory_str = directory.value() + L"\\";
if (children)
- file_util::AppendToPath(&directory, L"*");
- else
- // Add the version of the path that ends with a separator.
- file_util::AppendToPath(&directory, L"");
+ directory_str += L"*";
+ // Otherwise, add the version of the path that ends with a separator.
result = policy->AddRule(sandbox::TargetPolicy::SUBSYS_FILES, access,
- directory.c_str());
+ directory_str.c_str());
if (result != sandbox::SBOX_ALL_OK)
return false;
@@ -198,10 +197,11 @@ bool AddGenericPolicy(sandbox::TargetPolicy* policy) {
// Add the policy for debug message only in debug
#ifndef NDEBUG
- std::wstring debug_message;
- if (!PathService::Get(chrome::DIR_APP, &debug_message))
+ FilePath app_dir;
+ if (!PathService::Get(chrome::DIR_APP, &app_dir))
return false;
- if (!win_util::ConvertToLongPath(debug_message, &debug_message))
+ std::wstring debug_message;
+ if (!win_util::ConvertToLongPath(app_dir.value(), &debug_message))
return false;
file_util::AppendToPath(&debug_message, L"debug_message.exe");
result = policy->AddRule(sandbox::TargetPolicy::SUBSYS_PROCESS,