summaryrefslogtreecommitdiffstats
path: root/content/common/sandbox_policy.cc
diff options
context:
space:
mode:
authorjschuh@chromium.org <jschuh@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-23 18:40:03 +0000
committerjschuh@chromium.org <jschuh@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-23 18:40:03 +0000
commitbc1c287d91e234b40856411be23dcb4c40dcc849 (patch)
tree6aa50704e781bed45630780d6017031a49fee693 /content/common/sandbox_policy.cc
parentecd65b6ef6c09bc23352aa1006e184304a94ffc7 (diff)
downloadchromium_src-bc1c287d91e234b40856411be23dcb4c40dcc849.zip
chromium_src-bc1c287d91e234b40856411be23dcb4c40dcc849.tar.gz
chromium_src-bc1c287d91e234b40856411be23dcb4c40dcc849.tar.bz2
Should be caching the user session ID
BUG=90259TEST=None Review URL: http://codereview.chromium.org/8015015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@102537 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/common/sandbox_policy.cc')
-rw-r--r--content/common/sandbox_policy.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/content/common/sandbox_policy.cc b/content/common/sandbox_policy.cc
index f42d7f6..510d04d 100644
--- a/content/common/sandbox_policy.cc
+++ b/content/common/sandbox_policy.cc
@@ -220,7 +220,7 @@ void AddPluginDllEvictionPolicy(sandbox::TargetPolicy* policy) {
// Returns the object path prepended with the current logon session.
string16 PrependWindowsSessionPath(const char16* object) {
// Cache this because it can't change after process creation.
- uintptr_t s_session_id = 0;
+ static uintptr_t s_session_id = 0;
if (s_session_id == 0) {
HANDLE token;
DWORD session_id_length;
@@ -230,7 +230,8 @@ string16 PrependWindowsSessionPath(const char16* object) {
CHECK(::GetTokenInformation(token, TokenSessionId, &session_id,
sizeof(session_id), &session_id_length));
CloseHandle(token);
- s_session_id = session_id;
+ if (session_id)
+ s_session_id = session_id;
}
return base::StringPrintf(L"\\Sessions\\%d%ls", s_session_id, object);