Don't show supervised user as "already on this device" while they're being imported.
[chromium-blink-merge.git] / base / trace_event / memory_allocator_dump_guid.h
blob84c12ef037401fe035ce4a3f5966cd4e9f617a46
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef BASE_TRACE_EVENT_MEMORY_ALLOCATOR_DUMP_GUID_H_
6 #define BASE_TRACE_EVENT_MEMORY_ALLOCATOR_DUMP_GUID_H_
8 #include <string>
10 #include "base/base_export.h"
11 #include "base/basictypes.h"
13 namespace base {
14 namespace trace_event {
16 class BASE_EXPORT MemoryAllocatorDumpGuid {
17 public:
18 MemoryAllocatorDumpGuid();
19 explicit MemoryAllocatorDumpGuid(uint64 guid);
21 // Utility ctor to hash a GUID if the caller prefers a string. The caller
22 // still has to ensure that |guid_str| is unique, per snapshot, within the
23 // global scope of all the traced processes.
24 explicit MemoryAllocatorDumpGuid(const std::string& guid_str);
26 // Returns a (hex-encoded) string representation of the guid.
27 std::string ToString() const;
29 bool empty() const { return guid_ == 0u; }
31 bool operator==(const MemoryAllocatorDumpGuid& other) const {
32 return guid_ == other.guid_;
35 bool operator!=(const MemoryAllocatorDumpGuid& other) const {
36 return !(*this == other);
39 private:
40 uint64 guid_;
42 // Deliberately copy-able.
45 } // namespace trace_event
46 } // namespace base
48 #endif // BASE_TRACE_EVENT_MEMORY_ALLOCATOR_DUMP_GUID_H_