| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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_PROVIDER_INFO_H_ | 5 #ifndef BASE_TRACE_EVENT_MEMORY_DUMP_PROVIDER_INFO_H_ |
| 6 #define BASE_TRACE_EVENT_MEMORY_DUMP_PROVIDER_INFO_H_ | 6 #define BASE_TRACE_EVENT_MEMORY_DUMP_PROVIDER_INFO_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <set> | 9 #include <set> |
| 10 | 10 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 // whether it has been disabled, etc.) | 24 // whether it has been disabled, etc.) |
| 25 // More importantly, having a refptr to this object guarantees that a MDP that | 25 // More importantly, having a refptr to this object guarantees that a MDP that |
| 26 // is not thread-bound (hence which can only be unregistered via | 26 // is not thread-bound (hence which can only be unregistered via |
| 27 // MDM::UnregisterAndDeleteDumpProviderSoon()) will stay alive as long as the | 27 // MDM::UnregisterAndDeleteDumpProviderSoon()) will stay alive as long as the |
| 28 // refptr is held. | 28 // refptr is held. |
| 29 // | 29 // |
| 30 // Lifetime: | 30 // Lifetime: |
| 31 // At any time, there is at most one instance of this class for each instance | 31 // At any time, there is at most one instance of this class for each instance |
| 32 // of a given MemoryDumpProvider, but there might be several scoped_refptr | 32 // of a given MemoryDumpProvider, but there might be several scoped_refptr |
| 33 // holding onto each of this. Specifically: | 33 // holding onto each of this. Specifically: |
| 34 // - In nominal conditions, there is a refptr for each registerd MDP in the | 34 // - In nominal conditions, there is a refptr for each registered MDP in the |
| 35 // MDM's |dump_providers_| list. | 35 // MDM's |dump_providers_| list. |
| 36 // - In most cases, the only refptr (in the |dump_providers_| list) is destroyed | 36 // - In most cases, the only refptr (in the |dump_providers_| list) is destroyed |
| 37 // by MDM::UnregisterDumpProvider(). | 37 // by MDM::UnregisterDumpProvider(). |
| 38 // - However, when MDM starts a dump, the list of refptrs is copied into the | 38 // - However, when MDM starts a dump, the list of refptrs is copied into the |
| 39 // ProcessMemoryDumpAsyncState. That list is pruned as MDP(s) are invoked. | 39 // ProcessMemoryDumpAsyncState. That list is pruned as MDP(s) are invoked. |
| 40 // - If UnregisterDumpProvider() is called on a non-thread-bound MDP while a | 40 // - If UnregisterDumpProvider() is called on a non-thread-bound MDP while a |
| 41 // dump is in progress, the extar extra of the handle is destroyed in | 41 // dump is in progress, the extar extra of the handle is destroyed in |
| 42 // MDM::SetupNextMemoryDump() or MDM::InvokeOnMemoryDump(), when the copy | 42 // MDM::SetupNextMemoryDump() or MDM::InvokeOnMemoryDump(), when the copy |
| 43 // inside ProcessMemoryDumpAsyncState is erase()-d. | 43 // inside ProcessMemoryDumpAsyncState is erase()-d. |
| 44 // - The PeakDetector can keep extra refptrs when enabled. | 44 // - The PeakDetector can keep extra refptrs when enabled. |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 friend class base::RefCountedThreadSafe<MemoryDumpProviderInfo>; | 103 friend class base::RefCountedThreadSafe<MemoryDumpProviderInfo>; |
| 104 ~MemoryDumpProviderInfo(); | 104 ~MemoryDumpProviderInfo(); |
| 105 | 105 |
| 106 DISALLOW_COPY_AND_ASSIGN(MemoryDumpProviderInfo); | 106 DISALLOW_COPY_AND_ASSIGN(MemoryDumpProviderInfo); |
| 107 }; | 107 }; |
| 108 | 108 |
| 109 } // namespace trace_event | 109 } // namespace trace_event |
| 110 } // namespace base | 110 } // namespace base |
| 111 | 111 |
| 112 #endif // BASE_TRACE_EVENT_MEMORY_DUMP_PROVIDER_INFO_H_ | 112 #endif // BASE_TRACE_EVENT_MEMORY_DUMP_PROVIDER_INFO_H_ |
| OLD | NEW |