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

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

Issue 1271893003: Add options to write version number to registry. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix format to %ls Created 5 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
Index: chrome/installer/setup/setup_util.cc
diff --git a/chrome/installer/setup/setup_util.cc b/chrome/installer/setup/setup_util.cc
index af474401c9709d9dbd29faca40c870ee59937a4a..6ac6a3c73f881ea4380a5bc6329db460057339ef 100644
--- a/chrome/installer/setup/setup_util.cc
+++ b/chrome/installer/setup/setup_util.cc
@@ -629,6 +629,27 @@ void DeleteRegistryKeyPartial(
}
}
+base::string16 GuidToSquid(const base::string16& guid) {
+ base::string16 squid;
+ squid.reserve(32);
+ auto input = guid.begin();
+ auto output = std::back_inserter(squid);
+
+ // Reverse-copy relevant characters, skipping separators.
+ std::reverse_copy(input + 0, input + 8, output);
+ std::reverse_copy(input + 9, input + 13, output);
+ std::reverse_copy(input + 14, input + 18, output);
+ std::reverse_copy(input + 19, input + 21, output);
+ std::reverse_copy(input + 21, input + 23, output);
+ std::reverse_copy(input + 24, input + 26, output);
+ std::reverse_copy(input + 26, input + 28, output);
+ std::reverse_copy(input + 28, input + 30, output);
+ std::reverse_copy(input + 30, input + 32, output);
+ std::reverse_copy(input + 32, input + 34, output);
+ std::reverse_copy(input + 34, input + 36, output);
+ return squid;
+}
+
ScopedTokenPrivilege::ScopedTokenPrivilege(const wchar_t* privilege_name)
: is_enabled_(false) {
HANDLE temp_handle;

Powered by Google App Engine
This is Rietveld 408576698