| 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 { | |
| 17 class Connector; | |
| 18 class InterfaceRegistry; | |
| 19 } | |
| 20 | |
| 21 namespace content { | 16 namespace content { |
| 22 | 17 |
| 23 // Embedder API for participating in gpu logic. | 18 // Embedder API for participating in gpu logic. |
| 24 class CONTENT_EXPORT ContentGpuClient { | 19 class CONTENT_EXPORT ContentGpuClient { |
| 25 public: | 20 public: |
| 26 virtual ~ContentGpuClient() {} | 21 virtual ~ContentGpuClient() {} |
| 27 | 22 |
| 28 // Initializes the client. This sets up the field trial synchronization | 23 // Initializes the client. This sets up the field trial synchronization |
| 29 // mechanism, which will notify |observer| when a field trial is activated, | 24 // mechanism, which will notify |observer| when a field trial is activated, |
| 30 // which should be used to inform the browser process of this state. | 25 // which should be used to inform the browser process of this state. |
| 31 virtual void Initialize(base::FieldTrialList::Observer* observer) {} | 26 virtual void Initialize(base::FieldTrialList::Observer* observer) {} |
| 32 | 27 |
| 33 // Allows the client to expose interfaces from the GPU process to the browser | 28 // Called during initialization once the GpuService has been initialized. |
| 34 // process via |registry|. | 29 virtual void GpuServiceInitialized( |
| 35 virtual void ExposeInterfacesToBrowser( | |
| 36 service_manager::InterfaceRegistry* registry, | |
| 37 const gpu::GpuPreferences& gpu_preferences) {} | 30 const gpu::GpuPreferences& gpu_preferences) {} |
| 38 | 31 |
| 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 | 32 // Allows client to supply a SyncPointManager instance instead of having |
| 44 // content internally create one. | 33 // content internally create one. |
| 45 virtual gpu::SyncPointManager* GetSyncPointManager(); | 34 virtual gpu::SyncPointManager* GetSyncPointManager(); |
| 46 }; | 35 }; |
| 47 | 36 |
| 48 } // namespace content | 37 } // namespace content |
| 49 | 38 |
| 50 #endif // CONTENT_PUBLIC_GPU_CONTENT_GPU_CLIENT_H_ | 39 #endif // CONTENT_PUBLIC_GPU_CONTENT_GPU_CLIENT_H_ |
| OLD | NEW |