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

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

Issue 1468803002: Switch to static_assert. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@assert1
Patch Set: message cleanup Created 5 years 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 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 121
122 DISALLOW_COPY_AND_ASSIGN(UserSpecificRegistrySuffix); 122 DISALLOW_COPY_AND_ASSIGN(UserSpecificRegistrySuffix);
123 }; // class UserSpecificRegistrySuffix 123 }; // class UserSpecificRegistrySuffix
124 124
125 UserSpecificRegistrySuffix::UserSpecificRegistrySuffix() { 125 UserSpecificRegistrySuffix::UserSpecificRegistrySuffix() {
126 base::string16 user_sid; 126 base::string16 user_sid;
127 if (!base::win::GetUserSidString(&user_sid)) { 127 if (!base::win::GetUserSidString(&user_sid)) {
128 NOTREACHED(); 128 NOTREACHED();
129 return; 129 return;
130 } 130 }
131 COMPILE_ASSERT(sizeof(base::MD5Digest) == 16, size_of_MD5_not_as_expected_); 131 static_assert(sizeof(base::MD5Digest) == 16, "size of MD5 not as expected");
132 base::MD5Digest md5_digest; 132 base::MD5Digest md5_digest;
133 std::string user_sid_ascii(base::UTF16ToASCII(user_sid)); 133 std::string user_sid_ascii(base::UTF16ToASCII(user_sid));
134 base::MD5Sum(user_sid_ascii.c_str(), user_sid_ascii.length(), &md5_digest); 134 base::MD5Sum(user_sid_ascii.c_str(), user_sid_ascii.length(), &md5_digest);
135 const base::string16 base32_md5( 135 const base::string16 base32_md5(
136 ShellUtil::ByteArrayToBase32(md5_digest.a, arraysize(md5_digest.a))); 136 ShellUtil::ByteArrayToBase32(md5_digest.a, arraysize(md5_digest.a)));
137 // The value returned by the base32 algorithm above must never change and 137 // The value returned by the base32 algorithm above must never change and
138 // must always be 26 characters long (i.e. if someone ever moves this to 138 // must always be 26 characters long (i.e. if someone ever moves this to
139 // base and implements the full base32 algorithm (i.e. with appended '=' 139 // base and implements the full base32 algorithm (i.e. with appended '='
140 // signs in the output), they must provide a flag to allow this method to 140 // signs in the output), they must provide a flag to allow this method to
141 // still request the output with no appended '=' signs). 141 // still request the output with no appended '=' signs).
(...skipping 2404 matching lines...) Expand 10 before | Expand all | Expand 10 after
2546 base::string16 key_path(kRegClasses); 2546 base::string16 key_path(kRegClasses);
2547 key_path.push_back(base::FilePath::kSeparators[0]); 2547 key_path.push_back(base::FilePath::kSeparators[0]);
2548 key_path.append(prog_id); 2548 key_path.append(prog_id);
2549 return InstallUtil::DeleteRegistryKey( 2549 return InstallUtil::DeleteRegistryKey(
2550 HKEY_CURRENT_USER, key_path, WorkItem::kWow64Default); 2550 HKEY_CURRENT_USER, key_path, WorkItem::kWow64Default);
2551 2551
2552 // TODO(mgiuca): Remove the extension association entries. This requires that 2552 // TODO(mgiuca): Remove the extension association entries. This requires that
2553 // the extensions associated with a particular prog_id are stored in that 2553 // the extensions associated with a particular prog_id are stored in that
2554 // prog_id's key. 2554 // prog_id's key.
2555 } 2555 }
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