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 "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "content/public/common/service_registry.h" | 8 #include "services/shell/public/cpp/interface_registry.h" |
9 | 9 |
10 #if defined(OS_CHROMEOS) | 10 #if defined(OS_CHROMEOS) |
11 #include "chrome/gpu/gpu_arc_video_service.h" | 11 #include "chrome/gpu/gpu_arc_video_service.h" |
12 #endif | 12 #endif |
13 | 13 |
14 #if defined(OS_CHROMEOS) | 14 #if defined(OS_CHROMEOS) |
15 namespace { | 15 namespace { |
16 | 16 |
17 void CreateGpuArcVideoService( | 17 void CreateGpuArcVideoService( |
18 ::arc::mojom::VideoAcceleratorServiceClientRequest request) { | 18 ::arc::mojom::VideoAcceleratorServiceClientRequest request) { |
19 // GpuArcVideoService is strongly bound to the Mojo message pipe it | 19 // GpuArcVideoService is strongly bound to the Mojo message pipe it |
20 // is connected to. When that message pipe is closed, either explicitly on the | 20 // is connected to. When that message pipe is closed, either explicitly on the |
21 // other end (in the browser process), or by a connection error, this object | 21 // other end (in the browser process), or by a connection error, this object |
22 // will be destroyed. | 22 // will be destroyed. |
23 auto* service = new chromeos::arc::GpuArcVideoService(); | 23 auto* service = new chromeos::arc::GpuArcVideoService(); |
24 service->Connect(std::move(request)); | 24 service->Connect(std::move(request)); |
25 } | 25 } |
26 | 26 |
27 } // namespace | 27 } // namespace |
28 #endif | 28 #endif |
29 | 29 |
30 ChromeContentGpuClient::ChromeContentGpuClient() {} | 30 ChromeContentGpuClient::ChromeContentGpuClient() {} |
31 | 31 |
32 ChromeContentGpuClient::~ChromeContentGpuClient() {} | 32 ChromeContentGpuClient::~ChromeContentGpuClient() {} |
33 | 33 |
34 void ChromeContentGpuClient::RegisterMojoServices( | 34 void ChromeContentGpuClient::RegisterMojoInterfaces( |
35 content::ServiceRegistry* registry) { | 35 shell::InterfaceRegistry* registry) { |
36 #if defined(OS_CHROMEOS) | 36 #if defined(OS_CHROMEOS) |
37 registry->AddService(base::Bind(&CreateGpuArcVideoService)); | 37 registry->AddInterface(base::Bind(&CreateGpuArcVideoService)); |
38 #endif | 38 #endif |
39 } | 39 } |
40 | 40 |
41 void ChromeContentGpuClient::Initialize( | 41 void ChromeContentGpuClient::Initialize( |
42 base::FieldTrialList::Observer* observer) { | 42 base::FieldTrialList::Observer* observer) { |
43 DCHECK(!field_trial_syncer_); | 43 DCHECK(!field_trial_syncer_); |
44 field_trial_syncer_.reset( | 44 field_trial_syncer_.reset( |
45 new chrome_variations::ChildProcessFieldTrialSyncer(observer)); | 45 new chrome_variations::ChildProcessFieldTrialSyncer(observer)); |
46 const base::CommandLine& command_line = | 46 const base::CommandLine& command_line = |
47 *base::CommandLine::ForCurrentProcess(); | 47 *base::CommandLine::ForCurrentProcess(); |
48 field_trial_syncer_->InitFieldTrialObserving(command_line); | 48 field_trial_syncer_->InitFieldTrialObserving(command_line); |
49 } | 49 } |
OLD | NEW |