| 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 #include "chrome/browser/chromeos/arc/video/gpu_arc_video_service_host.h" | 5 #include "chrome/browser/chromeos/arc/video/gpu_arc_video_service_host.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/location.h" | 10 #include "base/location.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 #include "mojo/edk/embedder/platform_channel_pair.h" | 21 #include "mojo/edk/embedder/platform_channel_pair.h" |
| 22 #include "mojo/public/cpp/bindings/strong_binding.h" | 22 #include "mojo/public/cpp/bindings/strong_binding.h" |
| 23 #include "services/service_manager/public/cpp/interface_provider.h" | 23 #include "services/service_manager/public/cpp/interface_provider.h" |
| 24 | 24 |
| 25 namespace arc { | 25 namespace arc { |
| 26 | 26 |
| 27 namespace { | 27 namespace { |
| 28 | 28 |
| 29 void ConnectToVideoAcceleratorServiceOnIOThread( | 29 void ConnectToVideoAcceleratorServiceOnIOThread( |
| 30 mojom::VideoAcceleratorServiceRequest request) { | 30 mojom::VideoAcceleratorServiceRequest request) { |
| 31 content::GetGpuRemoteInterfaces()->GetInterface(std::move(request)); | 31 content::BindInterfaceInGpuProcess(std::move(request)); |
| 32 } | 32 } |
| 33 | 33 |
| 34 } // namespace | 34 } // namespace |
| 35 | 35 |
| 36 class VideoAcceleratorFactoryService : public mojom::VideoAcceleratorFactory { | 36 class VideoAcceleratorFactoryService : public mojom::VideoAcceleratorFactory { |
| 37 public: | 37 public: |
| 38 VideoAcceleratorFactoryService() = default; | 38 VideoAcceleratorFactoryService() = default; |
| 39 | 39 |
| 40 void Create(mojom::VideoAcceleratorServiceRequest request) override { | 40 void Create(mojom::VideoAcceleratorServiceRequest request) override { |
| 41 content::BrowserThread::PostTask( | 41 content::BrowserThread::PostTask( |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 std::string token; | 92 std::string token; |
| 93 mojo::ScopedMessagePipeHandle server_pipe = process.CreateMessagePipe(&token); | 93 mojo::ScopedMessagePipeHandle server_pipe = process.CreateMessagePipe(&token); |
| 94 callback.Run(std::move(child_handle), token); | 94 callback.Run(std::move(child_handle), token); |
| 95 | 95 |
| 96 mojo::MakeStrongBinding(base::MakeUnique<VideoAcceleratorFactoryService>(), | 96 mojo::MakeStrongBinding(base::MakeUnique<VideoAcceleratorFactoryService>(), |
| 97 mojo::MakeRequest<mojom::VideoAcceleratorFactory>( | 97 mojo::MakeRequest<mojom::VideoAcceleratorFactory>( |
| 98 std::move(server_pipe))); | 98 std::move(server_pipe))); |
| 99 } | 99 } |
| 100 | 100 |
| 101 } // namespace arc | 101 } // namespace arc |
| OLD | NEW |