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

Side by Side Diff: public/platform/WebProcessMemoryDump.h

Issue 1159923006: [tracing] Expose AddOwnershipEdge and CreateAllocatorDump with guid to blink. (blink-side). (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase Created 5 years, 6 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 | « public/platform/WebMemoryAllocatorDump.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef WebProcessMemoryDump_h 5 #ifndef WebProcessMemoryDump_h
6 #define WebProcessMemoryDump_h 6 #define WebProcessMemoryDump_h
7 7
8 #include "WebCommon.h" 8 #include "WebCommon.h"
9 #include "WebMemoryAllocatorDump.h"
9 #include "WebString.h" 10 #include "WebString.h"
10 11
11 namespace blink { 12 namespace blink {
12 13
13 class WebMemoryAllocatorDump;
14
15 // A container which holds all the dumps for the various allocators for a given 14 // A container which holds all the dumps for the various allocators for a given
16 // process. Embedders of WebMemoryDumpProvider are expected to populate a 15 // process. Embedders of WebMemoryDumpProvider are expected to populate a
17 // WebProcessMemoryDump instance with the stats of their allocators. 16 // WebProcessMemoryDump instance with the stats of their allocators.
18 class BLINK_PLATFORM_EXPORT WebProcessMemoryDump { 17 class BLINK_PLATFORM_EXPORT WebProcessMemoryDump {
19 public: 18 public:
20 virtual ~WebProcessMemoryDump(); 19 virtual ~WebProcessMemoryDump();
21 20
22 // Creates a new MemoryAllocatorDump with the given name and returns the 21 // Creates a new MemoryAllocatorDump with the given name and returns the
23 // empty object back to the caller. |absoluteName| uniquely identifies the 22 // empty object back to the caller. |absoluteName| uniquely identifies the
24 // dump within the scope of a ProcessMemoryDump. It is possible to express 23 // dump within the scope of a ProcessMemoryDump. It is possible to express
25 // nesting by means of a slash-separated path naming (e.g., 24 // nesting by means of a slash-separated path naming (e.g.,
26 // "allocator_name/arena_1/subheap_X"). 25 // "allocator_name/arena_1/subheap_X").
26 // |guid| is an optional identifier, unique among all processes within the
27 // scope of a global dump. This is only relevant when using
28 // AddOwnershipEdge(). If omitted, it will be automatically generated.
29 virtual WebMemoryAllocatorDump* createMemoryAllocatorDump(const WebString& a bsoluteName, WebMemoryAllocatorDumpGuid guid)
30 {
31 BLINK_ASSERT_NOT_REACHED();
32 return nullptr;
33 }
34
27 virtual WebMemoryAllocatorDump* createMemoryAllocatorDump(const WebString& a bsoluteName) 35 virtual WebMemoryAllocatorDump* createMemoryAllocatorDump(const WebString& a bsoluteName)
28 { 36 {
37 BLINK_ASSERT_NOT_REACHED();
29 return nullptr; 38 return nullptr;
30 } 39 }
31 40
32 // Gets a previously created MemoryAllocatorDump given its name. 41 // Gets a previously created MemoryAllocatorDump given its name.
33 virtual WebMemoryAllocatorDump* getMemoryAllocatorDump(const WebString& abso luteName) const 42 virtual WebMemoryAllocatorDump* getMemoryAllocatorDump(const WebString& abso luteName) const
34 { 43 {
44 BLINK_ASSERT_NOT_REACHED();
35 return nullptr; 45 return nullptr;
36 } 46 }
37 47
38 // Removes all the WebMemoryAllocatorDump(s) contained in this instance. 48 // Removes all the WebMemoryAllocatorDump(s) contained in this instance.
39 // This WebProcessMemoryDump can be safely reused as if it was new once this 49 // This WebProcessMemoryDump can be safely reused as if it was new once this
40 // method returns. 50 // method returns.
41 virtual void clear() 51 virtual void clear()
42 { 52 {
43 BLINK_ASSERT_NOT_REACHED(); 53 BLINK_ASSERT_NOT_REACHED();
44 } 54 }
45 55
46 // Merges all WebMemoryAllocatorDump(s) contained in |other| inside this 56 // Merges all WebMemoryAllocatorDump(s) contained in |other| inside this
47 // WebProcessMemoryDump, transferring their ownership to this instance. 57 // WebProcessMemoryDump, transferring their ownership to this instance.
48 // |other| will be an empty WebProcessMemoryDump after this method returns 58 // |other| will be an empty WebProcessMemoryDump after this method returns
49 // and can be reused as if it was new. 59 // and can be reused as if it was new.
50 virtual void takeAllDumpsFrom(WebProcessMemoryDump* other) 60 virtual void takeAllDumpsFrom(WebProcessMemoryDump* other)
51 { 61 {
52 BLINK_ASSERT_NOT_REACHED(); 62 BLINK_ASSERT_NOT_REACHED();
53 } 63 }
64
65 // Adds an ownership relationship between two MemoryAllocatorDump(s) with
66 // the semantics: |source| owns |target|, and has the effect of attributing
67 // the memory usage of |target| to |source|. |importance| is optional and
68 // relevant only for the cases of co-ownership, where it acts as a z-index:
69 // the owner with the highest importance will be attributed |target|'s
70 // memory.
71 virtual void AddOwnershipEdge(WebMemoryAllocatorDumpGuid source, WebMemoryAl locatorDumpGuid target, int importance)
72 {
73 BLINK_ASSERT_NOT_REACHED();
74 }
75
76 virtual void AddOwnershipEdge(WebMemoryAllocatorDumpGuid source, WebMemoryAl locatorDumpGuid target)
77 {
78 BLINK_ASSERT_NOT_REACHED();
79 }
54 }; 80 };
55 81
56 } // namespace blink 82 } // namespace blink
57 83
58 #endif // WebProcessMemoryDump_h 84 #endif // WebProcessMemoryDump_h
OLDNEW
« no previous file with comments | « public/platform/WebMemoryAllocatorDump.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698