| 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 <set> | 8 #include <set> |
| 9 | 9 |
| 10 #include "base/atomicops.h" | 10 #include "base/atomicops.h" |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 // - name: a friendly name (duplicates allowed). Used for debugging and | 62 // - name: a friendly name (duplicates allowed). Used for debugging and |
| 63 // run-time profiling of memory-infra internals. Must be a long-lived | 63 // run-time profiling of memory-infra internals. Must be a long-lived |
| 64 // C string. | 64 // C string. |
| 65 // - task_runner: (optional) if non-null, all the calls to the |mdp| will be | 65 // - task_runner: (optional) if non-null, all the calls to the |mdp| will be |
| 66 // issued on the given thread. Otherwise, the |mdp| should be able to | 66 // issued on the given thread. Otherwise, the |mdp| should be able to |
| 67 // handle calls on arbitrary threads. | 67 // handle calls on arbitrary threads. |
| 68 void RegisterDumpProvider( | 68 void RegisterDumpProvider( |
| 69 MemoryDumpProvider* mdp, | 69 MemoryDumpProvider* mdp, |
| 70 const char* name, | 70 const char* name, |
| 71 const scoped_refptr<SingleThreadTaskRunner>& task_runner); | 71 const scoped_refptr<SingleThreadTaskRunner>& task_runner); |
| 72 void RegisterDumpProvider(MemoryDumpProvider* mdp); | 72 void RegisterDumpProvider(MemoryDumpProvider* mdp, const char* name); |
| 73 | |
| 74 // TODO(primiano): remove this one after all the existing dump provider have | |
| 75 // been converted. | |
| 76 void RegisterDumpProvider( | |
| 77 MemoryDumpProvider* mdp, | |
| 78 const scoped_refptr<SingleThreadTaskRunner>& task_runner); | |
| 79 void UnregisterDumpProvider(MemoryDumpProvider* mdp); | 73 void UnregisterDumpProvider(MemoryDumpProvider* mdp); |
| 80 | 74 |
| 81 // Requests a memory dump. The dump might happen or not depending on the | 75 // Requests a memory dump. The dump might happen or not depending on the |
| 82 // filters and categories specified when enabling tracing. | 76 // filters and categories specified when enabling tracing. |
| 83 // The optional |callback| is executed asynchronously, on an arbitrary thread, | 77 // The optional |callback| is executed asynchronously, on an arbitrary thread, |
| 84 // to notify about the completion of the global dump (i.e. after all the | 78 // to notify about the completion of the global dump (i.e. after all the |
| 85 // processes have dumped) and its success (true iff all the dumps were | 79 // processes have dumped) and its success (true iff all the dumps were |
| 86 // successful). | 80 // successful). |
| 87 void RequestGlobalDump(MemoryDumpType dump_type, | 81 void RequestGlobalDump(MemoryDumpType dump_type, |
| 88 MemoryDumpLevelOfDetail level_of_detail, | 82 MemoryDumpLevelOfDetail level_of_detail, |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 274 } | 268 } |
| 275 | 269 |
| 276 private: | 270 private: |
| 277 DISALLOW_COPY_AND_ASSIGN(MemoryDumpManagerDelegate); | 271 DISALLOW_COPY_AND_ASSIGN(MemoryDumpManagerDelegate); |
| 278 }; | 272 }; |
| 279 | 273 |
| 280 } // namespace trace_event | 274 } // namespace trace_event |
| 281 } // namespace base | 275 } // namespace base |
| 282 | 276 |
| 283 #endif // BASE_TRACE_EVENT_MEMORY_DUMP_MANAGER_H_ | 277 #endif // BASE_TRACE_EVENT_MEMORY_DUMP_MANAGER_H_ |
| OLD | NEW |