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

Unified Diff: chrome/installer/setup/setup_util.cc

Issue 10912096: C++ reability review for gab. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix compile errors Created 8 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/installer/setup/setup_main.cc ('k') | chrome/installer/setup/uninstall.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/installer/setup/setup_util.cc
diff --git a/chrome/installer/setup/setup_util.cc b/chrome/installer/setup/setup_util.cc
index a190862da4f39e1fbbd7e8aafdd2ef01eacf13bc..23acf056ff21dac15d632d200fcda52b96bb1044 100644
--- a/chrome/installer/setup/setup_util.cc
+++ b/chrome/installer/setup/setup_util.cc
@@ -88,8 +88,8 @@ bool DeleteFileFromTempProcess(const FilePath& path,
static const wchar_t kRunDll32Path[] =
L"%SystemRoot%\\System32\\rundll32.exe";
wchar_t rundll32[MAX_PATH];
- DWORD size = ExpandEnvironmentStrings(kRunDll32Path, rundll32,
- arraysize(rundll32));
+ DWORD size =
+ ExpandEnvironmentStrings(kRunDll32Path, rundll32, arraysize(rundll32));
if (!size || size >= MAX_PATH)
return false;
@@ -110,7 +110,8 @@ bool DeleteFileFromTempProcess(const FilePath& path,
PAGE_READWRITE);
if (mem) {
SIZE_T written = 0;
- ::WriteProcessMemory(pi.hProcess, mem, path.value().c_str(),
+ ::WriteProcessMemory(
+ pi.hProcess, mem, path.value().c_str(),
(path.value().size() + 1) * sizeof(path.value()[0]), &written);
HMODULE kernel32 = ::GetModuleHandle(L"kernel32.dll");
PAPCFUNC sleep = reinterpret_cast<PAPCFUNC>(
@@ -149,7 +150,8 @@ string16 GetActiveSetupPath(BrowserDistribution* dist) {
ScopedTokenPrivilege::ScopedTokenPrivilege(const wchar_t* privilege_name)
: is_enabled_(false) {
if (!::OpenProcessToken(::GetCurrentProcess(),
- TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, token_.Receive())) {
+ TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY,
+ token_.Receive())) {
return;
}
@@ -170,9 +172,10 @@ ScopedTokenPrivilege::ScopedTokenPrivilege(const wchar_t* privilege_name)
if (!::AdjustTokenPrivileges(token_, FALSE, &tp, sizeof(TOKEN_PRIVILEGES),
&previous_privileges_, &return_length)) {
token_.Close();
- } else {
- is_enabled_ = true;
+ return;
}
+
+ is_enabled_ = true;
}
ScopedTokenPrivilege::~ScopedTokenPrivilege() {
« no previous file with comments | « chrome/installer/setup/setup_main.cc ('k') | chrome/installer/setup/uninstall.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698