| 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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 if (StackSamplingConfiguration::Get()->IsProfilerEnabledForCurrentProcess()) | 59 if (StackSamplingConfiguration::Get()->IsProfilerEnabledForCurrentProcess()) |
| 60 stack_sampling_profiler_.Start(); | 60 stack_sampling_profiler_.Start(); |
| 61 } | 61 } |
| 62 | 62 |
| 63 ChromeContentGpuClient::~ChromeContentGpuClient() {} | 63 ChromeContentGpuClient::~ChromeContentGpuClient() {} |
| 64 | 64 |
| 65 void ChromeContentGpuClient::Initialize( | 65 void ChromeContentGpuClient::Initialize( |
| 66 base::FieldTrialList::Observer* observer) { | 66 base::FieldTrialList::Observer* observer) { |
| 67 DCHECK(!field_trial_syncer_); | 67 DCHECK(!field_trial_syncer_); |
| 68 field_trial_syncer_.reset( | 68 field_trial_syncer_.reset( |
| 69 new chrome_variations::ChildProcessFieldTrialSyncer(observer)); | 69 new variations::ChildProcessFieldTrialSyncer(observer)); |
| 70 const base::CommandLine& command_line = | 70 const base::CommandLine& command_line = |
| 71 *base::CommandLine::ForCurrentProcess(); | 71 *base::CommandLine::ForCurrentProcess(); |
| 72 field_trial_syncer_->InitFieldTrialObserving(command_line); | 72 field_trial_syncer_->InitFieldTrialObserving(command_line); |
| 73 } | 73 } |
| 74 | 74 |
| 75 void ChromeContentGpuClient::ExposeInterfacesToBrowser( | 75 void ChromeContentGpuClient::ExposeInterfacesToBrowser( |
| 76 service_manager::InterfaceRegistry* registry, | 76 service_manager::InterfaceRegistry* registry, |
| 77 const gpu::GpuPreferences& gpu_preferences) { | 77 const gpu::GpuPreferences& gpu_preferences) { |
| 78 #if defined(OS_CHROMEOS) | 78 #if defined(OS_CHROMEOS) |
| 79 registry->AddInterface( | 79 registry->AddInterface( |
| 80 base::Bind(&CreateGpuArcVideoService, gpu_preferences)); | 80 base::Bind(&CreateGpuArcVideoService, gpu_preferences)); |
| 81 registry->AddInterface( | 81 registry->AddInterface( |
| 82 base::Bind(&DeprecatedCreateGpuArcVideoService, gpu_preferences)); | 82 base::Bind(&DeprecatedCreateGpuArcVideoService, gpu_preferences)); |
| 83 #endif | 83 #endif |
| 84 } | 84 } |
| 85 | 85 |
| 86 void ChromeContentGpuClient::ConsumeInterfacesFromBrowser( | 86 void ChromeContentGpuClient::ConsumeInterfacesFromBrowser( |
| 87 service_manager::InterfaceProvider* provider) { | 87 service_manager::InterfaceProvider* provider) { |
| 88 metrics::mojom::CallStackProfileCollectorPtr browser_interface; | 88 metrics::mojom::CallStackProfileCollectorPtr browser_interface; |
| 89 provider->GetInterface(&browser_interface); | 89 provider->GetInterface(&browser_interface); |
| 90 g_call_stack_profile_collector.Get().SetParentProfileCollector( | 90 g_call_stack_profile_collector.Get().SetParentProfileCollector( |
| 91 std::move(browser_interface)); | 91 std::move(browser_interface)); |
| 92 } | 92 } |
| OLD | NEW |