OLD | NEW |
---|---|
(Empty) | |
1 /* | |
2 * Copyright (C) 2014 Google Inc. All rights reserved. | |
3 * | |
4 * Use of this source code is governed by a BSD-style license that can be | |
5 * found in the LICENSE file. | |
6 */ | |
7 | |
8 #ifndef SkMemoryDumpManager_DEFINED | |
9 #define SkMemoryDumpManager_DEFINED | |
10 | |
11 #include "SkMemoryAllocatorDump.h" | |
12 #include "SkString.h" | |
13 #include "SkTypes.h" | |
14 | |
15 class SkMemoryDumpProvider; | |
16 class SkProcessMemoryDump; | |
17 | |
18 class SK_API SkMemoryDumpManager { | |
ssid
2015/07/29 18:30:50
These can be made singleton to remove dummy defini
| |
19 public: | |
20 // SkMemoryDumpManager does NOT take memory ownership of |mdp|, which is | |
21 // expected to either be a singleton or unregister itself. | |
22 // The SkMemoryDumpProvider::onMemoryDump | |
23 // method will be called on the same thread that called the | |
24 // registerMemoryDumpProvider() method. | |
25 static void RegisterDumpProvider(SkMemoryDumpProvider* mdp); | |
26 | |
27 // Must be called on the thread that called registerMemoryDumpProvider(). | |
28 static void UnregisterMemoryDumpProvider(SkMemoryDumpProvider*); | |
29 | |
30 // Returns a newly allocated WebProcessMemoryDump instance. | |
31 static SkProcessMemoryDump* CreateProcessMemoryDump(); | |
32 | |
33 // Returns guid corresponding to the given string (the hash value) for | |
34 // creating a WebMemoryAllocatorDump. | |
35 static SkMemoryAllocatorDumpGuid CreateWebMemoryAllocatorDumpGuid( | |
36 const SkString& guidStr); | |
37 | |
38 // Returns a unique id for the current process. The id can be retrieved only | |
39 // by child processes and only when tracing is enabled. This is intended to | |
40 // express cross-process sharing of memory dumps on the child-process side, | |
41 // without having to know its own child process id. | |
42 static uint64_t GetTracingProcessId(); | |
43 }; | |
44 | |
45 #endif // SkMemoryDumpManager_DEFINED | |
OLD | NEW |