| 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_MEMORY_DUMP_MANAGER_H_ | 5 #ifndef BASE_TRACE_EVENT_MEMORY_DUMP_MANAGER_H_ |
| 6 #define BASE_TRACE_EVENT_MEMORY_DUMP_MANAGER_H_ | 6 #define BASE_TRACE_EVENT_MEMORY_DUMP_MANAGER_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 const MemoryDumpCallback& callback); | 109 const MemoryDumpCallback& callback); |
| 110 | 110 |
| 111 // Same as above (still asynchronous), but without callback. | 111 // Same as above (still asynchronous), but without callback. |
| 112 void RequestGlobalDump(MemoryDumpType dump_type, | 112 void RequestGlobalDump(MemoryDumpType dump_type, |
| 113 MemoryDumpLevelOfDetail level_of_detail); | 113 MemoryDumpLevelOfDetail level_of_detail); |
| 114 | 114 |
| 115 // TraceLog::EnabledStateObserver implementation. | 115 // TraceLog::EnabledStateObserver implementation. |
| 116 void OnTraceLogEnabled() override; | 116 void OnTraceLogEnabled() override; |
| 117 void OnTraceLogDisabled() override; | 117 void OnTraceLogDisabled() override; |
| 118 | 118 |
| 119 // Returns true if the dump mode is allowed for current tracing session. |
| 120 bool IsDumpModeAllowed(MemoryDumpLevelOfDetail dump_mode); |
| 121 |
| 119 // Returns the MemoryDumpSessionState object, which is shared by all the | 122 // Returns the MemoryDumpSessionState object, which is shared by all the |
| 120 // ProcessMemoryDump and MemoryAllocatorDump instances through all the tracing | 123 // ProcessMemoryDump and MemoryAllocatorDump instances through all the tracing |
| 121 // session lifetime. | 124 // session lifetime. |
| 122 const scoped_refptr<MemoryDumpSessionState>& session_state() const { | 125 const scoped_refptr<MemoryDumpSessionState>& session_state_for_testing() |
| 126 const { |
| 123 return session_state_; | 127 return session_state_; |
| 124 } | 128 } |
| 125 | 129 |
| 126 // Returns a unique id for identifying the processes. The id can be | 130 // Returns a unique id for identifying the processes. The id can be |
| 127 // retrieved by child processes only when tracing is enabled. This is | 131 // retrieved by child processes only when tracing is enabled. This is |
| 128 // intended to express cross-process sharing of memory dumps on the | 132 // intended to express cross-process sharing of memory dumps on the |
| 129 // child-process side, without having to know its own child process id. | 133 // child-process side, without having to know its own child process id. |
| 130 uint64_t GetTracingProcessId() const; | 134 uint64_t GetTracingProcessId() const; |
| 131 | 135 |
| 132 // Returns the name for a the allocated_objects dump. Use this to declare | 136 // Returns the name for a the allocated_objects dump. Use this to declare |
| (...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 397 } | 401 } |
| 398 | 402 |
| 399 private: | 403 private: |
| 400 DISALLOW_COPY_AND_ASSIGN(MemoryDumpManagerDelegate); | 404 DISALLOW_COPY_AND_ASSIGN(MemoryDumpManagerDelegate); |
| 401 }; | 405 }; |
| 402 | 406 |
| 403 } // namespace trace_event | 407 } // namespace trace_event |
| 404 } // namespace base | 408 } // namespace base |
| 405 | 409 |
| 406 #endif // BASE_TRACE_EVENT_MEMORY_DUMP_MANAGER_H_ | 410 #endif // BASE_TRACE_EVENT_MEMORY_DUMP_MANAGER_H_ |
| OLD | NEW |