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 #ifndef CONTENT_PUBLIC_GPU_CONTENT_GPU_CLIENT_H_ | 5 #ifndef CONTENT_PUBLIC_GPU_CONTENT_GPU_CLIENT_H_ |
6 #define CONTENT_PUBLIC_GPU_CONTENT_GPU_CLIENT_H_ | 6 #define CONTENT_PUBLIC_GPU_CONTENT_GPU_CLIENT_H_ |
7 | 7 |
8 #include "base/metrics/field_trial.h" | 8 #include "base/metrics/field_trial.h" |
9 #include "content/public/common/content_client.h" | 9 #include "content/public/common/content_client.h" |
10 | 10 |
11 namespace gpu { | 11 namespace gpu { |
12 class SyncPointManager; | 12 class SyncPointManager; |
13 struct GpuPreferences; | 13 struct GpuPreferences; |
14 } | 14 } |
15 | 15 |
16 namespace service_manager { | 16 namespace service_manager { |
17 class Connector; | 17 class BinderRegistry; |
18 class InterfaceRegistry; | |
19 } | 18 } |
20 | 19 |
21 namespace content { | 20 namespace content { |
22 | 21 |
23 // Embedder API for participating in gpu logic. | 22 // Embedder API for participating in gpu logic. |
24 class CONTENT_EXPORT ContentGpuClient { | 23 class CONTENT_EXPORT ContentGpuClient { |
25 public: | 24 public: |
26 virtual ~ContentGpuClient() {} | 25 virtual ~ContentGpuClient() {} |
27 | 26 |
28 // Initializes the client. This sets up the field trial synchronization | 27 // Initializes the client. This sets up the field trial synchronization |
29 // mechanism, which will notify |observer| when a field trial is activated, | 28 // mechanism, which will notify |observer| when a field trial is activated, |
30 // which should be used to inform the browser process of this state. | 29 // which should be used to inform the browser process of this state. |
31 virtual void Initialize(base::FieldTrialList::Observer* observer) {} | 30 // |registry| will be passed to a ConnectionFilter (which lives on the IO |
| 31 // thread). Unlike other childthreads, the client must register additional |
| 32 // interfaces on this registry rather than just creating more |
| 33 // ConnectionFilters as the ConnectionFilter that wraps this registry |
| 34 // specifically does not bind any interface requests until after the Gpu |
| 35 // process receives CreateGpuService() from the browser. |
| 36 virtual void Initialize(base::FieldTrialList::Observer* observer, |
| 37 service_manager::BinderRegistry* registry) {} |
32 | 38 |
33 // Allows the client to expose interfaces from the GPU process to the browser | 39 // Called during initialization once the GpuService has been initialized. |
34 // process via |registry|. | 40 virtual void GpuServiceInitialized( |
35 virtual void ExposeInterfacesToBrowser( | |
36 service_manager::InterfaceRegistry* registry, | |
37 const gpu::GpuPreferences& gpu_preferences) {} | 41 const gpu::GpuPreferences& gpu_preferences) {} |
38 | 42 |
39 // Allow the client to bind interfaces exposed by the browser process. | |
40 virtual void ConsumeInterfacesFromBrowser( | |
41 service_manager::Connector* connector) {} | |
42 | |
43 // Allows client to supply a SyncPointManager instance instead of having | 43 // Allows client to supply a SyncPointManager instance instead of having |
44 // content internally create one. | 44 // content internally create one. |
45 virtual gpu::SyncPointManager* GetSyncPointManager(); | 45 virtual gpu::SyncPointManager* GetSyncPointManager(); |
46 }; | 46 }; |
47 | 47 |
48 } // namespace content | 48 } // namespace content |
49 | 49 |
50 #endif // CONTENT_PUBLIC_GPU_CONTENT_GPU_CLIENT_H_ | 50 #endif // CONTENT_PUBLIC_GPU_CONTENT_GPU_CLIENT_H_ |
OLD | NEW |