Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2014 The Crashpad Authors. All rights reserved. | |
| 2 // | |
| 3 // Licensed under the Apache License, Version 2.0 (the "License"); | |
| 4 // you may not use this file except in compliance with the License. | |
| 5 // You may obtain a copy of the License at | |
| 6 // | |
| 7 // http://www.apache.org/licenses/LICENSE-2.0 | |
| 8 // | |
| 9 // Unless required by applicable law or agreed to in writing, software | |
| 10 // distributed under the License is distributed on an "AS IS" BASIS, | |
| 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
| 12 // See the License for the specific language governing permissions and | |
| 13 // limitations under the License. | |
| 14 | |
| 15 #ifndef CRASHPAD_UTIL_MISC_UUID_H_ | |
| 16 #define CRASHPAD_UTIL_MISC_UUID_H_ | |
| 17 | |
| 18 #include <stdint.h> | |
| 19 | |
| 20 namespace crashpad { | |
| 21 | |
| 22 //! \brief A universally unique identifier (%UUID). | |
| 23 //! | |
| 24 //! An alternate term for %UUID is “globally unique identifier” (GUID), used | |
| 25 //! primarily by Microsoft. | |
| 26 //! | |
| 27 //! A %UUID is a unique 128-bit number specified by RFC 4122. | |
| 28 struct UUID { | |
|
Robert Sesek
2014/08/01 17:28:18
No default constructor to zero-initialize everythi
Mark Mentovai
2014/08/01 18:05:49
rsesek wrote:
| |
| 29 //! \brief Initializes the %UUID from a sequence of bytes. | |
| 30 //! | |
| 31 //! \a bytes is taken as a %UUID laid out in big-endian format in memory. On | |
| 32 //! little-endian machines, appropriate byte-swapping will be performed to | |
| 33 //! initialize an object’s data members. | |
| 34 //! | |
| 35 //! \param[in] bytes A buffer of exactly 16 bytes that will be assigned to the | |
| 36 //! %UUID. | |
| 37 void InitializeFromBytes(const uint8_t* bytes); | |
| 38 | |
| 39 //! \brief The contents of the %UUID. | |
| 40 //! \{ | |
| 41 uint32_t data_1; | |
| 42 uint16_t data_2; | |
| 43 uint16_t data_3; | |
| 44 uint8_t data_4[8]; | |
|
Robert Sesek
2014/08/01 17:28:18
You may want to split data_4 into two fields: data
Mark Mentovai
2014/08/01 18:05:49
rsesek wrote:
| |
| 45 //! \} | |
| 46 }; | |
| 47 | |
|
Robert Sesek
2014/08/01 17:28:18
A little surprised to not see an ostream operator
| |
| 48 } // namespace crashpad | |
| 49 | |
| 50 #endif // CRASHPAD_UTIL_MISC_UUID_H_ | |
| OLD | NEW |