| 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 #ifndef CONTENT_BROWSER_MEDIA_MEDIA_INTERFACE_PROXY_H_ | 5 #ifndef CONTENT_BROWSER_MEDIA_MEDIA_INTERFACE_PROXY_H_ |
| 6 #define CONTENT_BROWSER_MEDIA_MEDIA_INTERFACE_PROXY_H_ | 6 #define CONTENT_BROWSER_MEDIA_MEDIA_INTERFACE_PROXY_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "base/threading/thread_checker.h" | 12 #include "base/threading/thread_checker.h" |
| 13 #include "media/mojo/interfaces/interface_factory.mojom.h" | 13 #include "media/mojo/interfaces/interface_factory.mojom.h" |
| 14 #include "mojo/public/cpp/bindings/binding.h" | 14 #include "mojo/public/cpp/bindings/binding.h" |
| 15 #include "services/service_manager/public/cpp/interface_registry.h" | 15 |
| 16 namespace media { |
| 17 class MediaInterfaceProvider; |
| 18 } |
| 16 | 19 |
| 17 namespace content { | 20 namespace content { |
| 18 | 21 |
| 19 class RenderFrameHost; | 22 class RenderFrameHost; |
| 20 | 23 |
| 21 // This implements the media::mojom::InterfaceFactory interface for | 24 // This implements the media::mojom::InterfaceFactory interface for |
| 22 // RenderFrameHostImpl. Upon media::mojom::InterfaceFactory calls, it will | 25 // RenderFrameHostImpl. Upon media::mojom::InterfaceFactory calls, it will |
| 23 // figure out where to forward to the interface requests. | 26 // figure out where to forward to the interface requests. |
| 24 class MediaInterfaceProxy : public media::mojom::InterfaceFactory { | 27 class MediaInterfaceProxy : public media::mojom::InterfaceFactory { |
| 25 public: | 28 public: |
| (...skipping 18 matching lines...) Expand all Loading... |
| 44 // Callback for connection error on |interface_factory_ptr_|. | 47 // Callback for connection error on |interface_factory_ptr_|. |
| 45 void OnConnectionError(); | 48 void OnConnectionError(); |
| 46 | 49 |
| 47 void ConnectToService(); | 50 void ConnectToService(); |
| 48 | 51 |
| 49 // Safe to hold a raw pointer since |this| is owned by RenderFrameHostImpl. | 52 // Safe to hold a raw pointer since |this| is owned by RenderFrameHostImpl. |
| 50 RenderFrameHost* render_frame_host_; | 53 RenderFrameHost* render_frame_host_; |
| 51 | 54 |
| 52 // TODO(xhwang): Replace InterfaceProvider with a dedicated host interface. | 55 // TODO(xhwang): Replace InterfaceProvider with a dedicated host interface. |
| 53 // See http://crbug.com/660573 | 56 // See http://crbug.com/660573 |
| 54 std::vector<std::unique_ptr<service_manager::InterfaceRegistry>> | 57 std::vector<std::unique_ptr<media::MediaInterfaceProvider>> media_registries_; |
| 55 media_registries_; | |
| 56 | 58 |
| 57 mojo::Binding<media::mojom::InterfaceFactory> binding_; | 59 mojo::Binding<media::mojom::InterfaceFactory> binding_; |
| 58 | 60 |
| 59 // InterfacePtr to the remote media::mojom::InterfaceFactory implementation. | 61 // InterfacePtr to the remote media::mojom::InterfaceFactory implementation. |
| 60 media::mojom::InterfaceFactoryPtr interface_factory_ptr_; | 62 media::mojom::InterfaceFactoryPtr interface_factory_ptr_; |
| 61 | 63 |
| 62 base::ThreadChecker thread_checker_; | 64 base::ThreadChecker thread_checker_; |
| 63 | 65 |
| 64 DISALLOW_COPY_AND_ASSIGN(MediaInterfaceProxy); | 66 DISALLOW_COPY_AND_ASSIGN(MediaInterfaceProxy); |
| 65 }; | 67 }; |
| 66 | 68 |
| 67 } // namespace content | 69 } // namespace content |
| 68 | 70 |
| 69 #endif // CONTENT_BROWSER_MEDIA_MEDIA_INTERFACE_PROXY_H_ | 71 #endif // CONTENT_BROWSER_MEDIA_MEDIA_INTERFACE_PROXY_H_ |
| OLD | NEW |