OLD | NEW |
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" |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 ChromeContentGpuClient::~ChromeContentGpuClient() {} | 64 ChromeContentGpuClient::~ChromeContentGpuClient() {} |
65 | 65 |
66 void ChromeContentGpuClient::Initialize( | 66 void ChromeContentGpuClient::Initialize( |
67 base::FieldTrialList::Observer* observer) { | 67 base::FieldTrialList::Observer* observer) { |
68 DCHECK(!field_trial_syncer_); | 68 DCHECK(!field_trial_syncer_); |
69 const base::CommandLine& command_line = | 69 const base::CommandLine& command_line = |
70 *base::CommandLine::ForCurrentProcess(); | 70 *base::CommandLine::ForCurrentProcess(); |
71 // No need for field trial syncer if we're in the browser process. | 71 // No need for field trial syncer if we're in the browser process. |
72 if (!command_line.HasSwitch(switches::kInProcessGPU)) { | 72 if (!command_line.HasSwitch(switches::kInProcessGPU)) { |
73 field_trial_syncer_.reset( | 73 field_trial_syncer_.reset( |
74 new chrome_variations::ChildProcessFieldTrialSyncer(observer)); | 74 new variations::ChildProcessFieldTrialSyncer(observer)); |
75 field_trial_syncer_->InitFieldTrialObserving(command_line); | 75 field_trial_syncer_->InitFieldTrialObserving(command_line, |
| 76 switches::kSingleProcess); |
76 } | 77 } |
77 } | 78 } |
78 | 79 |
79 void ChromeContentGpuClient::ExposeInterfacesToBrowser( | 80 void ChromeContentGpuClient::ExposeInterfacesToBrowser( |
80 service_manager::InterfaceRegistry* registry, | 81 service_manager::InterfaceRegistry* registry, |
81 const gpu::GpuPreferences& gpu_preferences) { | 82 const gpu::GpuPreferences& gpu_preferences) { |
82 #if defined(OS_CHROMEOS) | 83 #if defined(OS_CHROMEOS) |
83 registry->AddInterface( | 84 registry->AddInterface( |
84 base::Bind(&CreateGpuArcVideoService, gpu_preferences)); | 85 base::Bind(&CreateGpuArcVideoService, gpu_preferences)); |
85 registry->AddInterface( | 86 registry->AddInterface( |
86 base::Bind(&DeprecatedCreateGpuArcVideoService, gpu_preferences)); | 87 base::Bind(&DeprecatedCreateGpuArcVideoService, gpu_preferences)); |
87 #endif | 88 #endif |
88 } | 89 } |
89 | 90 |
90 void ChromeContentGpuClient::ConsumeInterfacesFromBrowser( | 91 void ChromeContentGpuClient::ConsumeInterfacesFromBrowser( |
91 service_manager::InterfaceProvider* provider) { | 92 service_manager::InterfaceProvider* provider) { |
92 metrics::mojom::CallStackProfileCollectorPtr browser_interface; | 93 metrics::mojom::CallStackProfileCollectorPtr browser_interface; |
93 provider->GetInterface(&browser_interface); | 94 provider->GetInterface(&browser_interface); |
94 g_call_stack_profile_collector.Get().SetParentProfileCollector( | 95 g_call_stack_profile_collector.Get().SetParentProfileCollector( |
95 std::move(browser_interface)); | 96 std::move(browser_interface)); |
96 } | 97 } |
OLD | NEW |