Index: util/misc/uuid.h |
diff --git a/util/misc/uuid.h b/util/misc/uuid.h |
index 29b36bc09b8c8c26ded6dd6e63effa7d23b5fb87..220470bd3ce2e96d42cdd33352c51cda51d1e70d 100644 |
--- a/util/misc/uuid.h |
+++ b/util/misc/uuid.h |
@@ -29,6 +29,9 @@ |
namespace crashpad { |
+enum class InitializeWithNewTag { |
Mark Mentovai
2015/04/20 20:45:08
Move into struct UUID?
scottmg
2015/04/20 21:11:28
Done.
|
+}; |
+ |
//! \brief A universally unique identifier (%UUID). |
//! |
//! An alternate term for %UUID is “globally unique identifier” (GUID), used |
@@ -41,6 +44,12 @@ struct UUID { |
//! \brief Initializes the %UUID to zero. |
UUID(); |
+ //! \brief Initializes the %UUID using a standard system facility to generate |
+ //! the value. |
+ //! |
+ //! CHECKs on failure with a message logged. |
+ explicit UUID(InitializeWithNewTag); |
+ |
//! \copydoc InitializeFromBytes() |
explicit UUID(const uint8_t* bytes); |
@@ -67,6 +76,13 @@ struct UUID { |
//! parsed, with the object state untouched. |
bool InitializeFromString(const base::StringPiece& string); |
+ //! \brief Initializes the %UUID using a standard system facility to generate |
+ //! the value. |
+ //! |
+ //! \return `true` if the %UUID was initialized correctly, `false` otherwise |
+ //! with a message logged. |
+ bool InitializeWithNew(); |
+ |
#if defined(OS_WIN) || DOXYGEN |
//! \brief Initializes the %UUID from a system `UUID` or `GUID` structure. |
//! |