Chromium Code Reviews| 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 SERVICES_UI_PUBLIC_CPP_GPU_SERVICE_H_ | 5 #ifndef SERVICES_UI_PUBLIC_CPP_GPU_SERVICE_H_ |
| 6 #define SERVICES_UI_PUBLIC_CPP_GPU_SERVICE_H_ | 6 #define SERVICES_UI_PUBLIC_CPP_GPU_SERVICE_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 26 matching lines...) Expand all Loading... | |
| 37 // The GpuService has to be initialized in the main thread before establishing | 37 // The GpuService has to be initialized in the main thread before establishing |
| 38 // the gpu channel. | 38 // the gpu channel. |
| 39 static std::unique_ptr<GpuService> Initialize(shell::Connector* connector); | 39 static std::unique_ptr<GpuService> Initialize(shell::Connector* connector); |
| 40 | 40 |
| 41 // gpu::GpuChannelEstablishFactory: | 41 // gpu::GpuChannelEstablishFactory: |
| 42 void EstablishGpuChannel( | 42 void EstablishGpuChannel( |
| 43 const gpu::GpuChannelEstablishedCallback& callback) override; | 43 const gpu::GpuChannelEstablishedCallback& callback) override; |
| 44 scoped_refptr<gpu::GpuChannelHost> EstablishGpuChannelSync() override; | 44 scoped_refptr<gpu::GpuChannelHost> EstablishGpuChannelSync() override; |
| 45 gpu::GpuMemoryBufferManager* GetGpuMemoryBufferManager() override; | 45 gpu::GpuMemoryBufferManager* GetGpuMemoryBufferManager() override; |
| 46 | 46 |
| 47 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner() { | |
|
enne (OOO)
2016/08/19 20:52:22
I have no idea what I'm doing here, but this looke
| |
| 48 return main_task_runner_; | |
| 49 } | |
| 50 | |
| 47 private: | 51 private: |
| 48 friend struct base::DefaultSingletonTraits<GpuService>; | 52 friend struct base::DefaultSingletonTraits<GpuService>; |
| 49 | 53 |
| 50 explicit GpuService(shell::Connector* connector); | 54 explicit GpuService(shell::Connector* connector); |
| 51 | 55 |
| 52 scoped_refptr<gpu::GpuChannelHost> GetGpuChannelLocked(); | 56 scoped_refptr<gpu::GpuChannelHost> GetGpuChannelLocked(); |
| 53 void EstablishGpuChannelOnMainThread(); | 57 void EstablishGpuChannelOnMainThread(); |
| 54 void EstablishGpuChannelOnMainThreadSyncLocked(); | 58 void EstablishGpuChannelOnMainThreadSyncLocked(); |
| 55 void EstablishGpuChannelOnMainThreadDone( | 59 void EstablishGpuChannelOnMainThreadDone( |
| 56 bool locked, | 60 bool locked, |
| (...skipping 20 matching lines...) Expand all Loading... | |
| 77 scoped_refptr<gpu::GpuChannelHost> gpu_channel_; | 81 scoped_refptr<gpu::GpuChannelHost> gpu_channel_; |
| 78 std::vector<gpu::GpuChannelEstablishedCallback> establish_callbacks_; | 82 std::vector<gpu::GpuChannelEstablishedCallback> establish_callbacks_; |
| 79 base::ConditionVariable establishing_condition_; | 83 base::ConditionVariable establishing_condition_; |
| 80 | 84 |
| 81 DISALLOW_COPY_AND_ASSIGN(GpuService); | 85 DISALLOW_COPY_AND_ASSIGN(GpuService); |
| 82 }; | 86 }; |
| 83 | 87 |
| 84 } // namespace ui | 88 } // namespace ui |
| 85 | 89 |
| 86 #endif // SERVICES_UI_PUBLIC_CPP_GPU_SERVICE_H_ | 90 #endif // SERVICES_UI_PUBLIC_CPP_GPU_SERVICE_H_ |
| OLD | NEW |