Chromium Code Reviews| Index: chrome/browser/chromeos/arc/gpu_arc_video_service_host.h |
| diff --git a/chrome/browser/chromeos/arc/gpu_arc_video_service_host.h b/chrome/browser/chromeos/arc/gpu_arc_video_service_host.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..8db314e9ed68d074a339ef7f9bb76773e1a946aa |
| --- /dev/null |
| +++ b/chrome/browser/chromeos/arc/gpu_arc_video_service_host.h |
| @@ -0,0 +1,69 @@ |
| +// Copyright 2016 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CHROME_BROWSER_CHROMEOS_ARC_GPU_ARC_VIDEO_SERVICE_HOST_H_ |
| +#define CHROME_BROWSER_CHROMEOS_ARC_GPU_ARC_VIDEO_SERVICE_HOST_H_ |
| + |
| +#include "base/macros.h" |
| +#include "base/memory/ref_counted.h" |
| +#include "base/threading/thread_checker.h" |
| +#include "components/arc/arc_bridge_service.h" |
| +#include "components/arc/arc_service.h" |
| +#include "components/arc/common/video.mojom.h" |
| +#include "mojo/public/cpp/bindings/binding.h" |
| +#include "mojo/public/cpp/bindings/interface_ptr_info.h" |
| + |
| +namespace base { |
| +class SingleThreadTaskRunner; |
| +} |
| + |
| +namespace arc { |
| + |
| +// This class passes requests from arc::VideoInstance to GpuArcVideoService to |
|
Owen Lin
2016/03/14 08:45:52
s/passes/takes/
How aobut:
This class takes reque
kcwu
2016/03/14 12:55:49
Done.
|
| +// create a video accelerator channel in GPU process and reply the created |
| +// channel. |
| +// |
| +// Don't be confused two senses of "host" of this class. This class, which |
| +// implements arc::VideoHost, handles requests from arc::VideoInstance. At the |
| +// same time, as its name says, this class is the host of corresponding class, |
| +// GpuArcVideoService, in the GPU process. |
|
Owen Lin
2016/03/14 08:45:52
I don't think this comment helps. I would suggest
kcwu
2016/03/14 12:55:49
Done.
|
| +class GpuArcVideoServiceHost : public arc::ArcService, |
| + public arc::ArcBridgeService::Observer, |
| + public arc::VideoHost { |
| + public: |
| + explicit GpuArcVideoServiceHost(arc::ArcBridgeService* bridge_service); |
| + ~GpuArcVideoServiceHost() override; |
| + |
| + // arc::ArcBridgeService::Observer implementation. |
| + void OnVideoInstanceReady() override; |
| + void OnVideoInstanceClosed() override; |
| + |
| + // arc::VideoHost implementation. |
| + void OnRequestArcVideoAcceleratorChannel( |
| + uint32_t pid, |
| + const OnRequestArcVideoAcceleratorChannelCallback& callback) override; |
| + |
| + private: |
| + void BindServiceAndCreateChannel( |
| + uint32_t pid, |
| + const OnRequestArcVideoAcceleratorChannelCallback& callback, |
| + mojo::InterfacePtrInfo<arc::VideoHost>* ptr_info); |
| + |
| + base::ThreadChecker thread_checker_; |
| + |
| + mojo::Binding<arc::VideoHost> binding_; |
| + |
| + // IO task runner, where GpuProcessHost tasks run. |
| + scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_; |
| + |
| + arc::VideoHostPtr service_ptr_; |
| + |
| + base::WeakPtrFactory<GpuArcVideoServiceHost> weak_factory_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(GpuArcVideoServiceHost); |
| +}; |
| + |
| +} // namespace arc |
| + |
| +#endif // CHROME_BROWSER_CHROMEOS_ARC_GPU_ARC_VIDEO_SERVICE_HOST_H_ |