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 "chrome/browser/task_manager/providers/child_process_task.h" | 5 #include "chrome/browser/task_manager/providers/child_process_task.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/i18n/rtl.h" | 9 #include "base/i18n/rtl.h" |
10 #include "base/numerics/safe_conversions.h" | 10 #include "base/numerics/safe_conversions.h" |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 if (interfaces) | 129 if (interfaces) |
130 interfaces->GetInterface(std::move(resource_reporter)); | 130 interfaces->GetInterface(std::move(resource_reporter)); |
131 } | 131 } |
132 | 132 |
133 // Creates the Mojo service wrapper that will be used to sample the V8 memory | 133 // Creates the Mojo service wrapper that will be used to sample the V8 memory |
134 // usage of the browser child process whose unique ID is | 134 // usage of the browser child process whose unique ID is |
135 // |unique_child_process_id|. | 135 // |unique_child_process_id|. |
136 ProcessResourceUsage* CreateProcessResourcesSampler( | 136 ProcessResourceUsage* CreateProcessResourcesSampler( |
137 int unique_child_process_id) { | 137 int unique_child_process_id) { |
138 chrome::mojom::ResourceUsageReporterPtr usage_reporter; | 138 chrome::mojom::ResourceUsageReporterPtr usage_reporter; |
139 chrome::mojom::ResourceUsageReporterRequest request = | 139 chrome::mojom::ResourceUsageReporterRequest request(&usage_reporter); |
140 mojo::MakeRequest(&usage_reporter); | |
141 content::BrowserThread::PostTask( | 140 content::BrowserThread::PostTask( |
142 content::BrowserThread::IO, | 141 content::BrowserThread::IO, |
143 FROM_HERE, | 142 FROM_HERE, |
144 base::Bind(&ConnectResourceReporterOnIOThread, | 143 base::Bind(&ConnectResourceReporterOnIOThread, |
145 unique_child_process_id, base::Passed(&request))); | 144 unique_child_process_id, base::Passed(&request))); |
146 | 145 |
147 return new ProcessResourceUsage(std::move(usage_reporter)); | 146 return new ProcessResourceUsage(std::move(usage_reporter)); |
148 } | 147 } |
149 | 148 |
150 bool UsesV8Memory(int process_type) { | 149 bool UsesV8Memory(int process_type) { |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
231 | 230 |
232 int64_t ChildProcessTask::GetV8MemoryAllocated() const { | 231 int64_t ChildProcessTask::GetV8MemoryAllocated() const { |
233 return v8_memory_allocated_; | 232 return v8_memory_allocated_; |
234 } | 233 } |
235 | 234 |
236 int64_t ChildProcessTask::GetV8MemoryUsed() const { | 235 int64_t ChildProcessTask::GetV8MemoryUsed() const { |
237 return v8_memory_used_; | 236 return v8_memory_used_; |
238 } | 237 } |
239 | 238 |
240 } // namespace task_manager | 239 } // namespace task_manager |
OLD | NEW |