Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROME_GPU_GPU_ARC_VIDEO_SERVICE_H_ | |
| 6 #define CHROME_GPU_GPU_ARC_VIDEO_SERVICE_H_ | |
| 7 | |
| 8 #include <map> | |
| 9 | |
| 10 #include "base/macros.h" | |
| 11 #include "components/arc/common/video.mojom.h" | |
| 12 #include "mojo/public/cpp/bindings/strong_binding.h" | |
| 13 | |
| 14 namespace chromeos { | |
| 15 namespace arc { | |
| 16 | |
| 17 // GpuArcVideoService manages life-cycle and IPC message translation for | |
| 18 // ArcVideoAccelerator. | |
| 19 // | |
| 20 // For each creation request from GpuArcVideoServiceHost, GpuArcVideoService | |
| 21 // will create a new IPC channel. | |
| 22 class GpuArcVideoService : public ::arc::VideoHost { | |
| 23 public: | |
| 24 class AcceleratorStub; | |
| 25 | |
| 26 // |request| is mojo interface request of arc::VideoHost. | |
| 27 explicit GpuArcVideoService(mojo::InterfaceRequest<::arc::VideoHost> request); | |
| 28 | |
| 29 // Upon deletion, all ArcVideoAccelerator will be deleted and the associated | |
| 30 // IPC channels are closed. | |
| 31 ~GpuArcVideoService() override; | |
| 32 | |
| 33 // Removes the reference of |stub| (and trigger deletion) from this class. | |
| 34 void RemoveClient(AcceleratorStub* stub); | |
| 35 | |
| 36 private: | |
| 37 // arc::VideoHost implementation. | |
| 38 void OnRequestArcVideoAcceleratorChannel( | |
| 39 const OnRequestArcVideoAcceleratorChannelCallback& callback) override; | |
| 40 | |
| 41 base::ThreadChecker thread_checker_; | |
| 42 | |
| 43 // Binding of arc::VideoHost. It also takes ownership of |this|. | |
| 44 mojo::StrongBinding<::arc::VideoHost> binding_; | |
| 45 | |
| 46 // Bookkeeping all accelerator stubs. | |
| 47 std::map<AcceleratorStub*, scoped_ptr<AcceleratorStub>> accelerator_stubs_; | |
|
dcheng
2016/04/07 02:17:57
Use unique_ptr. Also, don't forget to #include <me
kcwu
2016/04/07 08:17:57
Done.
| |
| 48 | |
| 49 DISALLOW_COPY_AND_ASSIGN(GpuArcVideoService); | |
| 50 }; | |
| 51 | |
| 52 } // namespace arc | |
| 53 } // namespace chromeos | |
| 54 | |
| 55 #endif // CHROME_GPU_GPU_ARC_VIDEO_SERVICE_H_ | |
| OLD | NEW |