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

Side by Side Diff: include/utils/SkMemoryDumpManager.h

Issue 1263813002: [WIP] Exposing memory-infra to Skia. (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: Prettier. Created 5 years, 4 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
« no previous file with comments | « include/utils/SkMemoryAllocatorDump.h ('k') | include/utils/SkMemoryDumpProvider.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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
OLDNEW
« no previous file with comments | « include/utils/SkMemoryAllocatorDump.h ('k') | include/utils/SkMemoryDumpProvider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698