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

Unified Diff: util/misc/uuid.h

Issue 999953002: Use LockFile/UnlockFile for Settings to port to Windows (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@lock-fileio-2
Patch Set: Tag inside, no info spam Created 5 years, 8 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/file/file_io_win.cc ('k') | util/misc/uuid.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: util/misc/uuid.h
diff --git a/util/misc/uuid.h b/util/misc/uuid.h
index 29b36bc09b8c8c26ded6dd6e63effa7d23b5fb87..f25aa652f64a79adec50bca17e8e2ec6580a337d 100644
--- a/util/misc/uuid.h
+++ b/util/misc/uuid.h
@@ -41,6 +41,16 @@ struct UUID {
//! \brief Initializes the %UUID to zero.
UUID();
+ //! \brief Tag to pass to constructor to indicate it should initialize with
+ //! generated data.
+ struct InitializeWithNewTag {};
+
+ //! \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 +77,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.
//!
« no previous file with comments | « util/file/file_io_win.cc ('k') | util/misc/uuid.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698