Chromium Code Reviews| 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/weak_ptr.h" | |
| 10 #include "base/threading/non_thread_safe.h" | |
| 11 #include "components/arc/arc_bridge_service.h" | |
| 12 #include "components/arc/common/video.mojom.h" | |
| 13 #include "components/arc/video/arc_video_service.h" | |
| 14 #include "ipc/ipc_channel_handle.h" | |
| 15 #include "mojo/public/cpp/bindings/binding.h" | |
| 16 | |
| 17 namespace content { | |
| 18 | |
| 19 // This class passes requests from ArcBridgeService to GpuArcVideoService to | |
| 20 // create a video accelerator channel in GPU process and sends the created | |
| 21 // channel back to ArcBridgeService. | |
| 22 class GpuArcVideoServiceHost : public base::NonThreadSafe, | |
|
dcheng
2015/12/29 00:43:23
Use base::ThreadChecker instead of inheriting.
kcwu
2015/12/29 03:36:32
Done.
| |
| 23 public arc::VideoHost, | |
| 24 public arc::ArcVideoService, | |
| 25 public arc::ArcBridgeService::Observer { | |
| 26 public: | |
| 27 GpuArcVideoServiceHost(); | |
| 28 ~GpuArcVideoServiceHost() override; | |
| 29 | |
| 30 // arc::ArcVideoService implementation. | |
| 31 void Initialize() override; | |
| 32 | |
| 33 // arc::ArcBridgeService::Observer implementation. | |
| 34 void OnStateChanged(arc::ArcBridgeService::State state) override; | |
| 35 void OnVideoInstanceReady() override; | |
| 36 | |
| 37 // arc::VideoHost implementation. | |
| 38 void OnRequestArcVideoAcceleratorChannel( | |
| 39 const OnRequestArcVideoAcceleratorChannelCallback& callback) override; | |
| 40 | |
| 41 private: | |
| 42 void HandleChannelCreatedReply( | |
| 43 const OnRequestArcVideoAcceleratorChannelCallback& callback, | |
| 44 const IPC::ChannelHandle& handle); | |
| 45 | |
| 46 void Shutdown(); | |
| 47 | |
| 48 // IO task runner, where GpuProcessHost tasks run. | |
| 49 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_; | |
| 50 | |
| 51 mojo::Binding<arc::VideoHost> binding_; | |
| 52 | |
| 53 base::WeakPtrFactory<GpuArcVideoServiceHost> weak_factory_; | |
| 54 | |
| 55 DISALLOW_COPY_AND_ASSIGN(GpuArcVideoServiceHost); | |
| 56 }; | |
| 57 | |
| 58 } // namespace content | |
| 59 | |
| 60 #endif // CONTENT_BROWSER_GPU_GPU_ARC_VIDEO_SERVICE_HOST_H_ | |
| OLD | NEW |