| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_BROWSER_MOJO_APP_CONNECTION_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_MOJO_APP_CONNECTION_H_ |
| 6 #define CONTENT_PUBLIC_BROWSER_MOJO_APP_CONNECTION_H_ | 6 #define CONTENT_PUBLIC_BROWSER_MOJO_APP_CONNECTION_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 virtual ~MojoAppConnection() {} | 30 virtual ~MojoAppConnection() {} |
| 31 | 31 |
| 32 // Creates a new connection to the application at |url| using |requestor_url| | 32 // Creates a new connection to the application at |url| using |requestor_url| |
| 33 // to identify the requestor upon connection. This may be called from any | 33 // to identify the requestor upon connection. This may be called from any |
| 34 // thread. | 34 // thread. |
| 35 static scoped_ptr<MojoAppConnection> Create(const GURL& url, | 35 static scoped_ptr<MojoAppConnection> Create(const GURL& url, |
| 36 const GURL& requestor_url); | 36 const GURL& requestor_url); |
| 37 | 37 |
| 38 // Connects to a service within the application. | 38 // Connects to a service within the application. |
| 39 template <typename Interface> | 39 template <typename Interface> |
| 40 void ConnectToService(mojo::InterfacePtr<Interface>* proxy) { | 40 void GetInterface(mojo::InterfacePtr<Interface>* proxy) { |
| 41 ConnectToService(Interface::Name_, mojo::GetProxy(proxy).PassMessagePipe()); | 41 GetInterface(Interface::Name_, mojo::GetProxy(proxy).PassMessagePipe()); |
| 42 } | 42 } |
| 43 | 43 |
| 44 virtual void ConnectToService(const std::string& service_name, | 44 virtual void GetInterface(const std::string& interface_name, |
| 45 mojo::ScopedMessagePipeHandle handle) = 0; | 45 mojo::ScopedMessagePipeHandle handle) = 0; |
| 46 }; | 46 }; |
| 47 | 47 |
| 48 } // namespace content | 48 } // namespace content |
| 49 | 49 |
| 50 #endif // CONTENT_PUBLIC_BROWSER_MOJO_APP_CONNECTION_H_ | 50 #endif // CONTENT_PUBLIC_BROWSER_MOJO_APP_CONNECTION_H_ |
| OLD | NEW |