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 #include "components/tracing/child/child_memory_dump_manager_delegate_impl.h" | 5 #include "components/tracing/child/child_memory_dump_manager_delegate_impl.h" |
6 | 6 |
7 #include "base/single_thread_task_runner.h" | 7 #include "base/single_thread_task_runner.h" |
8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
9 #include "components/tracing/child/child_trace_message_filter.h" | 9 #include "components/tracing/child/child_trace_message_filter.h" |
10 #include "components/tracing/common/process_metrics_memory_dump_provider.h" | 10 #include "components/tracing/common/process_metrics_memory_dump_provider.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 ChildMemoryDumpManagerDelegateImpl::ChildMemoryDumpManagerDelegateImpl() | 30 ChildMemoryDumpManagerDelegateImpl::ChildMemoryDumpManagerDelegateImpl() |
31 : ctmf_(nullptr), | 31 : ctmf_(nullptr), |
32 tracing_process_id_( | 32 tracing_process_id_( |
33 base::trace_event::MemoryDumpManager::kInvalidTracingProcessId) { | 33 base::trace_event::MemoryDumpManager::kInvalidTracingProcessId) { |
34 } | 34 } |
35 | 35 |
36 ChildMemoryDumpManagerDelegateImpl::~ChildMemoryDumpManagerDelegateImpl() {} | 36 ChildMemoryDumpManagerDelegateImpl::~ChildMemoryDumpManagerDelegateImpl() {} |
37 | 37 |
38 void ChildMemoryDumpManagerDelegateImpl::SetChildTraceMessageFilter( | 38 void ChildMemoryDumpManagerDelegateImpl::SetChildTraceMessageFilter( |
39 ChildTraceMessageFilter* ctmf) { | 39 ChildTraceMessageFilter* ctmf) { |
40 const auto& task_runner = ctmf ? (ctmf->ipc_task_runner()) : nullptr; | 40 auto* task_runner = ctmf ? (ctmf->ipc_task_runner()) : nullptr; |
41 // Check that we are either registering the CTMF or tearing it down, but not | 41 // Check that we are either registering the CTMF or tearing it down, but not |
42 // replacing a valid instance with another one (should never happen). | 42 // replacing a valid instance with another one (should never happen). |
43 DCHECK(!ctmf_ || (!ctmf && ctmf_task_runner_)); | 43 DCHECK(!ctmf_ || (!ctmf && ctmf_task_runner_)); |
44 ctmf_ = ctmf; | 44 ctmf_ = ctmf; |
45 | 45 |
46 { | 46 { |
47 base::AutoLock lock(lock_); | 47 base::AutoLock lock(lock_); |
48 ctmf_task_runner_ = task_runner; | 48 ctmf_task_runner_ = task_runner; |
49 } | 49 } |
50 | 50 |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 | 105 |
106 // Send the request up to the browser process' MessageDumpmanager. | 106 // Send the request up to the browser process' MessageDumpmanager. |
107 ctmf_->SendGlobalMemoryDumpRequest(args, callback); | 107 ctmf_->SendGlobalMemoryDumpRequest(args, callback); |
108 } | 108 } |
109 | 109 |
110 uint64_t ChildMemoryDumpManagerDelegateImpl::GetTracingProcessId() const { | 110 uint64_t ChildMemoryDumpManagerDelegateImpl::GetTracingProcessId() const { |
111 return tracing_process_id_; | 111 return tracing_process_id_; |
112 } | 112 } |
113 | 113 |
114 } // namespace tracing | 114 } // namespace tracing |
OLD | NEW |