Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(451)

Side by Side Diff: chrome/browser/task_manager/providers/child_process_task.cc

Issue 2766263009: Convert content ConnectionFilter to OnBindInterface (Closed)
Patch Set: . Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 void ConnectResourceReporterOnIOThread( 117 void ConnectResourceReporterOnIOThread(
118 int unique_child_process_id, 118 int unique_child_process_id,
119 chrome::mojom::ResourceUsageReporterRequest resource_reporter) { 119 chrome::mojom::ResourceUsageReporterRequest resource_reporter) {
120 DCHECK_CURRENTLY_ON(content::BrowserThread::IO); 120 DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
121 121
122 content::BrowserChildProcessHost* host = 122 content::BrowserChildProcessHost* host =
123 content::BrowserChildProcessHost::FromID(unique_child_process_id); 123 content::BrowserChildProcessHost::FromID(unique_child_process_id);
124 if (!host) 124 if (!host)
125 return; 125 return;
126 126
127 service_manager::InterfaceProvider* interfaces = 127 BindInterface(host->GetHost(), std::move(resource_reporter));
128 host->GetHost()->GetRemoteInterfaces();
129 if (interfaces)
130 interfaces->GetInterface(std::move(resource_reporter));
131 } 128 }
132 129
133 // Creates the Mojo service wrapper that will be used to sample the V8 memory 130 // 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 131 // usage of the browser child process whose unique ID is
135 // |unique_child_process_id|. 132 // |unique_child_process_id|.
136 ProcessResourceUsage* CreateProcessResourcesSampler( 133 ProcessResourceUsage* CreateProcessResourcesSampler(
137 int unique_child_process_id) { 134 int unique_child_process_id) {
138 chrome::mojom::ResourceUsageReporterPtr usage_reporter; 135 chrome::mojom::ResourceUsageReporterPtr usage_reporter;
139 chrome::mojom::ResourceUsageReporterRequest request(&usage_reporter); 136 chrome::mojom::ResourceUsageReporterRequest request(&usage_reporter);
140 content::BrowserThread::PostTask( 137 content::BrowserThread::PostTask(
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 227
231 int64_t ChildProcessTask::GetV8MemoryAllocated() const { 228 int64_t ChildProcessTask::GetV8MemoryAllocated() const {
232 return v8_memory_allocated_; 229 return v8_memory_allocated_;
233 } 230 }
234 231
235 int64_t ChildProcessTask::GetV8MemoryUsed() const { 232 int64_t ChildProcessTask::GetV8MemoryUsed() const {
236 return v8_memory_used_; 233 return v8_memory_used_;
237 } 234 }
238 235
239 } // namespace task_manager 236 } // namespace task_manager
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698