Chromium Code Reviews| Index: include/utils/SkMemoryDumpManager.h |
| diff --git a/include/utils/SkMemoryDumpManager.h b/include/utils/SkMemoryDumpManager.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..1afa273fda7f215fd06d19d5c09980bf64141d12 |
| --- /dev/null |
| +++ b/include/utils/SkMemoryDumpManager.h |
| @@ -0,0 +1,45 @@ |
| +/* |
| + * Copyright (C) 2014 Google Inc. All rights reserved. |
| + * |
| + * Use of this source code is governed by a BSD-style license that can be |
| + * found in the LICENSE file. |
| + */ |
| + |
| +#ifndef SkMemoryDumpManager_DEFINED |
| +#define SkMemoryDumpManager_DEFINED |
| + |
| +#include "SkMemoryAllocatorDump.h" |
| +#include "SkString.h" |
| +#include "SkTypes.h" |
| + |
| +class SkMemoryDumpProvider; |
| +class SkProcessMemoryDump; |
| + |
| +class SK_API SkMemoryDumpManager { |
|
ssid
2015/07/29 18:30:50
These can be made singleton to remove dummy defini
|
| + public: |
| + // SkMemoryDumpManager does NOT take memory ownership of |mdp|, which is |
| + // expected to either be a singleton or unregister itself. |
| + // The SkMemoryDumpProvider::onMemoryDump |
| + // method will be called on the same thread that called the |
| + // registerMemoryDumpProvider() method. |
| + static void RegisterDumpProvider(SkMemoryDumpProvider* mdp); |
| + |
| + // Must be called on the thread that called registerMemoryDumpProvider(). |
| + static void UnregisterMemoryDumpProvider(SkMemoryDumpProvider*); |
| + |
| + // Returns a newly allocated WebProcessMemoryDump instance. |
| + static SkProcessMemoryDump* CreateProcessMemoryDump(); |
| + |
| + // Returns guid corresponding to the given string (the hash value) for |
| + // creating a WebMemoryAllocatorDump. |
| + static SkMemoryAllocatorDumpGuid CreateWebMemoryAllocatorDumpGuid( |
| + const SkString& guidStr); |
| + |
| + // Returns a unique id for the current process. The id can be retrieved only |
| + // by child processes and only when tracing is enabled. This is intended to |
| + // express cross-process sharing of memory dumps on the child-process side, |
| + // without having to know its own child process id. |
| + static uint64_t GetTracingProcessId(); |
| +}; |
| + |
| +#endif // SkMemoryDumpManager_DEFINED |