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 MOJO_SHELL_IDENTITY_H_ | 5 #ifndef MOJO_SHELL_IDENTITY_H_ |
6 #define MOJO_SHELL_IDENTITY_H_ | 6 #define MOJO_SHELL_IDENTITY_H_ |
7 | 7 |
8 #include "mojo/shell/capability_filter.h" | 8 #include "mojo/shell/capability_filter.h" |
9 #include "url/gurl.h" | 9 #include "url/gurl.h" |
10 | 10 |
(...skipping 12 matching lines...) Expand all Loading... |
23 Identity(); | 23 Identity(); |
24 explicit Identity(const GURL& in_url); | 24 explicit Identity(const GURL& in_url); |
25 Identity(const GURL& in_url, const std::string& in_qualifier); | 25 Identity(const GURL& in_url, const std::string& in_qualifier); |
26 Identity(const GURL& in_url, | 26 Identity(const GURL& in_url, |
27 const std::string& in_qualifier, | 27 const std::string& in_qualifier, |
28 CapabilityFilter filter); | 28 CapabilityFilter filter); |
29 ~Identity(); | 29 ~Identity(); |
30 | 30 |
31 bool operator<(const Identity& other) const; | 31 bool operator<(const Identity& other) const; |
32 bool is_null() const { return url_.is_empty(); } | 32 bool is_null() const { return url_.is_empty(); } |
| 33 bool operator==(const Identity& other) const; |
33 | 34 |
34 const GURL& url() const { return url_; } | 35 const GURL& url() const { return url_; } |
35 const std::string& qualifier() const { return qualifier_; } | 36 const std::string& qualifier() const { return qualifier_; } |
36 const CapabilityFilter& filter() const { return filter_; } | 37 const CapabilityFilter& filter() const { return filter_; } |
37 | 38 |
38 private: | 39 private: |
39 GURL url_; | 40 GURL url_; |
40 std::string qualifier_; | 41 std::string qualifier_; |
41 | 42 |
42 // TODO(beng): CapabilityFilter is not currently included in equivalence | 43 // TODO(beng): CapabilityFilter is not currently included in equivalence |
43 // checks for Identity since we're not currently clear on the | 44 // checks for Identity since we're not currently clear on the |
44 // policy for instance disambiguation. Need to figure this out. | 45 // policy for instance disambiguation. Need to figure this out. |
45 // This field is supplied because it is logically part of the | 46 // This field is supplied because it is logically part of the |
46 // instance identity of an application. | 47 // instance identity of an application. |
47 CapabilityFilter filter_; | 48 CapabilityFilter filter_; |
48 }; | 49 }; |
49 | 50 |
50 // Creates an identity for the Shell, used when the Shell connects to | 51 // Creates an identity for the Shell, used when the Shell connects to |
51 // applications. | 52 // applications. |
52 Identity CreateShellIdentity(); | 53 Identity CreateShellIdentity(); |
53 | 54 |
54 } // namespace shell | 55 } // namespace shell |
55 } // namespace mojo | 56 } // namespace mojo |
56 | 57 |
57 #endif // MOJO_SHELL_IDENTITY_H_ | 58 #endif // MOJO_SHELL_IDENTITY_H_ |
OLD | NEW |