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_memory_dump_manager_delegate_impl.h" | 5 #include "components/tracing/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_trace_message_filter.h" | 9 #include "components/tracing/child_trace_message_filter.h" |
10 #include "components/tracing/process_metrics_memory_dump_provider.h" | 10 #include "components/tracing/process_metrics_memory_dump_provider.h" |
(...skipping 22 matching lines...) Expand all Loading... |
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 const 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_ == nullptr || (ctmf == nullptr && ctmf_task_runner_ != nullptr)); | 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 |
51 if (ctmf) { | 51 if (ctmf) { |
52 base::trace_event::MemoryDumpManager::GetInstance()->Initialize( | 52 base::trace_event::MemoryDumpManager::GetInstance()->Initialize( |
53 this /* delegate */, false /* is_coordinator */); | 53 this /* delegate */, false /* is_coordinator */); |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 | 97 |
98 // Send the request up to the browser process' MessageDumpmanager. | 98 // Send the request up to the browser process' MessageDumpmanager. |
99 ctmf_->SendGlobalMemoryDumpRequest(args, callback); | 99 ctmf_->SendGlobalMemoryDumpRequest(args, callback); |
100 } | 100 } |
101 | 101 |
102 uint64_t ChildMemoryDumpManagerDelegateImpl::GetTracingProcessId() const { | 102 uint64_t ChildMemoryDumpManagerDelegateImpl::GetTracingProcessId() const { |
103 return tracing_process_id_; | 103 return tracing_process_id_; |
104 } | 104 } |
105 | 105 |
106 } // namespace tracing | 106 } // namespace tracing |
OLD | NEW |