Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(15)

Side by Side Diff: mojo/public/cpp/application/application_connection.h

Issue 943053003: Simple multi-url support for mojo apps (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 MOJO_PUBLIC_APPLICATION_APPLICATION_CONNECTION_H_ 5 #ifndef MOJO_PUBLIC_APPLICATION_APPLICATION_CONNECTION_H_
6 #define MOJO_PUBLIC_APPLICATION_APPLICATION_CONNECTION_H_ 6 #define MOJO_PUBLIC_APPLICATION_APPLICATION_CONNECTION_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "mojo/public/cpp/application/lib/service_connector.h" 10 #include "mojo/public/cpp/application/lib/service_connector.h"
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 // service. 48 // service.
49 template <typename Interface> 49 template <typename Interface>
50 void ConnectToService(InterfacePtr<Interface>* ptr) { 50 void ConnectToService(InterfacePtr<Interface>* ptr) {
51 if (ServiceProvider* sp = GetServiceProvider()) { 51 if (ServiceProvider* sp = GetServiceProvider()) {
52 MessagePipe pipe; 52 MessagePipe pipe;
53 ptr->Bind(pipe.handle0.Pass()); 53 ptr->Bind(pipe.handle0.Pass());
54 sp->ConnectToService(Interface::Name_, pipe.handle1.Pass()); 54 sp->ConnectToService(Interface::Name_, pipe.handle1.Pass());
55 } 55 }
56 } 56 }
57 57
58 // Returns the URL that was used by the source application to establish a
59 // connection to the destination application.
60 //
61 // When ApplicationConnection is representing an incoming connection this can
62 // be different than the URL the application was initially loaded from, if the
63 // application handles multiple URLs. Note that this is the URL after all
64 // URL rewriting and HTTP redirects have been performed.
65 //
66 // When ApplicationConnection is representing and outgoing connection, this
67 // will be the same as the value returned by GetRemoveApplicationURL().
68 virtual const std::string& GetConnectionURL() = 0;
69
58 // Returns the URL identifying the remote application on this connection. 70 // Returns the URL identifying the remote application on this connection.
59 virtual const std::string& GetRemoteApplicationURL() = 0; 71 virtual const std::string& GetRemoteApplicationURL() = 0;
60 72
61 // Returns the raw proxy to the remote application's ServiceProvider 73 // Returns the raw proxy to the remote application's ServiceProvider
62 // interface. Most applications will just use ConnectToService() instead. 74 // interface. Most applications will just use ConnectToService() instead.
63 // Caller does not take ownership. 75 // Caller does not take ownership.
64 virtual ServiceProvider* GetServiceProvider() = 0; 76 virtual ServiceProvider* GetServiceProvider() = 0;
65 77
66 private: 78 private:
67 virtual void AddServiceConnector( 79 virtual void AddServiceConnector(
68 internal::ServiceConnectorBase* service_connector) = 0; 80 internal::ServiceConnectorBase* service_connector) = 0;
69 }; 81 };
70 82
71 } // namespace mojo 83 } // namespace mojo
72 84
73 #endif // MOJO_PUBLIC_APPLICATION_APPLICATION_CONNECTION_H_ 85 #endif // MOJO_PUBLIC_APPLICATION_APPLICATION_CONNECTION_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698