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

Side by Side Diff: base/trace_event/memory_allocator_dump_guid.h

Issue 1647803004: Move base to DEPS (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 4 years, 10 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 unified diff | Download patch
OLDNEW
(Empty)
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.
4
5 #ifndef BASE_TRACE_EVENT_MEMORY_ALLOCATOR_DUMP_GUID_H_
6 #define BASE_TRACE_EVENT_MEMORY_ALLOCATOR_DUMP_GUID_H_
7
8 #include <string>
9
10 #include "base/base_export.h"
11 #include "base/basictypes.h"
12
13 namespace base {
14 namespace trace_event {
15
16 class BASE_EXPORT MemoryAllocatorDumpGuid {
17 public:
18 MemoryAllocatorDumpGuid();
19 explicit MemoryAllocatorDumpGuid(uint64 guid);
20
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);
25
26 uint64 ToUint64() const { return guid_; }
27
28 // Returns a (hex-encoded) string representation of the guid.
29 std::string ToString() const;
30
31 bool empty() const { return guid_ == 0u; }
32
33 bool operator==(const MemoryAllocatorDumpGuid& other) const {
34 return guid_ == other.guid_;
35 }
36
37 bool operator!=(const MemoryAllocatorDumpGuid& other) const {
38 return !(*this == other);
39 }
40
41 private:
42 uint64 guid_;
43
44 // Deliberately copy-able.
45 };
46
47 } // namespace trace_event
48 } // namespace base
49
50 #endif // BASE_TRACE_EVENT_MEMORY_ALLOCATOR_DUMP_GUID_H_
OLDNEW
« no previous file with comments | « base/trace_event/memory_allocator_dump.cc ('k') | base/trace_event/memory_allocator_dump_guid.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698