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

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

Issue 2250183003: Make the fuchsia mojo/public repo the source of truth. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 4 years, 4 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef MOJO_PUBLIC_APPLICATION_CONNECTION_CONTEXT_H_
6 #define MOJO_PUBLIC_APPLICATION_CONNECTION_CONTEXT_H_
7
8 #include <string>
9
10 namespace mojo {
11
12 // A |ConnectionContext| is used to track context about a given message pipe
13 // connection. It is usually associated to the "impl" side of an interface.
14 //
15 // |Application| (see //mojo/public/interfaces/application/application.mojom)
16 // accepts a message that looks like:
17 //
18 // AcceptConnection(string requestor_url,
19 // string resolved_url,
20 // ServiceProvider& services);
21 //
22 // Upon handling |AcceptConnection()|, the |ServiceProvider| implementation
23 // bound to |services| is given a |ConnectionContext| with |type =
24 // Type::INCOMING|, |remote_url = requestor_url|, and |connection_url =
25 // resolved_url|.
26 //
27 // The |ConnectionContext| is meant to be propagated: If the remote side uses
28 // its |ServiceProviderPtr| to request a |Foo| (from the local side), then the
29 // |Foo| implementation (again, on the local side) may be given (a copy of) the
30 // |ConnectionContext| described above.
31 struct ConnectionContext {
32 enum class Type {
33 UNKNOWN = 0,
34 INCOMING,
35 };
36
37 ConnectionContext() {}
38 ConnectionContext(Type type,
39 const std::string& remote_url,
40 const std::string& connection_url)
41 : type(type), remote_url(remote_url), connection_url(connection_url) {}
42
43 Type type = Type::UNKNOWN;
44
45 // The URL of the remote side of this connection (as provided by the |Shell|);
46 // if unknown/not applicable, this is empty.
47 std::string remote_url;
48
49 // The URL used by the remote side to establish "this" connection (or a parent
50 // thereof); if unknown/not applicable, this is empty.
51 std::string connection_url;
52 };
53
54 } // namespace mojo
55
56 #endif // MOJO_PUBLIC_APPLICATION_CONNECTION_CONTEXT_H_
OLDNEW
« no previous file with comments | « mojo/public/cpp/application/connect.h ('k') | mojo/public/cpp/application/lib/application_impl_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698