| 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 SERVICES_SHELL_PUBLIC_CPP_CONNECTOR_H_ | 5 #ifndef SERVICES_SHELL_PUBLIC_CPP_CONNECTOR_H_ |
| 6 #define SERVICES_SHELL_PUBLIC_CPP_CONNECTOR_H_ | 6 #define SERVICES_SHELL_PUBLIC_CPP_CONNECTOR_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "services/shell/public/cpp/connection.h" | 10 #include "services/shell/public/cpp/connection.h" |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 private: | 65 private: |
| 66 Identity target_; | 66 Identity target_; |
| 67 mojom::ServicePtr service_; | 67 mojom::ServicePtr service_; |
| 68 mojom::PIDReceiverRequest pid_receiver_request_; | 68 mojom::PIDReceiverRequest pid_receiver_request_; |
| 69 InterfaceRegistry* exposed_interfaces_ = nullptr; | 69 InterfaceRegistry* exposed_interfaces_ = nullptr; |
| 70 InterfaceProvider* remote_interfaces_ = nullptr; | 70 InterfaceProvider* remote_interfaces_ = nullptr; |
| 71 | 71 |
| 72 DISALLOW_COPY_AND_ASSIGN(ConnectParams); | 72 DISALLOW_COPY_AND_ASSIGN(ConnectParams); |
| 73 }; | 73 }; |
| 74 | 74 |
| 75 // Creates a new Connector instance and fills in |*request| with a request | |
| 76 // for the other end the Connector's interface. | |
| 77 static std::unique_ptr<Connector> Create(mojom::ConnectorRequest* request); | |
| 78 | |
| 79 // Requests a new connection to an application. Returns a pointer to the | 75 // Requests a new connection to an application. Returns a pointer to the |
| 80 // connection if the connection is permitted by this application's delegate, | 76 // connection if the connection is permitted by this application's delegate, |
| 81 // or nullptr otherwise. Caller takes ownership. | 77 // or nullptr otherwise. Caller takes ownership. |
| 82 // Once this method is called, this object is bound to the thread on which the | 78 // Once this method is called, this object is bound to the thread on which the |
| 83 // call took place. To pass to another thread, call Clone() and pass the | 79 // call took place. To pass to another thread, call Clone() and pass the |
| 84 // result. | 80 // result. |
| 85 virtual std::unique_ptr<Connection> Connect(const std::string& name) = 0; | 81 virtual std::unique_ptr<Connection> Connect(const std::string& name) = 0; |
| 86 virtual std::unique_ptr<Connection> Connect(ConnectParams* params) = 0; | 82 virtual std::unique_ptr<Connection> Connect(ConnectParams* params) = 0; |
| 87 | 83 |
| 88 // Connect to application identified by |request->name| and connect to the | 84 // Connect to application identified by |request->name| and connect to the |
| (...skipping 20 matching lines...) Expand all Loading... |
| 109 | 105 |
| 110 // Creates a new instance of this class which may be passed to another thread. | 106 // Creates a new instance of this class which may be passed to another thread. |
| 111 // The returned object may be passed multiple times until Connect() is called, | 107 // The returned object may be passed multiple times until Connect() is called, |
| 112 // at which point this method must be called again to pass again. | 108 // at which point this method must be called again to pass again. |
| 113 virtual std::unique_ptr<Connector> Clone() = 0; | 109 virtual std::unique_ptr<Connector> Clone() = 0; |
| 114 }; | 110 }; |
| 115 | 111 |
| 116 } // namespace shell | 112 } // namespace shell |
| 117 | 113 |
| 118 #endif // SERVICES_SHELL_PUBLIC_CPP_CONNECTOR_H_ | 114 #endif // SERVICES_SHELL_PUBLIC_CPP_CONNECTOR_H_ |
| OLD | NEW |