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

Side by Side Diff: chrome/installer/util/shell_util.cc

Issue 833513002: Revert of replace COMPILE_ASSERT with static_assert in chrome/installer/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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 unified diff | Download patch
« no previous file with comments | « chrome/installer/util/logging_installer.h ('k') | chrome/installer/util/util_constants.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 // 4 //
5 // This file defines functions that integrate Chrome in Windows shell. These 5 // This file defines functions that integrate Chrome in Windows shell. These
6 // functions can be used by Chrome as well as Chrome installer. All of the 6 // functions can be used by Chrome as well as Chrome installer. All of the
7 // work is done by the local functions defined in anonymous namespace in 7 // work is done by the local functions defined in anonymous namespace in
8 // this class. 8 // this class.
9 9
10 #include "chrome/installer/util/shell_util.h" 10 #include "chrome/installer/util/shell_util.h"
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 144
145 DISALLOW_COPY_AND_ASSIGN(UserSpecificRegistrySuffix); 145 DISALLOW_COPY_AND_ASSIGN(UserSpecificRegistrySuffix);
146 }; // class UserSpecificRegistrySuffix 146 }; // class UserSpecificRegistrySuffix
147 147
148 UserSpecificRegistrySuffix::UserSpecificRegistrySuffix() { 148 UserSpecificRegistrySuffix::UserSpecificRegistrySuffix() {
149 base::string16 user_sid; 149 base::string16 user_sid;
150 if (!base::win::GetUserSidString(&user_sid)) { 150 if (!base::win::GetUserSidString(&user_sid)) {
151 NOTREACHED(); 151 NOTREACHED();
152 return; 152 return;
153 } 153 }
154 static_assert(sizeof(base::MD5Digest) == 16, 154 COMPILE_ASSERT(sizeof(base::MD5Digest) == 16, size_of_MD5_not_as_expected_);
155 "size of MD5Digest should be 16");
156 base::MD5Digest md5_digest; 155 base::MD5Digest md5_digest;
157 std::string user_sid_ascii(base::UTF16ToASCII(user_sid)); 156 std::string user_sid_ascii(base::UTF16ToASCII(user_sid));
158 base::MD5Sum(user_sid_ascii.c_str(), user_sid_ascii.length(), &md5_digest); 157 base::MD5Sum(user_sid_ascii.c_str(), user_sid_ascii.length(), &md5_digest);
159 const base::string16 base32_md5( 158 const base::string16 base32_md5(
160 ShellUtil::ByteArrayToBase32(md5_digest.a, arraysize(md5_digest.a))); 159 ShellUtil::ByteArrayToBase32(md5_digest.a, arraysize(md5_digest.a)));
161 // The value returned by the base32 algorithm above must never change and 160 // The value returned by the base32 algorithm above must never change and
162 // must always be 26 characters long (i.e. if someone ever moves this to 161 // must always be 26 characters long (i.e. if someone ever moves this to
163 // base and implements the full base32 algorithm (i.e. with appended '=' 162 // base and implements the full base32 algorithm (i.e. with appended '='
164 // signs in the output), they must provide a flag to allow this method to 163 // signs in the output), they must provide a flag to allow this method to
165 // still request the output with no appended '=' signs). 164 // still request the output with no appended '=' signs).
(...skipping 2304 matching lines...) Expand 10 before | Expand all | Expand 10 after
2470 base::string16 key_path(ShellUtil::kRegClasses); 2469 base::string16 key_path(ShellUtil::kRegClasses);
2471 key_path.push_back(base::FilePath::kSeparators[0]); 2470 key_path.push_back(base::FilePath::kSeparators[0]);
2472 key_path.append(prog_id); 2471 key_path.append(prog_id);
2473 return InstallUtil::DeleteRegistryKey( 2472 return InstallUtil::DeleteRegistryKey(
2474 HKEY_CURRENT_USER, key_path, WorkItem::kWow64Default); 2473 HKEY_CURRENT_USER, key_path, WorkItem::kWow64Default);
2475 2474
2476 // TODO(mgiuca): Remove the extension association entries. This requires that 2475 // TODO(mgiuca): Remove the extension association entries. This requires that
2477 // the extensions associated with a particular prog_id are stored in that 2476 // the extensions associated with a particular prog_id are stored in that
2478 // prog_id's key. 2477 // prog_id's key.
2479 } 2478 }
OLDNEW
« no previous file with comments | « chrome/installer/util/logging_installer.h ('k') | chrome/installer/util/util_constants.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698