| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_PUBLIC_COMMON_SERVICE_REGISTRY_H_ | 5 #ifndef CONTENT_PUBLIC_COMMON_SERVICE_REGISTRY_H_ |
| 6 #define CONTENT_PUBLIC_COMMON_SERVICE_REGISTRY_H_ | 6 #define CONTENT_PUBLIC_COMMON_SERVICE_REGISTRY_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <utility> |
| 9 | 10 |
| 10 #include "base/bind.h" | 11 #include "base/bind.h" |
| 11 #include "base/callback.h" | 12 #include "base/callback.h" |
| 12 #include "base/strings/string_piece.h" | 13 #include "base/strings/string_piece.h" |
| 13 #include "content/common/content_export.h" | 14 #include "content/common/content_export.h" |
| 14 #include "mojo/public/cpp/bindings/interface_ptr.h" | 15 #include "mojo/public/cpp/bindings/interface_ptr.h" |
| 15 #include "mojo/public/cpp/bindings/interface_request.h" | 16 #include "mojo/public/cpp/bindings/interface_request.h" |
| 16 #include "mojo/public/cpp/system/core.h" | 17 #include "mojo/public/cpp/system/core.h" |
| 17 | 18 |
| 18 namespace content { | 19 namespace content { |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 } | 59 } |
| 59 virtual void ConnectToRemoteService(const base::StringPiece& name, | 60 virtual void ConnectToRemoteService(const base::StringPiece& name, |
| 60 mojo::ScopedMessagePipeHandle handle) = 0; | 61 mojo::ScopedMessagePipeHandle handle) = 0; |
| 61 | 62 |
| 62 private: | 63 private: |
| 63 template <typename Interface> | 64 template <typename Interface> |
| 64 static void ForwardToServiceFactory( | 65 static void ForwardToServiceFactory( |
| 65 const base::Callback<void(mojo::InterfaceRequest<Interface>)> | 66 const base::Callback<void(mojo::InterfaceRequest<Interface>)> |
| 66 service_factory, | 67 service_factory, |
| 67 mojo::ScopedMessagePipeHandle handle) { | 68 mojo::ScopedMessagePipeHandle handle) { |
| 68 service_factory.Run(mojo::MakeRequest<Interface>(handle.Pass())); | 69 service_factory.Run(mojo::MakeRequest<Interface>(std::move(handle))); |
| 69 } | 70 } |
| 70 }; | 71 }; |
| 71 | 72 |
| 72 } // namespace content | 73 } // namespace content |
| 73 | 74 |
| 74 #endif // CONTENT_PUBLIC_COMMON_SERVICE_REGISTRY_H_ | 75 #endif // CONTENT_PUBLIC_COMMON_SERVICE_REGISTRY_H_ |
| OLD | NEW |