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

Unified 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, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « include/utils/SkMemoryAllocatorDump.h ('k') | include/utils/SkMemoryDumpProvider.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« 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