Index: chrome/installer/setup/setup_util.cc |
diff --git a/chrome/installer/setup/setup_util.cc b/chrome/installer/setup/setup_util.cc |
index 9d3bf54e258e62b3d48751252eb3fb720aff2322..e8eeb71bd477aee54af1550794be78b6e16a6708 100644 |
--- a/chrome/installer/setup/setup_util.cc |
+++ b/chrome/installer/setup/setup_util.cc |
@@ -848,45 +848,4 @@ base::Time GetConsoleSessionStartTime() { |
return base::Time::FromFileTime(filetime); |
} |
-ScopedTokenPrivilege::ScopedTokenPrivilege(const wchar_t* privilege_name) |
- : is_enabled_(false) { |
- HANDLE temp_handle; |
- if (!::OpenProcessToken(::GetCurrentProcess(), |
- TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, |
- &temp_handle)) { |
- return; |
- } |
- token_.Set(temp_handle); |
- |
- LUID privilege_luid; |
- if (!::LookupPrivilegeValue(NULL, privilege_name, &privilege_luid)) { |
- token_.Close(); |
- return; |
- } |
- |
- // Adjust the token's privileges to enable |privilege_name|. If this privilege |
- // was already enabled, |previous_privileges_|.PrivilegeCount will be set to 0 |
- // and we then know not to disable this privilege upon destruction. |
- TOKEN_PRIVILEGES tp; |
- tp.PrivilegeCount = 1; |
- tp.Privileges[0].Luid = privilege_luid; |
- tp.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED; |
- DWORD return_length; |
- if (!::AdjustTokenPrivileges(token_.Get(), FALSE, &tp, |
- sizeof(TOKEN_PRIVILEGES), |
- &previous_privileges_, &return_length)) { |
- token_.Close(); |
- return; |
- } |
- |
- is_enabled_ = true; |
-} |
- |
-ScopedTokenPrivilege::~ScopedTokenPrivilege() { |
- if (is_enabled_ && previous_privileges_.PrivilegeCount != 0) { |
- ::AdjustTokenPrivileges(token_.Get(), FALSE, &previous_privileges_, |
- sizeof(TOKEN_PRIVILEGES), NULL, NULL); |
- } |
-} |
- |
} // namespace installer |