OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CONTENT_BROWSER_GPU_GPU_ARC_VIDEO_SERVICE_HOST_H_ |
| 6 #define CONTENT_BROWSER_GPU_GPU_ARC_VIDEO_SERVICE_HOST_H_ |
| 7 |
| 8 #include "base/macros.h" |
| 9 #include "base/memory/ref_counted.h" |
| 10 #include "base/memory/weak_ptr.h" |
| 11 #include "base/threading/thread_checker.h" |
| 12 #include "components/arc/video/video_host_delegate.h" |
| 13 |
| 14 namespace base { |
| 15 class SingleThreadTaskRunner; |
| 16 } |
| 17 |
| 18 namespace IPC { |
| 19 struct ChannelHandle; |
| 20 } |
| 21 |
| 22 namespace content { |
| 23 |
| 24 // This class passes requests from arc::VideoInstance to GpuArcVideoService to |
| 25 // create a video accelerator channel in GPU process and reply the created |
| 26 // channel. |
| 27 // |
| 28 // Don't be confused two senses of "host" of this class. This class, which |
| 29 // implements arc::VideoHost, handles requests from arc::VideoInstance. At the |
| 30 // same time, as its name says, this class is the host of corresponding class, |
| 31 // GpuArcVideoService, on GPU process. |
| 32 class GpuArcVideoServiceHost : public arc::VideoHostDelegate { |
| 33 public: |
| 34 GpuArcVideoServiceHost(); |
| 35 ~GpuArcVideoServiceHost() override; |
| 36 |
| 37 // arc::VideoHostDelegate implementation. |
| 38 void Shutdown() override; |
| 39 |
| 40 // arc::VideoHost implementation. |
| 41 void OnRequestArcVideoAcceleratorChannel( |
| 42 const OnRequestArcVideoAcceleratorChannelCallback& callback) override; |
| 43 |
| 44 private: |
| 45 void HandleChannelCreatedReply( |
| 46 const OnRequestArcVideoAcceleratorChannelCallback& callback, |
| 47 const IPC::ChannelHandle& handle); |
| 48 |
| 49 base::ThreadChecker thread_checker_; |
| 50 |
| 51 // IO task runner, where GpuProcessHost tasks run. |
| 52 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_; |
| 53 |
| 54 base::WeakPtrFactory<GpuArcVideoServiceHost> weak_factory_; |
| 55 |
| 56 DISALLOW_COPY_AND_ASSIGN(GpuArcVideoServiceHost); |
| 57 }; |
| 58 |
| 59 } // namespace content |
| 60 |
| 61 #endif // CONTENT_BROWSER_GPU_GPU_ARC_VIDEO_SERVICE_HOST_H_ |
OLD | NEW |