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

Side by Side Diff: chrome/gpu/chrome_content_gpu_client.cc

Issue 2755813002: Begin to wean child processes off reliance on a persistent service_manager::Connection to the brows… (Closed)
Patch Set: . Created 3 years, 9 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/gpu/chrome_content_gpu_client.h" 5 #include "chrome/gpu/chrome_content_gpu_client.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
11 #include "base/memory/ptr_util.h" 11 #include "base/memory/ptr_util.h"
12 #include "base/threading/platform_thread.h" 12 #include "base/threading/platform_thread.h"
13 #include "base/time/time.h" 13 #include "base/time/time.h"
14 #include "chrome/common/stack_sampling_configuration.h" 14 #include "chrome/common/stack_sampling_configuration.h"
15 #include "components/metrics/child_call_stack_profile_collector.h" 15 #include "components/metrics/child_call_stack_profile_collector.h"
16 #include "content/public/common/content_switches.h" 16 #include "content/public/common/content_switches.h"
17 #include "content/public/common/service_names.mojom.h"
17 #include "mojo/public/cpp/bindings/strong_binding.h" 18 #include "mojo/public/cpp/bindings/strong_binding.h"
18 #include "services/service_manager/public/cpp/connector.h" 19 #include "services/service_manager/public/cpp/connector.h"
19 #include "services/service_manager/public/cpp/interface_registry.h"
20 20
21 #if defined(OS_CHROMEOS) 21 #if defined(OS_CHROMEOS)
22 #include "chrome/gpu/gpu_arc_video_service.h" 22 #include "chrome/gpu/gpu_arc_video_service.h"
23 #include "services/service_manager/public/cpp/interface_registry.h"
23 #endif 24 #endif
24 25
25 namespace { 26 namespace {
26 27
27 #if defined(OS_CHROMEOS) 28 #if defined(OS_CHROMEOS)
28 void CreateGpuArcVideoService( 29 void CreateGpuArcVideoService(
29 const gpu::GpuPreferences& gpu_preferences, 30 const gpu::GpuPreferences& gpu_preferences,
30 ::arc::mojom::VideoAcceleratorServiceRequest request) { 31 ::arc::mojom::VideoAcceleratorServiceRequest request) {
31 mojo::MakeStrongBinding( 32 mojo::MakeStrongBinding(
32 base::MakeUnique<chromeos::arc::GpuArcVideoService>(gpu_preferences), 33 base::MakeUnique<chromeos::arc::GpuArcVideoService>(gpu_preferences),
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 void ChromeContentGpuClient::ExposeInterfacesToBrowser( 73 void ChromeContentGpuClient::ExposeInterfacesToBrowser(
73 service_manager::InterfaceRegistry* registry, 74 service_manager::InterfaceRegistry* registry,
74 const gpu::GpuPreferences& gpu_preferences) { 75 const gpu::GpuPreferences& gpu_preferences) {
75 #if defined(OS_CHROMEOS) 76 #if defined(OS_CHROMEOS)
76 registry->AddInterface( 77 registry->AddInterface(
77 base::Bind(&CreateGpuArcVideoService, gpu_preferences)); 78 base::Bind(&CreateGpuArcVideoService, gpu_preferences));
78 #endif 79 #endif
79 } 80 }
80 81
81 void ChromeContentGpuClient::ConsumeInterfacesFromBrowser( 82 void ChromeContentGpuClient::ConsumeInterfacesFromBrowser(
82 service_manager::InterfaceProvider* provider) { 83 service_manager::Connector* connector) {
83 metrics::mojom::CallStackProfileCollectorPtr browser_interface; 84 metrics::mojom::CallStackProfileCollectorPtr browser_interface;
84 provider->GetInterface(&browser_interface); 85 connector->BindInterface(content::mojom::kBrowserServiceName,
86 &browser_interface);
85 g_call_stack_profile_collector.Get().SetParentProfileCollector( 87 g_call_stack_profile_collector.Get().SetParentProfileCollector(
86 std::move(browser_interface)); 88 std::move(browser_interface));
87 } 89 }
OLDNEW
« no previous file with comments | « chrome/gpu/chrome_content_gpu_client.h ('k') | chrome/renderer/chrome_content_renderer_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698