| OLD | NEW |
| 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 BASE_TRACE_EVENT_HEAP_PROFILER_STACK_FRAME_DEDUPLICATOR_H_ | 5 #ifndef BASE_TRACE_EVENT_HEAP_PROFILER_STACK_FRAME_DEDUPLICATOR_H_ |
| 6 #define BASE_TRACE_EVENT_HEAP_PROFILER_STACK_FRAME_DEDUPLICATOR_H_ | 6 #define BASE_TRACE_EVENT_HEAP_PROFILER_STACK_FRAME_DEDUPLICATOR_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 ~FrameNode(); | 35 ~FrameNode(); |
| 36 | 36 |
| 37 StackFrame frame; | 37 StackFrame frame; |
| 38 | 38 |
| 39 // The index of the parent stack frame in |frames_|, or -1 if there is no | 39 // The index of the parent stack frame in |frames_|, or -1 if there is no |
| 40 // parent frame (when it is at the bottom of the call stack). | 40 // parent frame (when it is at the bottom of the call stack). |
| 41 int parent_frame_index; | 41 int parent_frame_index; |
| 42 | 42 |
| 43 // Indices into |frames_| of frames called from the current frame. | 43 // Indices into |frames_| of frames called from the current frame. |
| 44 std::map<StackFrame, int> children; | 44 std::map<StackFrame, int> children; |
| 45 |
| 46 // Whether index of this node was ever returned from Insert(). |
| 47 bool indexed; |
| 45 }; | 48 }; |
| 46 | 49 |
| 47 using ConstIterator = std::vector<FrameNode>::const_iterator; | 50 using ConstIterator = std::vector<FrameNode>::const_iterator; |
| 48 | 51 |
| 49 StackFrameDeduplicator(); | 52 StackFrameDeduplicator(); |
| 50 ~StackFrameDeduplicator() override; | 53 ~StackFrameDeduplicator() override; |
| 51 | 54 |
| 52 // Inserts a backtrace where |beginFrame| is a pointer to the bottom frame | 55 // Inserts a backtrace where |beginFrame| is a pointer to the bottom frame |
| 53 // (e.g. main) and |endFrame| is a pointer past the top frame (most recently | 56 // (e.g. main) and |endFrame| is a pointer past the top frame (most recently |
| 54 // called function), and returns the index of its leaf node in |frames_|. | 57 // called function), and returns the index of its leaf node in |frames_|. |
| (...skipping 15 matching lines...) Expand all Loading... |
| 70 std::map<StackFrame, int> roots_; | 73 std::map<StackFrame, int> roots_; |
| 71 std::vector<FrameNode> frames_; | 74 std::vector<FrameNode> frames_; |
| 72 | 75 |
| 73 DISALLOW_COPY_AND_ASSIGN(StackFrameDeduplicator); | 76 DISALLOW_COPY_AND_ASSIGN(StackFrameDeduplicator); |
| 74 }; | 77 }; |
| 75 | 78 |
| 76 } // namespace trace_event | 79 } // namespace trace_event |
| 77 } // namespace base | 80 } // namespace base |
| 78 | 81 |
| 79 #endif // BASE_TRACE_EVENT_HEAP_PROFILER_STACK_FRAME_DEDUPLICATOR_H_ | 82 #endif // BASE_TRACE_EVENT_HEAP_PROFILER_STACK_FRAME_DEDUPLICATOR_H_ |
| OLD | NEW |