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

Unified Diff: util/misc/uuid.cc

Issue 1004913004: win: Add UUID::InitializeFromSystemUUID() (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: Rebase Created 5 years, 9 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 | « util/misc/uuid.h ('k') | util/misc/uuid_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: util/misc/uuid.cc
diff --git a/util/misc/uuid.cc b/util/misc/uuid.cc
index 967ee224dced93c911ad5e3787beb5b5e073337b..904efcd339838d7b8a9d0e2f456ccfc49d5ffe6e 100644
--- a/util/misc/uuid.cc
+++ b/util/misc/uuid.cc
@@ -88,6 +88,16 @@ bool UUID::InitializeFromString(const base::StringPiece& string) {
return true;
}
+#if defined(OS_WIN)
+void UUID::InitializeFromSystemUUID(const ::UUID* system_uuid) {
+ static_assert(sizeof(::UUID) == sizeof(UUID),
+ "unexpected system uuid size");
+ static_assert(offsetof(::UUID, Data1) == offsetof(UUID, data_1),
+ "unexpected system uuid layout");
+ memcpy(this, system_uuid, sizeof(::UUID));
+}
+#endif // OS_WIN
+
std::string UUID::ToString() const {
return base::StringPrintf("%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x",
data_1,
« no previous file with comments | « util/misc/uuid.h ('k') | util/misc/uuid_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698